Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[navigator-animation] popEnterTransition drawn on top of popExitTransition #731

Closed
brianwernick opened this issue Sep 20, 2021 · 9 comments
Assignees
Labels
stale Stale issues which are marked for closure

Comments

@brianwernick
Copy link

Describe the bug

In navigator-animation when I pop a NavBackStackEntry off the graph and the popExitTransition and popEnterTransition is called the destinations popEnterTransition is drawn over the current (popping) entry's popExitTransition.

To Reproduce

Construct an AnimatedNavHost with a customized popEnterTransition that has an initial offset > 0, e.g.

AnimatedNavHost(
  navController, 
  startDestination = "Blue",
  popEnterTransition = { _, _, ->
    slideInHorizontally(initialOffsetX = { -it / 5 }, animationSpec = tween(durationMillis = 700))
  }
)

NOTE:
If modifying the AnimatedNavHostSample make sure to null out the popEnterTransition of the destination composable, I updated the "Blue" composable to popEnterTransition = null

Expected behavior

The popEnterTransition for the destination NavBackStackEntry should be drawn underneath (lower z-index) the popExitTransition of the current NavBackStackEntry during a pop.

Screenshots?

navigator-animation pop issue

Environment:

  • Android OS version: [Android 10]
  • Device: [Emulator]
  • Accompanist version: [0.18.0]
@kikasik
Copy link

kikasik commented Sep 24, 2021

Same issue

@DonnyRozendal
Copy link

I have this issue with both entering and popping. This issue is still present on version 0.19.0 and has been an issue since the beginning I believe. This is the only thing that keeps me from using Compose navigation for production...

@ThomasArtProcessors
Copy link

Same issue, which is especially jarring when screens slide up and down.
I have a screen that should remain in place with another sliding up from the bottom then sliding down when exiting, but the main screen just appears directly so the slide down is lost.

@alexducatti
Copy link

Also confirmed this issue on 0.21.2-beta

@github-actions
Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the stale Stale issues which are marked for closure label Dec 10, 2021
@brianwernick
Copy link
Author

Ping for stale bot

@codingfd
Copy link

Also confirmed this issue on 0.23.0

@maurycyw
Copy link

maurycyw commented Mar 14, 2022

@jbw0033

could this be as simple as specifying the targetContentZIndex when specifying the transitionSpec for the AnimatedContent? :

meaning instead of

transition.AnimatedContent(
    modifier,
    transitionSpec = { finalEnter(this) with finalExit(this) },
    contentAlignment
) { ... }

we could do:

transition.AnimatedContent(
    modifier,
    transitionSpec = { ContentTransform(finalEnter(this), finalExit(this), 1f) },
    contentAlignment
) { ... }

Also can this ticket please be reopened

@theGlenn
Copy link

Quite connected to #1001

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Stale issues which are marked for closure
Projects
None yet
Development

No branches or pull requests

9 participants