https://kotlinlang.org logo
#android
Title
# android
j

Joao Birk

03/17/2020, 8:26 PM
Hi there, I have a RecyclerView (vertical) with a inner RecyclerView (also vertical). Reason I have that is because the inner RecyclerView has to be wrapped by a CardView and can be collapsed/expanded. Problem is that the inner adapter is not recycling the views and is binding all of them at once, not just the visible ones. Whats the suggestion to solve this problem or another approach to impl this? I thought about creating one single RecyclerView with an item decorator where the first have the card borders (left/top/right), the last have (left/bottom/right) and the others have just the left/right.
v

voben

03/17/2020, 8:35 PM
Nested recycler views in the same direction is not a good idea. Recyclerview needs to know its bounds to be able to scroll, but if it is within a scrollable container, then it has to lay out all its items immediately.
j

Joao Birk

03/17/2020, 8:40 PM
yep, i realized that after debugging my sol
Thank you for the response!
5 Views