I have 3 vertical recycler view in a screen inside a NestedScrollView
like:
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
I need to set recycler-view
's height wrap_content
because the contents are dynamic. When I'm calling submitList(...)
, the 60-80 frames skipped. Child views are cheap and simple and the total items for showing in all of them are about 30.
When I hardcoded the recycler-view
's height for example 100dp there's no skipped frame in the result!
How can I fix this issue or improve this function?
P.S: I can't merge them together by an adapter with multiple view-type.