A NavigationEventInput that translates browser history navigation events (popstate) into NavigationEventDispatcher events.

This implementation uses the browser's History API to synchronize the application's internal navigation state with the browser's history stack.

Summary

Public constructors

BrowserInput(window: Window, coroutineDispatcher: CoroutineDispatcher)

Creates a BrowserInput for the given window.

JS

Protected functions

open Unit

Called after this NavigationEventInput is added to dispatcher.

JS
open Unit

Called when the NavigationEventHistory state in the connected NavigationEventDispatcher changes.

JS
open Unit

Called after this NavigationEventInput is removed from a NavigationEventDispatcher.

JS

Inherited functions

From androidx.navigationevent.NavigationEventInput
Unit

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

JS
Unit

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

JS
Unit

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

JS
Unit

Notifies the dispatcher that a TRANSITIONING_BACK navigation gesture has started.

JS
Unit

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

JS
Unit

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

JS
Unit

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

JS
Unit

Notifies the dispatcher that a TRANSITIONING_FORWARD navigation gesture has started.

JS
open Unit

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

JS

Inherited properties

From androidx.navigationevent.NavigationEventInput
Boolean

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

JS

Public constructors

BrowserInput

BrowserInput(
    window: Window,
    coroutineDispatcher: CoroutineDispatcher = Dispatchers.Main
)

Creates a BrowserInput for the given window.

Protected functions

onAdded

protected open fun onAdded(dispatcher: NavigationEventDispatcher): Unit

Called after this NavigationEventInput is added to dispatcher. This can happen when calling NavigationEventDispatcher.addInput. A NavigationEventInput can only be added to one NavigationEventDispatcher at a time.

Parameters
dispatcher: NavigationEventDispatcher

The NavigationEventDispatcher that this input is now added to.

onHistoryChanged

protected open fun onHistoryChanged(history: NavigationEventHistory): Unit

Called when the NavigationEventHistory state in the connected NavigationEventDispatcher changes.

Parameters
history: NavigationEventHistory

The new, immutable snapshot of the navigation history.

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.