ExpandableTextView
ExpandableTextView copied to clipboard
ExpandableTextView inside an ExpandableListView - collapsing problem
I'm trying to get some ExpandableTextView
inside an ExpandableListView.
I run into a problem like so:
- Expand the ExpandableListView
- Expand the ExpandableTextView
- Collapse the ExpandableListView
- Reopen the ExpandableListView and at first everything seems OK...
- Collapse the ExpandableTextView, it doesn't collapse properly
I've prepared a gif
And a git repo to reproduce the problem:
https://github.com/mendhak/expandable-textview-in-expandable-listview-problem
Is there anything I can do to prevent this, maybe some way of forcing the ETV to collapse in the ELV click handler?
Hello, I think i know, how we can resolve this issue. add this code after line #119 in ExpandableTextView (onClick method):
if (0 == mCollapsedHeight) {
mCollapsedHeight = mTextView.getLineHeight() * Math.min(mMaxCollapsedLines, mTextView.getLineCount()) + (-mTextView.getLayout().getTopPadding()) + mTextView.getLayout().getBottomPadding();
}