public final class NavigationEvent


Common event used to wrap signals from the platform so that they can be handled properly by the NavigationEventDispatcher

Summary

Constants

static final int

Indicates that the edge swipe starts from the left edge of the screen

static final int

Indicates that the back event was not triggered by an edge swipe back gesture.

static final int

Indicates that the edge swipe starts from the right edge of the screen

Public constructors

NavigationEvent(
    float touchX,
    float touchY,
    float progress,
    int swipeEdge,
    long frameTimeMillis
)

Public methods

boolean
equals(Object other)
final long

Frame time of the navigation event.

final float

Value between 0 and 1 on how far along the back gesture is.

final int

Indicates which edge the swipe starts from.

final float

Absolute X location of the touch point of this event in the coordinate space of the screen that received this navigation event.

final float

Absolute Y location of the touch point of this event in the coordinate space of the screen that received this navigation event.

int
@NonNull String

Constants

EDGE_LEFT

public static final int EDGE_LEFT = 0

Indicates that the edge swipe starts from the left edge of the screen

EDGE_NONE

public static final int EDGE_NONE = 2

Indicates that the back event was not triggered by an edge swipe back gesture. This applies to cases like using the back button in 3-button navigation or pressing a hardware back button.

EDGE_RIGHT

public static final int EDGE_RIGHT = 1

Indicates that the edge swipe starts from the right edge of the screen

Public constructors

Added in 1.0.0-alpha01
public NavigationEvent(
    float touchX,
    float touchY,
    float progress,
    int swipeEdge,
    long frameTimeMillis
)

Public methods

equals

public boolean equals(Object other)

getFrameTimeMillis

Added in 1.0.0-alpha01
public final long getFrameTimeMillis()

Frame time of the navigation event.

getProgress

Added in 1.0.0-alpha01
public final float getProgress()

Value between 0 and 1 on how far along the back gesture is.

getSwipeEdge

Added in 1.0.0-alpha01
public final int getSwipeEdge()

Indicates which edge the swipe starts from.

getTouchX

Added in 1.0.0-alpha01
public final float getTouchX()

Absolute X location of the touch point of this event in the coordinate space of the screen that received this navigation event.

getTouchY

Added in 1.0.0-alpha01
public final float getTouchY()

Absolute Y location of the touch point of this event in the coordinate space of the screen that received this navigation event.

hashCode

public int hashCode()

toString

public @NonNull String toString()