Package-level declarations

Types

Link copied to clipboard
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.

Link copied to clipboard
Link copied to clipboard
sealed interface ActivityRoute

Represents the route to an Activity. Should be used through InternalActivityRoute and ExternalActivityRoute.

Link copied to clipboard

Represents the route to an Activity in another app. buildIntent can be used to dynamically add extras to the resulting Intent.

Link copied to clipboard

Represents the route to an Activity within the current app. The instance of this route will be added to the resulting Intent and can be accessed in the launched Activity by calling getRoute or requireRoute. The navigator will also ensure that the Intent will only target the current app.

Functions

Link copied to clipboard
@Composable
fun ActivityNavigatorEffect(navigator: ActivityNavigator)

Sets up the ActivityNavigator and com.freeletics.khonshu.navigation.DestinationNavigator inside the current composition so that its events are handled while the composition is active.

Link copied to clipboard
inline fun <T : InternalActivityRoute> Activity.getRoute(): T?

Returns the ActivityRoute that was used to navigate to this Activity if it's present in Activity's Intent.

Link copied to clipboard
inline fun <T : InternalActivityRoute> Activity.requireRoute(): T

Returns the ActivityRoute that was used to navigate to this Activity.