androidx.navigationevent.testing


Classes

TestNavigationEventCallback

A test implementation of NavigationEventCallback that records received events and invocation counts.

Cmn
TestNavigationEventDispatcherOwner

A test implementation of NavigationEventDispatcherOwner for verifying NavigationEventDispatcher interactions.

Cmn

Top-level functions summary

NavigationEvent
TestNavigationEvent(
    touchX: @FloatRange(from = 0.0) Float,
    touchY: @FloatRange(from = 0.0) Float,
    progress: @FloatRange(from = 0.0, to = 1.0) Float,
    swipeEdge: Int,
    frameTimeMillis: Long
)

Creates a NavigationEvent for testing purposes.

Cmn

Top-level functions

fun TestNavigationEvent(
    touchX: @FloatRange(from = 0.0) Float = 0.0f,
    touchY: @FloatRange(from = 0.0) Float = 0.0f,
    progress: @FloatRange(from = 0.0, to = 1.0) Float = 0.0f,
    swipeEdge: Int = EDGE_NONE,
    frameTimeMillis: Long = 0
): NavigationEvent

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
touchX: @FloatRange(from = 0.0) Float = 0.0f

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

touchY: @FloatRange(from = 0.0) Float = 0.0f

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

progress: @FloatRange(from = 0.0, to = 1.0) Float = 0.0f

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

swipeEdge: Int = EDGE_NONE

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

frameTimeMillis: Long = 0

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

Returns
NavigationEvent

A new NavigationEvent instance configured with the provided parameters.