bottomSheetStateChanges
Create a Flow of bottom sheet state change events on the View instance with a BottomSheetBehavior where the value emitted can be one of STATE_DRAGGING, STATE_SETTLING}, STATE_EXPANDED, STATE_COLLAPSED, STATE_HIDDEN or STATE_HALF_EXPANDED.
Note: Created flow keeps a strong reference to the View instance until the coroutine that launched the flow collector is cancelled.
Example of usage:
view.bottomSheetStateChanges()
.onEach { state ->
// handle state
}
.launchIn(uiScope)
Content copied to clipboard