Colton Idle
08/17/2022, 3:53 PMcomposable(
Screen.FakeModal.route,
enterTransition = {
slideIntoContainer(AnimatedContentScope.SlideDirection.Up, animationSpec = tween(1500))
},
exitTransition = {
slideOutOfContainer(AnimatedContentScope.SlideDirection.Down, animationSpec = tween(1500))
},
Ian Lake
08/18/2022, 1:36 AMexitTransition
on the screen that you are on before this screen? If you don't define one, you'll be getting the default fadeColton Idle
08/18/2022, 5:17 PMIan Lake
08/18/2022, 5:37 PMinitialState
(the destination you're coming from) and the targetState
(the destination you are going to) that are available via the AnimatedContentScope
the enterTransition
and exitTransition
blocks have make it possible to customize the transition based on exactly what pair you are navigating betweenAnimatedNavHost
level are used for the root graph, which has the final say in the default animations)Colton Idle
08/18/2022, 6:03 PMcomposable(Screen.MyScreen.route, exitTransition = {
when (targetState.destination.route) {
Screen.FakeBottomSheet.route -> holdOut(1500)
else -> null // use the defaults
}}) {
and
fun holdOut(
durationMillis: Int = 1500,
): ExitTransition = fadeOut(
// TODO: Refer <https://issuetracker.google.com/issues/192993290>
// targetAlpha = 1f,
targetAlpha = 0.999f,
animationSpec = tween(
durationMillis = durationMillis,
easing = LinearEasing
)
)
Zoltan Demant
08/19/2022, 4:01 AMIan Lake
08/19/2022, 4:18 AMColton Idle
08/19/2022, 6:31 AM