material-components / material-components-android

Modular and customizable Material Design UI components for Android
Apache License 2.0
16.38k stars 3.07k forks source link

[BottomSheetBehavior] Allow adjusting significant velocity threshold #2317

Closed tamerc closed 2 years ago

tamerc commented 3 years ago

Is your feature request related to a problem? Please describe. We have a use case where we’d like to be able to increase the speed required in order to fling the bottom sheet all the way from a fully expanded state to a hidden state (vs settling on a half expanded state).

Describe the solution you'd like Could the BottomSheetBehavior expose the threshold here: https://github.com/material-components/material-components-android/blob/master/lib/java/com/google/android/material/bottomsheet/BottomSheetBehavior.java#L189, perhaps as a property on the BottomSheetBehavior, and any other hardcoded constants that allow more flexibility?

That way we can customize as needed to meet our requirements. Thanks!

Describe alternatives you've considered Forking our own version of BottomSheetBehavior

drchen commented 2 years ago

Fixed by https://github.com/material-components/material-components-android/commit/be1b38c30b4383a332e8b0ff297d636789287d99