TestNavigationEventKt

Added in 1.0.0-alpha05

public final class TestNavigationEventKt


Summary

Public methods

static final @NonNull NavigationEvent
TestNavigationEvent(
    @FloatRange(from = 0.0) float touchX,
    @FloatRange(from = 0.0) float touchY,
    @FloatRange(from = 0.0, to = 1.0) float progress,
    int swipeEdge,
    long frameTimeMillis
)

Creates a NavigationEvent for testing purposes.

Public methods

public static final @NonNull NavigationEvent TestNavigationEvent(
    @FloatRange(from = 0.0) float touchX,
    @FloatRange(from = 0.0) float touchY,
    @FloatRange(from = 0.0, to = 1.0) float progress,
    int swipeEdge,
    long frameTimeMillis
)

Creates a NavigationEvent for testing purposes.

This function provides a convenient way to construct a NavigationEvent with default values, useful for unit tests where you need to simulate a navigation gesture.

Parameters
@FloatRange(from = 0.0) float touchX

The absolute X coordinate of the touch event, defaulting to 0.0F.

@FloatRange(from = 0.0) float touchY

The absolute Y coordinate of the touch event, defaulting to 0.0F.

@FloatRange(from = 0.0, to = 1.0) float progress

The progress of the navigation gesture, defaulting to 0.0F. This ranges from 0.0F to 1.0F, representing the completion of the gesture.

int swipeEdge

The edge from which the swipe originated, defaulting to EDGE_NONE.

long frameTimeMillis

The timestamp of the event in milliseconds, defaulting to 0.

Returns
@NonNull NavigationEvent

A new NavigationEvent instance configured with the provided parameters.