Manabu-GT/ExpandableTextView

collapse do not work

Closed this issue · 1 comments

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 (); }

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