DestinationNavigator

abstract class DestinationNavigator(val hostNavigator: HostNavigator) : Navigator, ActivityNavigator

A combination of Navigator and com.freeletics.khonshu.navigation.activity.ActivityNavigator that can be used as base class for navigators of individual screens.

Constructors

Link copied to clipboard
constructor(hostNavigator: HostNavigator)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

Delivers the result to the destination that created key.

Link copied to clipboard
open override fun getEntryFor(id: StackEntry.Id): StackEntry<*>
Link copied to clipboard
open override fun getTopEntryFor(destinationId: DestinationId<*>): StackEntry<*>
Link copied to clipboard
Link copied to clipboard
open override fun navigateBack()

Removes the top entry from the backstack to show the previous destination.

Link copied to clipboard
open override fun <T : BaseRoute> navigateBackTo(popUpTo: KClass<T>, inclusive: Boolean)

Removes all entries from the backstack until T. If inclusive is true T itself will also be removed.

Link copied to clipboard
inline fun <T : NavRoute> Navigator.navigateBackTo(inclusive: Boolean = false)

Removes all entries from the backstack until T. If inclusive is true T itself will also be removed.

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
open override fun navigateTo(route: NavRoute)

Triggers navigation to the given route.

fun navigateTo(route: ActivityRoute, fallbackRoute: NavRoute? = null)

Triggers navigation to the given route.

Link copied to clipboard
open override fun navigateUp()

Triggers up navigation.

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 navigation results.

Link copied to clipboard

Register for receiving permission results.

Link copied to clipboard
open override fun replaceAllBackStacks(root: NavRoot)

Remove all back stacks and create a new back stack with the given root.

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

Launches the request for the given permissions.

Link copied to clipboard
open override fun showRoot(root: NavRoot)

Show root as the current destination. If there already is a back stack for root, regardless of whether it is the current back stack or not, the stack will be cleared.

Link copied to clipboard
open override fun switchBackStack(root: NavRoot)

Show the existing back stack for root or create a new back stack if none exists. If an existing back stack is shown it will be shown in it's previous state. If root is the root of the current back stack this is a no-op.