Skip to content

Commit

Permalink
refactor: Add Click Listeners to Expand/Collapse Image Anchors
Browse files Browse the repository at this point in the history
  • Loading branch information
kaushiknsanji committed Oct 20, 2019
1 parent afb8828 commit 0cdcd0c
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -591,13 +591,15 @@ public void onClick(View view) {
}
break;
case R.id.detail_title_text_id:
//For the Title TextView
case R.id.detail_title_text_expand_img_id:
//For the Title TextView and its expand image anchor
//Expand/Collapse the Title TextView when clicked
toggleTextViewExpansion(mTitleTextView, getResources().getInteger(R.integer.detail_title_text_max_lines),
mTitleTextExpandImageView);
break;
case R.id.detail_author_text_id:
//For the Author TextView
case R.id.detail_author_text_expand_img_id:
//For the Author TextView and its expand image anchor
//Expand/Collapse the Author TextView when clicked
toggleTextViewExpansion(mAuthorTextView, getResources().getInteger(R.integer.detail_author_text_max_lines),
mAuthorTextExpandImageView);
Expand Down Expand Up @@ -657,17 +659,19 @@ private void addExpandableStateForEllipsizedTextViews(TextView textView) {
//Displaying the expand image anchor for the lengthy Title Text
mTitleTextExpandImageView.setVisibility(View.VISIBLE);

//Registering the click listener on the Title TextView
//Registering the click listener on the Title TextView and its expand image anchor
mTitleTextView.setOnClickListener(this);
mTitleTextExpandImageView.setOnClickListener(this);
}
break;
case R.id.detail_author_text_id:
if (mAuthorTextExpandImageView.getVisibility() == View.GONE) {
//Displaying the expand image anchor for the lengthy Author Text
mAuthorTextExpandImageView.setVisibility(View.VISIBLE);

//Registering the click listener on the Author TextView
//Registering the click listener on the Author TextView and its expand image anchor
mAuthorTextView.setOnClickListener(this);
mAuthorTextExpandImageView.setOnClickListener(this);
}
break;
}
Expand Down

0 comments on commit 0cdcd0c

Please sign in to comment.