Package com.kpstv.navigation.compose

Types

Link copied to clipboard
class ComposeNavigator

A navigator for managing pure composable navigation in Jetpack Compose.

Link copied to clipboard
fun interface ComposeTransition

Transition are usually implemented by customizing the Modifier.graphicsLayer.

Link copied to clipboard
interface DialogRoute : Route

Destination must implement this interface to identify a Route as Dialog.

Link copied to clipboard

A class which is tied to every Route's destination that itself is SavedStateRegistryOwner&ViewModelStoreOwner.

Link copied to clipboard
abstract class NavigatorTransition

Interface to define custom transition.

Link copied to clipboard
data class NavOptions<T : Route>(singleTop: Boolean, popOptions: NavOptions.PopUpOptions<T>?, animationOptions: NavOptions.NavAnimation)

Set of options that can be optionally specified when navigating to new destination through ComposeNavigator.Controller.navigateTo.

Link copied to clipboard
interface Route : Parcelable

Class must implement this interface to identify as navigation root. Each navigation root should specify a Key to identify this route as a unique route in the backstack.

Link copied to clipboard
typealias RouteKey<T> = KClass<out Route.Key<T>>

Navigation root key to be provided during ComposeNavigator.Setup(...) to make current navigation unique in the backstack & to enforce correct typesafe navigation.

This key then can be used to retrieve an instance of ComposeNavigator.Controller to manage navigation within this Route.

Link copied to clipboard
value class TransitionKey(key: String) : Parcelable

A key to uniquely identify this transition that can be used in conjunction with NavOptions.withAnimation to specify animations for navigating to a new destination.

Link copied to clipboard
annotation class UnstableNavigatorApi

If marked on a function or a property then it means that the function or property is unstable & should be carefully use in production code as it's behavior might not be stable.

Functions

Link copied to clipboard
@Composable
fun findComposeNavigator(): ComposeNavigator

Find the ComposeNavigator provided by the nearest CompositionLocalProvider.

Link copied to clipboard
@Composable
fun <T : Route> findNavController(key: RouteKey<T>): ComposeNavigator.Controller<T>

Find & remember an instance of ComposeNavigator.Controller provided by the nearest CompositionLocalProvider for a Navigation root key.

Link copied to clipboard
@Composable
fun <T : Route> rememberNavController(): ComposeNavigator.Controller<T>

Create & remember the instance of the ComposeNavigator.Controller that will be used for navigation within the Route of type T.

Properties

Link copied to clipboard
val Fade: TransitionKey

A Fade transition

Link copied to clipboard
val None: TransitionKey

No transition

Link copied to clipboard
val SlideLeft: TransitionKey

Slide left transition.

Link copied to clipboard
val SlideRight: TransitionKey

Slide right transition.