Nestedscrollview _best_ ✦ Full
recyclerView.isNestedScrollingEnabled = true If you set it to false , RecyclerView will handle its own scrolling independently, breaking the coordinated behavior. Here lies the most frequent mistake developers make: Putting a RecyclerView inside a NestedScrollView and setting its height to wrap_content .
Enter NestedScrollView . It is the sophisticated, collaborative sibling of the classic ScrollView , designed specifically to solve nested scrolling problems. NestedScrollView is a FrameLayout that extends ScrollView but implements NestedScrollingParent and NestedScrollingChild interfaces. In plain English: It can both receive scroll events from its children and coordinate scroll events with its parent. nestedscrollview
<androidx.coordinatorlayout.widget.CoordinatorLayout> <com.google.android.material.appbar.AppBarLayout> <com.google.android.material.appbar.CollapsingToolbarLayout app:layout_scrollFlags="scroll|exitUntilCollapsed"> <ImageView ... /> <androidx.appcompat.widget.Toolbar ... /> </com.google.android.material.appbar.CollapsingToolbarLayout> </com.google.android.material.appbar.AppBarLayout> recyclerView