RecyclerView is not processed if inside nestedScrollView

My goal is to have a NestedScrollView with multiple child CardViews containing RecyclerViews.

My current xml looks something like this:

<CardView> <RecyclerView/> </CardView> <CardView> <RecyclerView/> </CardView> </NestedScrollView> 

Everything seems to work as expected if I set nestedScrollViewEnabled to false in RecyclerViews. However, rows in recyclerviews are not recycled. A call to layoutManager.findFirstVisibleItemPosition() always returns 0, and layoutManager.findLastVisibleItemPosition() always returns the last position in the list.

Any suggestions?

+5
source share

All Articles