question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[navigator-animation] `popEnterTransition` drawn on top of `popExitTransition`

See original GitHub issue

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]

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:9
  • Comments:9

github_iconTop GitHub Comments

2reactions
ThomasArtProcessorscommented, Oct 15, 2021

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.

1reaction
maurycywcommented, 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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Animate transitions between destinations - Android Developers
Entering a destination via a pop action, an action that pops additional destinations off of the back stack when navigating. Exiting a ...
Read more >
How to set different transition animations on Navigator.pop() in ...
Every example I've found so far allows me to set only one possible transition when I pop my screen. Also, I use named...
Read more >
Compose Navigation Animations (NEW) - YouTube
The BEST android courses in the world: https://codingwithmitch.com/In this video I show you how to add animations to your jetpack compose ...
Read more >
Navigation Transitions in Jetpack Compose - YouTube
In this video, I show you how to add transition to your navigation in ComposeMy Compose Course is out now with 23+ hours...
Read more >
Stack Navigator | React Navigation
Stack Navigator provides a way for your app to transition between screens where each new screen is placed on top of a stack....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found