I am using a layout in which I used multiple RecyclerViews (Horizontal) as a item view of RecyclerView. The problem is that the vertical scrolling is not as smooth as I am expecting.There are some jerks in while scrolling vertically(Parent RecyclerView).
How to remove these vertical scrolling jerks ? I used to set adapters to horizontal RecyclerViews in OnBindViewHolder() method of Parent RecyclerView.
I have solved the problem.Scrolling performance is much better in this case. Do not set adapters to horizontal RecyclerViews in OnBindViewHolder() method of Parent RecyclerView. Instead of it set it at very first time when the view is created via onCreateViewHolder() of RecyclerView with empty or null dataList. Just replace the newsecondary data list with previous null list at onBindViewHolder() and call notifydataSetChanged() to HorizontalAdapetr. This is much better than setAdapter() in onBindViewHolder().
Try to notifydatasetChanged() in onbindViewHolder() not setAdapter(). SetAdapter() is more time consuming than notifying datset change.
You can try this way
main activity
Vertical recycled view adapter
Horizontal recycleview adapter
main_layout.xml
vertical_layout.xml
holizontal_layout.xml