Search code examples

Disable NavHost animation

Is there any option to disable the CrossFade animation when navigating in Jetpack Compose?

In the source code, I see that the CrossFade is simply hardcoded, and in AnimatedNavHost from "accompanist" I can't locate such an option.


  • After digging i found the following solution:

    In the AnimatedNavHost composable, we need to specify 'empty' transitions.

                        navController = navController,
                        startDestination = "main",
                        enterTransition = { _, _ -> EnterTransition.None},
                        exitTransition = { _, _ -> ExitTransition.None}