I have BottomSheetDialogFragment with xml like:
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<FrameLayout
android:id="@+id/main_container"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:all_constraints/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
</FrameLayout>
Then inflates RecyclerView inside main_container in the onViewCreated:
<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipChildren="false"
android:clipToPadding="false"
android:orientation="vertical"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"/>
Most cases work normal, but sometimes I can't scroll down RecyclerView, scrolling leads to closing BottomSheet. Tryed:
- nestedScrollingEnabled = false - for RecyclerView (not scroll at all)
- requestDisallowInterceptTouchEvent(true) - into custom RecylerView.onTouchEvent (no effect)