androidx.navigationevent.testing


Classes

TestNavigationEventDispatcherOwner

A test implementation of NavigationEventDispatcherOwner for verifying NavigationEventDispatcher interactions.

Cmn
TestNavigationEventHandler

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

Cmn

Top-level functions summary

TestNavigationEventHandler<*>
TestNavigationEventHandler(
    isForwardEnabled: Boolean,
    onForwardStarted: TestNavigationEventHandler<*>.(event: NavigationEvent) -> Unit,
    onForwardProgressed: TestNavigationEventHandler<*>.(event: NavigationEvent) -> Unit,
    onForwardCancelled: TestNavigationEventHandler<*>.() -> Unit,
    onForwardCompleted: TestNavigationEventHandler<*>.() -> Unit,
    isBackEnabled: Boolean,
    onBackStarted: TestNavigationEventHandler<*>.(event: NavigationEvent) -> Unit,
    onBackProgressed: TestNavigationEventHandler<*>.(event: NavigationEvent) -> Unit,
    onBackCancelled: TestNavigationEventHandler<*>.() -> Unit,
    onBackCompleted: TestNavigationEventHandler<*>.() -> Unit
)

Creates an instance of TestNavigationEventHandler without requiring an explicit generic type.

Cmn

Top-level functions

TestNavigationEventHandler

fun TestNavigationEventHandler(
    isForwardEnabled: Boolean = true,
    onForwardStarted: TestNavigationEventHandler<*>.(event: NavigationEvent) -> Unit = {},
    onForwardProgressed: TestNavigationEventHandler<*>.(event: NavigationEvent) -> Unit = {},
    onForwardCancelled: TestNavigationEventHandler<*>.() -> Unit = {},
    onForwardCompleted: TestNavigationEventHandler<*>.() -> Unit = {},
    isBackEnabled: Boolean = true,
    onBackStarted: TestNavigationEventHandler<*>.(event: NavigationEvent) -> Unit = {},
    onBackProgressed: TestNavigationEventHandler<*>.(event: NavigationEvent) -> Unit = {},
    onBackCancelled: TestNavigationEventHandler<*>.() -> Unit = {},
    onBackCompleted: TestNavigationEventHandler<*>.() -> Unit = {}
): TestNavigationEventHandler<*>

Creates an instance of TestNavigationEventHandler without requiring an explicit generic type.

This function is a convenience wrapper around the TestNavigationEventHandler constructor that defaults its info type to *. Use this in tests where the specific type of NavigationEventInfo is not relevant.