Manabu-GT / ExpandableTextView

Android's TextView that can expand/collapse like the Google Play's app description
Apache License 2.0
4.08k stars 791 forks source link

collapse do not work #40

Closed qiu1992 closed 8 years ago

qiu1992 commented 8 years ago

I checked out your code,and run ,finally found it didn't work(collapse).After debug it ,I found the height is not correct(mCollapsedHeight).here is my solution.

problem code: if (mCollapsed) { animation = new ExpandCollapseAnimation(this, getHeight(), mCollapsedHeight); } else { animation = new ExpandCollapseAnimation(this, getHeight(), getHeight() + mTextHeightWithMaxLines - mTv.getHeight()); } ////////////////////////// solution: if (mCollapsed) { animation = new ExpandCollapseAnimation(this, getHeight(), oldHeight); } else { animation = new ExpandCollapseAnimation(this, getHeight(), getHeight() + mTextHeightWithMaxLines - mTv.getHeight()); oldHeight = getHeight (); }

qiu1992 commented 8 years ago

sorry ,it was my mistake.because the layout have a parent layout which height is match parent