ExpandableTextView icon indicating copy to clipboard operation
ExpandableTextView copied to clipboard

ExpandableTextView inside an ExpandableListView - collapsing problem

Open mendhak opened this issue 9 years ago • 1 comments

I'm trying to get some ExpandableTextView inside an ExpandableListView.

I run into a problem like so:

  1. Expand the ExpandableListView
  2. Expand the ExpandableTextView
  3. Collapse the ExpandableListView
  4. Reopen the ExpandableListView and at first everything seems OK...
  5. Collapse the ExpandableTextView, it doesn't collapse properly

I've prepared a gif

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?

mendhak avatar Aug 30 '15 14:08 mendhak

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

ultraon avatar Feb 20 '16 20:02 ultraon