expandablerecycler icon indicating copy to clipboard operation
expandablerecycler copied to clipboard

How do I make sure to set only one item expanded at any given point of time?

Open manideepla opened this issue 5 years ago • 1 comments
trafficstars

manideepla avatar Feb 04 '20 13:02 manideepla

Instead of saving the state of each of your items, you only need to save the index of one item (the expanded one). Inside click listener, check the index of the previous expanded item, collapse it, expand the new one, update the variable with the new index, notify adapter about the changes.

nikolajakshic avatar Mar 19 '20 17:03 nikolajakshic