iOS like gesture navigation back UI glitch
RichardLiba opened this issue · comments
When navigating back with ios style navigation gesture previous entry is rendered briefly because of exit animation in
Issue.MP4
/// do not mind jumping list it is some other issue with recomposition.
with.my.fix.mp4
AnimatedContent(
backStackEntry,
transitionSpec = {
if (prevWasSwiped) {
EnterTransition.None togetherWith ExitTransition.None
} else {
transitionSpec()
}
},
modifier = Modifier.zIndex(
if (isPrev) {
0f
} else {
1f
},
),
) {
SwipeItem(
dismissState = dismissState,
swipeProperties = actualSwipeProperties,
isPrev = isPrev,
isLast = !canGoBack,
) {
NavHostContent(composeStateHolder, it)
}
}
//Sugestion
if (prevWasSwiped) {
SwipeItem(
dismissState = dismissState,
swipeProperties = actualSwipeProperties,
isPrev = isPrev,
isLast = !canGoBack,
) {
NavHostContent(composeStateHolder, backStackEntry)
}
} else {
AnimatedContent(
backStackEntry,
transitionSpec = {
transitionSpec()
},
modifier = Modifier.zIndex(
if (isPrev) {
0f
} else {
1f
},
),
) {
SwipeItem(
dismissState = dismissState,
swipeProperties = actualSwipeProperties,
isPrev = isPrev,
isLast = !canGoBack,
) {
NavHostContent(composeStateHolder, it)
}
}
}`
Seems like in compose 1.6.0 we're getting SeekableTransitionState
which can control the progress of a transition, I think this is the perfect API to fix it, so I'd like to wait for Jetbrains to release a 1.6.0 version of compose multiplatform.
Is there any workaround?
compose multiplatform 1.6.0 beta is released, waiting for the fix