LocalOnBackPressedDispatcherOwner

object LocalOnBackPressedDispatcherOwner


Provides a OnBackPressedDispatcher that can be used by Composables hosted in a androidx.activity.ComponentActivity.

Summary

Public functions

infix ProvidedValue<OnBackPressedDispatcherOwner?>

Associates a LocalOnBackPressedDispatcherOwner key to a value in a call to CompositionLocalProvider.

Public properties

OnBackPressedDispatcherOwner?

Returns current composition local value for the owner or null if one has not been provided, one has not been set via androidx.activity.setViewTreeOnBackPressedDispatcherOwner, nor is one available by looking at the LocalContext.

Public functions

provides

Added in 1.3.0
infix fun provides(dispatcherOwner: OnBackPressedDispatcherOwner): ProvidedValue<OnBackPressedDispatcherOwner?>

Associates a LocalOnBackPressedDispatcherOwner key to a value in a call to CompositionLocalProvider.

Public properties

current

Added in 1.3.0
val currentOnBackPressedDispatcherOwner?

Returns current composition local value for the owner or null if one has not been provided, one has not been set via androidx.activity.setViewTreeOnBackPressedDispatcherOwner, nor is one available by looking at the LocalContext.