I use this library StackExpandable to add an Expand/Collapse cardViews as a recyclerview item. Expand/Collapse works fine. But the issue I am facing is that when I expand two items and while scrolling, any item goes out of the screen and comes back, stacked card appears as a normal card. I have tried tracking the expand/collapse states. But, this issue is still there. Here's the video of the issue I am facing: https://drive.google.com/file/d/1MEbMvQXRn9jDNTpbDgzQFtBF78LyczrL/view?usp=sharing Please let me know figure out whats happening to the Recyclerview item when it goes out of the screen and how can it be prevented?
This is the RecyclerView item_layout:
<it.fabiosassu.stackexpandableview.StackExpandableView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/verticalStackedCardView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:shownElements="3"/>