androidx.navigationevent


Provides APIs to easily intercept platform gesture events, including swipes and clicks, to help in app navigation.

Interfaces

NavigationEventDispatcherOwner

A class that has an NavigationEventDispatcher that allows you to register a NavigationEventCallback for handling navigation events.

Cmn
NavigationEventInfo

Provides contextual information about a navigation state (e.g., a screen or route).

Cmn

Classes

DirectNavigationEventInputHandler

An input handler that can send events to a NavigationEventDispatcher.

Cmn
NavigationEvent

Represents a system navigation event, such as a predictive back gesture or a back button press.

Cmn
NavigationEventCallback

Callback for handling NavigationEvents.

Cmn
NavigationEventDispatcher

A dispatcher for navigation events that can be organized hierarchically.

Cmn
NavigationEventInputHandler

An input handler that can send events to a NavigationEventDispatcher.

Cmn
NavigationEventPriority

Priority to be provided to the NavigationEventCallback when it is being initialized to determine when the callback should be triggered.

Cmn
NavigationEventState

Represents the state of a system navigation gesture, like a predictive back swipe.

Cmn
NavigationEventState.Idle

The UI is settled, and no navigation gesture is currently active.

Cmn
NavigationEventState.InProgress

A navigation gesture is actively in progress.

Cmn
OnBackInvokedInputHandler

Provides input from OnBackInvokedCallback to the given NavigationEventDispatcher.

android

Objects

NavigationEventInfo.NotProvided

A default used when no specific information is associated with a navigation event.

Cmn

Extension functions summary

Extension functions

findViewTreeNavigationEventDispatcherOwner

fun View.findViewTreeNavigationEventDispatcherOwner(): NavigationEventDispatcherOwner?

Retrieve the NavigationEventDispatcherOwner associated with the given View. This may be used to add a callback for navigation events.

Returns
NavigationEventDispatcherOwner?

The NavigationEventDispatcherOwner associated with this view and/or some subset of its ancestors

setViewTreeNavigationEventDispatcherOwner

fun View.setViewTreeNavigationEventDispatcherOwner(
    navigationEventDispatcherOwner: NavigationEventDispatcherOwner
): Unit

Set the NavigationEventDispatcherOwner associated with the given View. Calls to findViewTreeNavigationEventDispatcherOwner from this view or descendants will return NavigationEventDispatcherOwner.

This should only be called by constructs such as activities or dialogs that manage a view tree and handle the dispatch of navigation events. Callers should only set a NavigationEventDispatcherOwner that will be stable.

Parameters
navigationEventDispatcherOwner: NavigationEventDispatcherOwner

NavigationEventDispatcherOwner associated with the View