fornewid/material-motion-compose

Integration with navigation-compose

fornewid opened this issue · 4 comments

It is expected that transition animations can be applied to navigation-compose after some time.
The following link is related to this.

Then, it seems that it needs to be changed to a form that can be combined with navigation-compose.

Excited for this one.

Maybe a new library will be added to accompanist..? 👀
google/accompanist#574

accompanist v0.16.0 now includes support for animations in navigation 🥳 🎉

We can use EnterTransition and ExitTransition with the new AnimatedNavHost

val navController = rememberAnimatedNavController()

AnimatedNavHost(
    navController = navController,
    startDestination = 'some-route',
    enterTransition = { _, _ ->
        materialSharedAxisX(forward = true, slideDistance = 30).enter.transition
    },
    exitTransition = { _, _ ->
        materialSharedAxisX(forward = false, slideDistance = 30).exit.transition
    }
) {
    // Our composables can have individual transitions too
}