Provides input to a NavigationEventDispatcher by registering an OnBackInvokedCallback to the passed in onBackInvokedDispatcher.

Summary

Protected constructors

OnBackInvokedInput(
    onBackInvokedDispatcher: OnBackInvokedDispatcher,
    onBackInvokedCallbackPriority: Int
)
android

Protected functions

open Unit
onHasEnabledHandlersChanged(hasEnabledHandlers: Boolean)

Called when the enabled state of handlers in the connected NavigationEventDispatcher changes.

android
open Unit

Called after this NavigationEventInput is removed from a NavigationEventDispatcher.

android

Inherited functions

From androidx.navigationevent.NavigationEventInput
Unit

Notifies the dispatcher that the ongoing TRANSITIONING_BACK navigation gesture has been cancelled.

android
Unit

Notifies the dispatcher that the ongoing TRANSITIONING_BACK navigation gesture has completed.

android
Unit

Notifies the dispatcher that an ongoing TRANSITIONING_BACK navigation gesture has progressed.

android
Unit

Notifies the dispatcher that a TRANSITIONING_BACK navigation gesture has started.

android
Unit

Notifies the dispatcher that the ongoing TRANSITIONING_FORWARD navigation gesture has been cancelled.

android
Unit

Notifies the dispatcher that the ongoing TRANSITIONING_FORWARD navigation gesture has completed.

android
Unit

Notifies the dispatcher that an ongoing TRANSITIONING_FORWARD navigation gesture has progressed.

android
Unit

Notifies the dispatcher that a TRANSITIONING_FORWARD navigation gesture has started.

android
open Unit

Called after this NavigationEventInput is added to dispatcher.

android
open Unit

Called when the NavigationEventHistory state in the connected NavigationEventDispatcher changes.

android

Protected constructors

OnBackInvokedInput

protected OnBackInvokedInput(
    onBackInvokedDispatcher: OnBackInvokedDispatcher,
    onBackInvokedCallbackPriority: Int
)
Parameters
onBackInvokedDispatcher: OnBackInvokedDispatcher

the OnBackInvokedDispatcher to use.

onBackInvokedCallbackPriority: Int

the priority to use.

Protected functions

onHasEnabledHandlersChanged

protected open fun onHasEnabledHandlersChanged(hasEnabledHandlers: Boolean): Unit

Called when the enabled state of handlers in the connected NavigationEventDispatcher changes.

This allows the input to enable or disable its own event sourcing. For example, a system back gesture input might only register for gestures when hasEnabledHandlers is true.

The exact set of handlers this reflects depends on the Priority this input was registered with.

Parameters
hasEnabledHandlers: Boolean

Whether the connected dispatcher has any enabled handlers matching this input's priority scope.

onRemoved

protected open fun onRemoved(): Unit

Called after this NavigationEventInput is removed from a NavigationEventDispatcher. This can happen when calling NavigationEventDispatcher.removeInput or NavigationEventDispatcher.dispose on the containing NavigationEventDispatcher.