Merge "Correct the RTL animation for AnimatedNavHost"
This commit is contained in:
@@ -119,22 +119,22 @@ private fun NavControllerWrapperImpl.NavContent(allProvider: Collection<Settings
|
||||
arguments = spp.parameter,
|
||||
enterTransition = {
|
||||
slideIntoContainer(
|
||||
AnimatedContentScope.SlideDirection.Left, animationSpec = slideEffect
|
||||
AnimatedContentScope.SlideDirection.Start, animationSpec = slideEffect
|
||||
) + fadeIn(animationSpec = fadeEffect)
|
||||
},
|
||||
exitTransition = {
|
||||
slideOutOfContainer(
|
||||
AnimatedContentScope.SlideDirection.Left, animationSpec = slideEffect
|
||||
AnimatedContentScope.SlideDirection.Start, animationSpec = slideEffect
|
||||
) + fadeOut(animationSpec = fadeEffect)
|
||||
},
|
||||
popEnterTransition = {
|
||||
slideIntoContainer(
|
||||
AnimatedContentScope.SlideDirection.Right, animationSpec = slideEffect
|
||||
AnimatedContentScope.SlideDirection.End, animationSpec = slideEffect
|
||||
) + fadeIn(animationSpec = fadeEffect)
|
||||
},
|
||||
popExitTransition = {
|
||||
slideOutOfContainer(
|
||||
AnimatedContentScope.SlideDirection.Right, animationSpec = slideEffect
|
||||
AnimatedContentScope.SlideDirection.End, animationSpec = slideEffect
|
||||
) + fadeOut(animationSpec = fadeEffect)
|
||||
},
|
||||
) { navBackStackEntry ->
|
||||
|
||||
@@ -201,11 +201,7 @@ public fun AnimatedNavHost(
|
||||
transition.AnimatedContent(
|
||||
modifier,
|
||||
transitionSpec = {
|
||||
val zIndex = if (composeNavigator.isPop.value) {
|
||||
visibleEntries.indexOf(initialState).toFloat()
|
||||
} else {
|
||||
visibleEntries.indexOf(targetState).toFloat()
|
||||
}
|
||||
val zIndex = composeNavigator.backStack.value.size.toFloat()
|
||||
// If the initialState of the AnimatedContent is not in visibleEntries, we are in
|
||||
// a case where visible has cleared the old state for some reason, so instead of
|
||||
// attempting to animate away from the initialState, we skip the animation.
|
||||
|
||||
Reference in New Issue
Block a user