4

So I am using the new support library behaviour for nested children scroll inside CoordinatorLayout and I have a view like this:

 <com.....TodayBottomSheet
        android:id="@+id/bottomSheet"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_behavior="@string/bottom_sheet_behavior"
        app:behavior_hideable="false"/>

I have a requirement in my app, which isn't new and I need to temporarily disable scrolling of certain elements of a coordinator layout. For this bottomSheet, I need to disable the 'manual' scroll which will get triggered when touching and dragging the bottom of the screen. My requirement is to open/close the bottom sheet by pressing a button. I know how to do it programmatically, I just know how to disable the manual scroll.

And another problem which is related to this one, I need to temporarily disable recyclerView scroll listener when a certain action happens. I don't know how to do it since all the scrolling child of a coordinator layout are controlled by himself.

Keale
  • 3,924
  • 3
  • 29
  • 46
johnny_crq
  • 4,291
  • 5
  • 39
  • 64

1 Answers1

1

Check this solution.
Basically, onBottomSheetBehavior.STATE_DRAGGING set BottomSheetBehavior.STATE_EXPANDED.

Community
  • 1
  • 1
  • 5
    This is really not a great solution - you can still drag, it just looks like it's trying to set it expanded but failing. – Ed Lee Jan 19 '17 at 22:21
  • 1
    I m getting no way of how to stop dragging of `modal bottom sheet`.Tried all solutions from SO it seems. User is able to drag it to the top and I dont want that . – eRaisedToX Apr 11 '17 at 04:39