AnimatedNavHost

@Composable()
fun AnimatedNavHost(navController: NavHostController, startDestination: String, modifier: Modifier = Modifier, contentAlignment: Alignment = Alignment.Center, route: String? = null, enterTransition: AnimatedContentScope<NavBackStackEntry>.() -> EnterTransition = { fadeIn(animationSpec = tween(700)) }, exitTransition: AnimatedContentScope<NavBackStackEntry>.() -> ExitTransition = { fadeOut(animationSpec = tween(700)) }, popEnterTransition: AnimatedContentScope<NavBackStackEntry>.() -> EnterTransition = enterTransition, popExitTransition: AnimatedContentScope<NavBackStackEntry>.() -> ExitTransition = exitTransition, builder: NavGraphBuilder.() -> Unit)

Provides in place in the Compose hierarchy for self contained navigation to occur.

Once this is called, any Composable within the given NavGraphBuilder can be navigated to from the provided navController.

The builder passed into this method is remembered. This means that for this NavHost, the contents of the builder cannot be changed.

Parameters

navController

the navController for this host

startDestination

the route for the start destination

modifier

The modifier to be applied to the layout.

route

the route for the graph

enterTransition

callback to define enter transitions for destination in this host

exitTransition

callback to define exit transitions for destination in this host

popEnterTransition

callback to define popEnter transitions for destination in this host

popExitTransition

callback to define popExit transitions for destination in this host

builder

the builder used to construct the graph

@Composable()
fun AnimatedNavHost(navController: NavHostController, graph: NavGraph, modifier: Modifier = Modifier, contentAlignment: Alignment = Alignment.Center, enterTransition: AnimatedContentScope<NavBackStackEntry>.() -> EnterTransition = { fadeIn(animationSpec = tween(700)) }, exitTransition: AnimatedContentScope<NavBackStackEntry>.() -> ExitTransition = { fadeOut(animationSpec = tween(700)) }, popEnterTransition: AnimatedContentScope<NavBackStackEntry>.() -> EnterTransition = enterTransition, popExitTransition: AnimatedContentScope<NavBackStackEntry>.() -> ExitTransition = exitTransition)

Provides in place in the Compose hierarchy for self contained navigation to occur.

Once this is called, any Composable within the given NavGraphBuilder can be navigated to from the provided navController.

Parameters

navController

the navController for this host

graph

the graph for this host

modifier

The modifier to be applied to the layout.

enterTransition

callback to define enter transitions for destination in this host

exitTransition

callback to define exit transitions for destination in this host

popEnterTransition

callback to define popEnter transitions for destination in this host

popExitTransition

callback to define popExit transitions for destination in this host