Android BottomSheet Disable Manual Scroll

Viewed 9150

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.

1 Answers
Related