https://kotlinlang.org logo
#compose
Title
# compose
a

Archie

11/28/2021, 6:25 PM
Hi @Ian Lake, Any guide on how to provide Navigation Animation with Accompanist for Nested Navigation? I tried doing:
Copy code
navigation(
   route = "routeName",
   startDestination = "startDestination"
) {
   // transitions defined in this composable never seem to run
   composable(
        route =  "someDestination",
        enterTransition = { slideIntoContainer(AnimatedContentScope.SlideDirection.End) },      
        exitTransition = { slideOutContainer(AnimatedContentScope.SlideDirection.Start) },      
        popEnterTransition = { slideIntoContainer(AnimatedContentScope.SlideDirection.End) },   
        popExitTransition = { slideOutContainer(AnimatedContentScope.SlideDirection.End) },
   ) {
      ...
   }
   ...
}
The only way I could make the animation to run is when I define the transition in the nested navigation:
Copy code
// Define them here instead and it works
navigation(
   route = "routeName",
   startDestination = "startDestination"
   enterTransition = { slideIntoContainer(AnimatedContentScope.SlideDirection.End) },      
        exitTransition = { slideOutContainer(AnimatedContentScope.SlideDirection.Start) },      
        popEnterTransition = { slideIntoContainer(AnimatedContentScope.SlideDirection.End) },   
        popExitTransition = { slideOutContainer(AnimatedContentScope.SlideDirection.End) },
) {
   composable(
        route = "someDestination",
   ) {
      ...
   }
   ...
}
Just wondering whether this is intended? or whether there is a better way to do this? Thanks in advance.
I found this as well: https://github.com/google/accompanist/issues/882 If I understand it correctly these are related?
i

Ian Lake

11/28/2021, 9:54 PM
Yep, just broken in this last release; we'll be prioritizing a fix when we're back from the Thanksgiving holiday here
K 3
🦜 4
a

Archie

11/29/2021, 5:31 AM
Alright thank you very much
4 Views