NavigationEventState


public sealed class NavigationEventState<T extends NavigationEventInfo>

Known direct subclasses
NavigationEventState.Idle

The UI is settled, and no navigation gesture is currently active.

NavigationEventState.InProgress

A navigation gesture is actively in progress.


Represents the state of a system navigation gesture, like a predictive back swipe. It's either Idle (no gesture in progress) or InProgress (a gesture is active).

Parameters
<T extends NavigationEventInfo>

The type of optional information associated with the navigation event. This is typically provided by the UI layer to give context about the navigation state.

Summary

Nested types

The UI is settled, and no navigation gesture is currently active.

A navigation gesture is actively in progress.

Protected constructors

Public methods

abstract @NonNull T

Information about the current NavigationEventState.

final float

The progress of the current navigation gesture, typically from 0.0f to 1.0f.

Protected constructors

protected <T extends NavigationEventInfo> NavigationEventState()
Parameters
<T extends NavigationEventInfo>

The type of optional information associated with the navigation event. This is typically provided by the UI layer to give context about the navigation state.

Public methods

getCurrentInfo

Added in 1.0.0-alpha06
public abstract @NonNullgetCurrentInfo()

Information about the current NavigationEventState.

In the Idle state, this represents the settled UI state. In the InProgress state, this represents the UI state the gesture is navigating towards.

getProgress

Added in 1.0.0-alpha06
public final float getProgress()

The progress of the current navigation gesture, typically from 0.0f to 1.0f.

Returns 0f when the state is Idle. When the state is InProgress, it reflects the completion progress of the ongoing gesture from its latestEvent.