Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

BottomSheetDialogFragment - Allow scrolling child

Tags:

I have a BottomSheetDialogFragment with a RecyclerView. The problem is, I want to disable the drag close function of the BottomSheetDialogFragment as long as the RecyclerView is not scrolled up (currently I can't scroll my RecyclerView as the attempt will always close the BottomSheetDialogFragment). Any ideas how to achieve this?

like image 476
prom85 Avatar asked Dec 01 '16 07:12

prom85


1 Answers

RecyclerView scrolling problem in BottomSheetDialog can be solved by this way.

from: https://android.jlelse.eu/recyclerview-within-nestedscrollview-scrolling-issue-3180b5ad2542

<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:orientation="vertical">  <android.support.v4.widget.NestedScrollView         android:id="@+id/nestedScrollView"         android:layout_width="match_parent"         android:layout_height="match_parent"         android:overScrollMode="never">           <LinearLayout             android:layout_width="match_parent"             android:layout_height="wrap_content"             android:orientation="vertical">              <android.support.v7.widget.RecyclerView                 android:id="@+id/recyclerView"                 android:layout_width="match_parent"                 android:layout_height="wrap_content" />          </LinearLayout>     </android.support.v4.widget.NestedScrollView> </LinearLayout> 
like image 168
Brownsoo Han Avatar answered Sep 22 '22 09:09

Brownsoo Han