dismisses

fun <S> MaterialDatePicker<S>.dismisses(): Flow<Unit>

Create a Flow of dismiss events on the MaterialDatePicker instance. This emits whenever the underlying DialogFragment is dismissed, no matter how it is dismissed.

Note: Created flow keeps a strong reference to the MaterialDatePicker instance until the coroutine that launched the flow collector is cancelled.

Example of usage:

datePicker.dismisses()
.onEach {
// handle date picker dismissed
}
.launchIn(uiScope)

fun MaterialTimePicker.dismisses(): Flow<Unit>

Create a Flow of dismiss events on the MaterialTimePicker instance. This emits whenever the underlying DialogFragment is dismissed, no matter how it is dismissed.

Note: Created flow keeps a strong reference to the MaterialTimePicker instance until the coroutine that launched the flow collector is cancelled.

Example of usage:

timePicker.dismisses()
.onEach {
// handle time picker dismissed
}
.launchIn(uiScope)

Create a Flow of dismissed events on the View instance with a SwipeDismissBehavior where the value emitted is the view dismissed. The View's layoutParams must be of the type CoordinatorLayout.LayoutParams, and the layoutParams's behavior must be a SwipeDismissBehavior.

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.dismisses()
.onEach { dismissedView ->
// handle dismissedView
}
.launchIn(uiScope)