Open chiennt56 opened 9 years ago
Simplest solution: store status into model. Then restore state while drawing. If you won't tie model with your view then store status in some "storage". For example in Map<ModelId, ViewState>. But it cause memory allocation while drawing and it is not very good for performance.
@IlyaEremin Thank you, llyaEremin. I tried that way. But it wasn't work, because i couldn't catch a event fired from swipelayout to set boolean attribute into model when i swipe a item of RecyclerView. I tried to use addSwipeListener method but it didn't work normally as i want.
I'm trying to do the same, have you managed to find a solution @chiennt56?
@chiennt56 Have you find out the solution? I am also facing the same issue.
@chiennt56 I bet chiennt56 is saying using a wrapper to wrap your current model and the state, and each time bindViewHolder is getting called, just check the boolean
I want to hold status of swipelayout (open/close) when scrolling the list in recyclerView. So, how can i do it?