Browse Source

TopicAdapter fix

pull/24/head
Apostolos Fanakis 8 years ago
parent
commit
f929790d8d
  1. 12
      app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicAdapter.java

12
app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicAdapter.java

@ -236,10 +236,14 @@ class TopicAdapter extends RecyclerView.Adapter<TopicAdapter.MyViewHolder> {
/* --Header expand/collapse functionality-- */ /* --Header expand/collapse functionality-- */
//Check if current post's header is expanded //Check if current post's header is expanded
if (viewProperties.get(position)[isUserExtraInfoVisibile]) //Expanded if (viewProperties.get(position)[isUserExtraInfoVisibile]) { //Expanded
holder.userExtraInfo.setVisibility(View.VISIBLE); holder.userExtraInfo.setVisibility(View.VISIBLE);
else //Collapsed holder.userExtraInfo.setAlpha(1.0f);
}
else { //Collapsed
holder.userExtraInfo.setVisibility(View.GONE); holder.userExtraInfo.setVisibility(View.GONE);
holder.userExtraInfo.setAlpha(0.0f);
}
holder.header.setOnClickListener(new View.OnClickListener() { holder.header.setOnClickListener(new View.OnClickListener() {
@Override @Override
@ -273,6 +277,8 @@ class TopicAdapter extends RecyclerView.Adapter<TopicAdapter.MyViewHolder> {
//Check if current post is expanded //Check if current post is expanded
if (viewProperties.get(position)[isPostDateAndNumberVisibile]) { //Expanded if (viewProperties.get(position)[isPostDateAndNumberVisibile]) { //Expanded
holder.postDateAndNumberExp.setVisibility(View.VISIBLE); holder.postDateAndNumberExp.setVisibility(View.VISIBLE);
holder.postDateAndNumberExp.setAlpha(1.0f);
holder.postDateAndNumberExp.setTranslationY(0);
holder.username.setMaxLines(Integer.MAX_VALUE); holder.username.setMaxLines(Integer.MAX_VALUE);
holder.username.setEllipsize(null); holder.username.setEllipsize(null);
@ -282,6 +288,8 @@ class TopicAdapter extends RecyclerView.Adapter<TopicAdapter.MyViewHolder> {
holder.subject.setEllipsize(null); holder.subject.setEllipsize(null);
} else { //Collapsed } else { //Collapsed
holder.postDateAndNumberExp.setVisibility(View.GONE); holder.postDateAndNumberExp.setVisibility(View.GONE);
holder.postDateAndNumberExp.setAlpha(0.0f);
holder.postDateAndNumberExp.setTranslationY(holder.postDateAndNumberExp.getHeight());
holder.username.setMaxLines(1); holder.username.setMaxLines(1);
holder.username.setEllipsize(TextUtils.TruncateAt.END); holder.username.setEllipsize(TextUtils.TruncateAt.END);

Loading…
Cancel
Save