Disable BottomSheet Drag

Fahim picture Fahim · May 13, 2016 · Viewed 10.2k times · Source

Due to my low reputation point, I can't comment. So i'm extending this question: Disabling User dragging on BottomSheet

The solution provided by Ray W works but now it expands by sliding and dragging on parent view (CoordinatorLayout).

Image

In that image, if I drag on "Unwanted Drag Area", BottomSheet slides up. How can I filtered out or stop the touch events on unwanted view?

Answer

Jay makwana picture Jay makwana · Nov 2, 2020

For the Kotlin, simply add below line in your code,

behaviour.isDraggable = false