NavigationBackHandler

Functions summary

Unit
@Composable
<T : Any> NavigationBackHandler(
    sceneState: SceneState<T>,
    state: NavigationEventState<SceneInfo<T>>,
    onBackCancelled: () -> Unit,
    onBackCompleted: () -> Unit
)

A composable that handles back navigation gestures for a SceneState, driven by a NavigationEventState.

Cmn

Functions

@Composable
fun <T : Any> NavigationBackHandler(
    sceneState: SceneState<T>,
    state: NavigationEventState<SceneInfo<T>> = rememberNavigationEventState(sceneState),
    onBackCancelled: () -> Unit = {},
    onBackCompleted: () -> Unit
): Unit

A composable that handles back navigation gestures for a SceneState, driven by a NavigationEventState.

This is a convenience wrapper around the core androidx.navigationevent.compose.NavigationBackHandler that automatically handles the NavigationEventState based on the provided sceneState.

Parameters
sceneState: SceneState<T>

the SceneState that this handler is associated with.

state: NavigationEventState<SceneInfo<T>> = rememberNavigationEventState(sceneState)

the hoisted NavigationEventState (returned from rememberNavigationEventState) to be registered.

onBackCancelled: () -> Unit = {}

called if a back navigation gesture is cancelled.

onBackCompleted: () -> Unit

called when a back navigation gesture completes and navigation occurs.