I'm trying to build an app with a RecycleView
. Every element in the RecycleView
has a complex layout with buttons that are changing colors and animations and stuff. After the user "done" with the current item and start scrolling, this item will be recycled and the layout changes I made will be lost.
When the user scrolls to that item again I'll have to change the layout again to way it was.
Is there an easy way to save an item's layout state (positions and sizes of the buttons, colors of views...) and then restore them when the view is recycled again?
Also is there a way to restore a layout to its original state? I would like to use it when I get a recycled view that has layout changes that I want to restore?