OnBackInvokedInput


@RequiresApi(value = 33)
public sealed class OnBackInvokedInput extends NavigationEventInput


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

Summary

Protected constructors

OnBackInvokedInput(
    @NonNull OnBackInvokedDispatcher onBackInvokedDispatcher,
    int onBackInvokedCallbackPriority
)

Protected methods

void
onHasEnabledBackHandlersChanged(boolean hasEnabledBackHandlers)

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

void

Called after this NavigationEventInput is removed from a NavigationEventDispatcher.

Inherited methods

From androidx.navigationevent.NavigationEventInput
final void

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

final void

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

final void

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

final void

Notifies the dispatcher that a TRANSITIONING_BACK navigation gesture has started.

final void

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

final void

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

final void

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

final void

Notifies the dispatcher that a TRANSITIONING_FORWARD navigation gesture has started.

final boolean

Tracks whether the connected NavigationEventDispatcher has any enabled NavigationEventHandler for back navigation matching this input's priority scope.

final boolean

Tracks whether the connected NavigationEventDispatcher has any enabled NavigationEventHandler for forward navigation matching this input's priority scope.

final boolean

Tracks whether the connected NavigationEventDispatcher has any enabled NavigationEventHandler matching this input's priority scope.

void

Called after this NavigationEventInput is added to dispatcher.

void
@MainThread
@EmptySuper
onHasEnabledForwardHandlersChanged(boolean hasEnabledForwardHandlers)

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

void

Called when the enabled state of handlers (either back or forward) in the connected NavigationEventDispatcher changes.

void

Called when the NavigationEventHistory state in the connected NavigationEventDispatcher changes.

Protected constructors

OnBackInvokedInput

protected OnBackInvokedInput(
    @NonNull OnBackInvokedDispatcher onBackInvokedDispatcher,
    int onBackInvokedCallbackPriority
)
Parameters
@NonNull OnBackInvokedDispatcher onBackInvokedDispatcher

the OnBackInvokedDispatcher to use.

int onBackInvokedCallbackPriority

the priority to use.

Protected methods

onHasEnabledBackHandlersChanged

protected void onHasEnabledBackHandlersChanged(boolean hasEnabledBackHandlers)

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

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

Parameters
boolean hasEnabledBackHandlers

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

onRemoved

protected void onRemoved()

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