NavigationEventCallback


public abstract class NavigationEventCallback


Call for handling NavigationEventDispatcher callbacks.

This class maintains its own isEnabled state and will only receive callbacks when enabled.

Summary

Public constructors

NavigationEventCallback(
    boolean isEnabled,
    @NonNull NavigationEventPriority priority
)

Public methods

final @NonNull NavigationEventPriority

The priority of this callback.

final boolean
final boolean

Whether this callback should consume the callback from the NavigationEventDispatcher or allow it to continue.

void

Callback for handling the NavigationEventDispatcher.dispatchOnCancelled callback.

void

Callback for handling the NavigationEventDispatcher.dispatchOnCompleted callback.

void

Callback for handling the NavigationEventDispatcher.dispatchOnProgressed callback.

void

Callback for handling the NavigationEventDispatcher.dispatchOnStarted callback.

final void

Cleans up all tracked AutoCloseable resources associated with this NavigationEventCallback.

final void
setEnabled(boolean isEnabled)
final void
setPassThrough(boolean isPassThrough)

Whether this callback should consume the callback from the NavigationEventDispatcher or allow it to continue.

Public constructors

public NavigationEventCallback(
    boolean isEnabled,
    @NonNull NavigationEventPriority priority
)
Parameters
boolean isEnabled

The default enabled state for this callback.

@NonNull NavigationEventPriority priority

The priority this callback should be registered with.

Public methods

getPriority

Added in 1.0.0-alpha01
public final @NonNull NavigationEventPriority getPriority()

The priority of this callback.

isEnabled

Added in 1.0.0-alpha01
public final boolean isEnabled()

isPassThrough

Added in 1.0.0-alpha01
public final boolean isPassThrough()

Whether this callback should consume the callback from the NavigationEventDispatcher or allow it to continue.

onEventCancelled

Added in 1.0.0-alpha01
public void onEventCancelled()

Callback for handling the NavigationEventDispatcher.dispatchOnCancelled callback.

onEventCompleted

Added in 1.0.0-alpha01
public void onEventCompleted()

Callback for handling the NavigationEventDispatcher.dispatchOnCompleted callback.

onEventProgressed

Added in 1.0.0-alpha01
public void onEventProgressed(@NonNull NavigationEvent event)

Callback for handling the NavigationEventDispatcher.dispatchOnProgressed callback.

onEventStarted

Added in 1.0.0-alpha01
public void onEventStarted(@NonNull NavigationEvent event)

Callback for handling the NavigationEventDispatcher.dispatchOnStarted callback.

remove

Added in 1.0.0-alpha01
public final void remove()

Cleans up all tracked AutoCloseable resources associated with this NavigationEventCallback.

This method calls AutoCloseable.close on each tracked resource, ensuring that no lingering event registrations or resources remain active.

setEnabled

Added in 1.0.0-alpha01
public final void setEnabled(boolean isEnabled)

setPassThrough

Added in 1.0.0-alpha01
public final void setPassThrough(boolean isPassThrough)

Whether this callback should consume the callback from the NavigationEventDispatcher or allow it to continue.