# androidx.navigationevent

*** ** * ** ***

Common/AllAndroid/JVMJavaScript

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

## Interfaces

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventDispatcherOwner` | A class that has an `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventDispatcher` that allows you to register a `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventHandler` for handling navigation events. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/navigationevent/OnBackCompletedFallback` | A listener that provides a final fallback action for unhandled `backCompleted` callbacks. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/navigationevent/OnForwardCompletedFallback` | A listener that provides a final fallback action for unhandled `forwardCompleted` callbacks. | Cmn |

## Classes

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/navigationevent/BrowserInput` | A `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventInput` that translates browser history navigation events (popstate) into `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventDispatcher` events. | JS |
| `https://developer.android.com/reference/kotlin/androidx/navigationevent/DirectNavigationEventInput` | An input that can send events to a `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventDispatcher`. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEvent` | Represents a system navigation event, such as a predictive back gesture or a back button press. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventDispatcher` | A dispatcher for navigation events that can be organized hierarchically. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventHandler` | Base class for handling navigation gestures dispatched by a `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventDispatcher`. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventHistory` | Represents an immutable snapshot of the navigation history stack. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventInfo` | Provides contextual information about a navigation state (e.g., a screen or route). | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventInput` | An abstract class for components that generate and dispatch navigation events. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventTransitionState` | Represents the physical state of a navigation gesture, such as a predictive back or forward swipe. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventTransitionState.InProgress` | Represents the state where a navigation gesture is actively in progress. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/navigationevent/OnBackInvokedDefaultInput` | Provides input to a `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventDispatcher` by registering an `https://developer.android.com/reference/android/window/OnBackInvokedCallback.html` with the `https://developer.android.com/reference/android/window/OnBackInvokedDispatcher.html#PRIORITY_DEFAULT` priority to `https://developer.android.com/reference/kotlin/androidx/navigationevent/OnBackInvokedDefaultInput#(android.window.OnBackInvokedDispatcher)`. | android |
| `https://developer.android.com/reference/kotlin/androidx/navigationevent/OnBackInvokedInput` | Provides input to a `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventDispatcher` by registering an `https://developer.android.com/reference/android/window/OnBackInvokedCallback.html` to the passed in `https://developer.android.com/reference/kotlin/androidx/navigationevent/OnBackInvokedInput#(android.window.OnBackInvokedDispatcher,kotlin.Int)`. | android |
| `https://developer.android.com/reference/kotlin/androidx/navigationevent/OnBackInvokedOverlayInput` | Provides input to a `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventDispatcher` by registering an `https://developer.android.com/reference/android/window/OnBackInvokedCallback.html` with the `https://developer.android.com/reference/android/window/OnBackInvokedDispatcher.html#PRIORITY_OVERLAY` priority to `https://developer.android.com/reference/kotlin/androidx/navigationevent/OnBackInvokedOverlayInput#(android.window.OnBackInvokedDispatcher)`. | android |

## Objects

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventInfo.None` | A default used when no specific information is associated with a navigation event. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventTransitionState.Idle` | Represents the state where no navigation gesture is currently in progress. | Cmn |

## Annotations

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/navigationevent/ExperimentalNavigationEventApi` | Marks declarations that are still **experimental** in the NavigationEvent API, which means that the design of the corresponding declarations has open issues which may (or may not) lead to changes in the future. | Cmn |

## Top-level functions summary

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventDispatcherOwner` | `https://developer.android.com/reference/kotlin/androidx/navigationevent/package-summary#NavigationEventDispatcherOwner(androidx.navigationevent.NavigationEventDispatcher)( navigationEventDispatcher: https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventDispatcher )` Creates a `https://developer.android.com/reference/kotlin/androidx/navigationevent/package-summary#NavigationEventDispatcherOwner(androidx.navigationevent.NavigationEventDispatcher)` directly backed by the provided `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventDispatcher`. | Cmn |

## Extension functions summary

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventDispatcherOwner?` | `https://developer.android.com/reference/android/view/View.html.https://developer.android.com/reference/kotlin/androidx/navigationevent/package-summary#(android.view.View).findViewTreeNavigationEventDispatcherOwner()()` Retrieve the `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventDispatcherOwner` associated with the given `https://developer.android.com/reference/android/view/View.html`. | android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/android/view/View.html.https://developer.android.com/reference/kotlin/androidx/navigationevent/package-summary#(android.view.View).setViewTreeNavigationEventDispatcherOwner(androidx.navigationevent.NavigationEventDispatcherOwner)( navigationEventDispatcherOwner: https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventDispatcherOwner? )` Set the `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventDispatcherOwner` associated with the given `https://developer.android.com/reference/android/view/View.html`. | android |
| `https://developer.android.com/reference/android/window/BackEvent.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresApi(value = 34) https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEvent.https://developer.android.com/reference/kotlin/androidx/navigationevent/package-summary#(androidx.navigationevent.NavigationEvent).toBackEvent()()` | android |
| `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEvent` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresApi(value = 34) https://developer.android.com/reference/android/window/BackEvent.html.https://developer.android.com/reference/kotlin/androidx/navigationevent/package-summary#(android.window.BackEvent).toNavigationEvent()()` | android |

## Top-level functions

### NavigationEventDispatcherOwner

Cmn Artifact: [androidx.navigationevent:navigationevent](https://developer.android.com/jetpack/androidx/releases/navigationevent) [View Source](https://cs.android.com/search?q=file:androidx/navigationevent/NavigationEventDispatcherOwnerFactory.kt+function:NavigationEventDispatcherOwner) Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/navigationevent#1.2.0)

```
fun NavigationEventDispatcherOwner(
    navigationEventDispatcher: NavigationEventDispatcher
): NavigationEventDispatcherOwner
```

Creates a `https://developer.android.com/reference/kotlin/androidx/navigationevent/package-summary#NavigationEventDispatcherOwner(androidx.navigationevent.NavigationEventDispatcher)` directly backed by the provided `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventDispatcher`.

## Extension functions

### View.findViewTreeNavigationEventDispatcherOwner

android Artifact: [androidx.navigationevent:navigationevent](https://developer.android.com/jetpack/androidx/releases/navigationevent) [View Source](https://cs.android.com/search?q=file:androidx/navigationevent/ViewTreeNavigationEventDispatcherOwner.android.kt+function:findViewTreeNavigationEventDispatcherOwner) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/navigationevent#1.0.0)

```
fun View.findViewTreeNavigationEventDispatcherOwner(): NavigationEventDispatcherOwner?
```

Retrieve the `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventDispatcherOwner` associated with the given `https://developer.android.com/reference/android/view/View.html`. This may be used to add a callback for navigation events.

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventDispatcherOwner?` | The `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventDispatcherOwner` associated with this view and/or some subset of its ancestors |

### View.setViewTreeNavigationEventDispatcherOwner

android Artifact: [androidx.navigationevent:navigationevent](https://developer.android.com/jetpack/androidx/releases/navigationevent) [View Source](https://cs.android.com/search?q=file:androidx/navigationevent/ViewTreeNavigationEventDispatcherOwner.android.kt+function:setViewTreeNavigationEventDispatcherOwner) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/navigationevent#1.0.0)

```
fun View.setViewTreeNavigationEventDispatcherOwner(
    navigationEventDispatcherOwner: NavigationEventDispatcherOwner?
): Unit
```

Set the `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventDispatcherOwner` associated with the given `https://developer.android.com/reference/android/view/View.html`. Calls to `https://developer.android.com/reference/kotlin/androidx/navigationevent/package-summary#(android.view.View).findViewTreeNavigationEventDispatcherOwner()` from this view or descendants will return `https://developer.android.com/reference/kotlin/androidx/navigationevent/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 `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventDispatcherOwner` that will be *stable.*

| Parameters |
|---|---|
| `navigationEventDispatcherOwner: https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventDispatcherOwner?` | `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventDispatcherOwner` associated with the `https://developer.android.com/reference/android/view/View.html` |

### NavigationEvent.toBackEvent

android Artifact: [androidx.navigationevent:navigationevent](https://developer.android.com/jetpack/androidx/releases/navigationevent) [View Source](https://cs.android.com/search?q=file:androidx/navigationevent/NavigationEvent.android.kt+function:toBackEvent) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/navigationevent#1.1.0)

```
@RequiresApi(value = 34)
fun NavigationEvent.toBackEvent(): BackEvent
```

### BackEvent.toNavigationEvent

android Artifact: [androidx.navigationevent:navigationevent](https://developer.android.com/jetpack/androidx/releases/navigationevent) [View Source](https://cs.android.com/search?q=file:androidx/navigationevent/NavigationEvent.android.kt+function:toNavigationEvent) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/navigationevent#1.1.0)

```
@RequiresApi(value = 34)
fun BackEvent.toNavigationEvent(): NavigationEvent
```