PreCompose icon indicating copy to clipboard operation
PreCompose copied to clipboard

iOS like gesture navigation back UI glitch

Open RichardLiba opened this issue 1 year ago • 3 comments

When navigating back with ios style navigation gesture previous entry is rendered briefly because of exit animation in

https://github.com/Tlaster/PreCompose/assets/32630888/dca991ac-fe89-4c20-8dfc-142530568e69

/// do not mind jumping list it is some other issue with recomposition.

https://github.com/Tlaster/PreCompose/assets/32630888/d4d2cb7b-4b68-4455-bffd-b1c5ff860ecb

 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)
                            }
                        }
                    }`

RichardLiba avatar Nov 29 '23 09:11 RichardLiba

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.

Tlaster avatar Nov 29 '23 09:11 Tlaster

Is there any workaround?

KostadinAlmishev avatar Dec 07 '23 22:12 KostadinAlmishev

compose multiplatform 1.6.0 beta is released, waiting for the fix

ti4n1993 avatar Jan 26 '24 04:01 ti4n1993