ActivityNavigator

abstract class ActivityNavigator

This allows to trigger androidx.activity.result.contract.ActivityResultContract related navigation actions from outside the view layer without keeping references to Android framework classes that might leak.

It also improves the testability of your navigation logic since it is possible to just write test that the correct events were emitted.

For this work ActivityNavigatorEffect needs to be called.

Inheritors

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

Launches the given request.

fun <I> navigateForResult(request: ActivityResultRequest<I, *>, input: I)

Launches the given request with the given input.

Link copied to clipboard
fun navigateTo(route: ActivityRoute, fallbackRoute: NavRoute? = null)

Triggers navigation to the given route.

Link copied to clipboard
fun <I, O> registerForActivityResult(contract: ActivityResultContract<I, O>): ActivityResultRequest<I, O>

Register for receiving activity results for the given contract.

Link copied to clipboard

Register for receiving permission results.

Link copied to clipboard
fun requestPermissions(request: PermissionsResultRequest, vararg permissions: String)

Launches the request for the given permissions.