Reputation: 174
I am trying to create the ui depicted in the design below. Basically it will be an horizontal RecyclerView and below that a vertical one. What I want is that when i scroll vertically, the horizontal one should move too instead of only scrolling the vertical one.
Now I thought of putting the horizontal one in the first cell of the vertical with a different viewholder, but isn't that a bit expensive performance-wise (as i would have to reinitialize and populate the horizontal one after the cell gets recycled and bind() is called)?
So I am asking is there any better approach? Or should I go on with this one? For the record: minimum API: 17
Upvotes: 0
Views: 105
Reputation: 420
You can put the 2 RecyclerView
inside a NestedScrollView
here official documentation.
Hope it helps.
Upvotes: 1