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

Classes

NavigationEvent

Common event used to wrap signals from the platform so that they can be handled properly by the NavigationEventDispatcher

Cmn
NavigationEventCallback

Call for handling NavigationEventDispatcher callbacks.

Cmn
NavigationEventDispatcher

Dispatcher that can be used to register NavigationEventCallback instances for handling the in-app callbacks via composition.

Cmn
NavigationEventPriority

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

Cmn
NavigationInputHandler

Provides input to the given NavigationEventDispatcher.

android

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