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

Florian

10/07/2021, 9:23 AM
How can I get rid of `compose-navigation`'s cross-fade animation? It doesn't work well with 1. hiding bottom bars, 2. per-screen scaffolds. I can use Accompanist, but I don't wanna set the transition to null in each single
composable
path 😣.
c

cb

10/07/2021, 9:39 AM
I can use Accompanist, but I don't wanna set the transition to null in each single 
composable
 path
You don't need to. You can set the default transition (i.e. null) on the
AnimatedNavHost
1
❤️ 1
s

sindrenm

10/07/2021, 9:57 AM
Also, a side note: Setting it to
null
on each
composable()
wouldn't work, right? Since that would then default up to whatever's set on the
AnimatedNavHost
, which is the `fadeIn`/`fadeOut`.
f

Florian

10/07/2021, 10:06 AM
null was just a placeholder for whatever I would have to pass 😆
blob sweat smile 1
thank you @cb that's great
but how exactly do I do that?
pass `enter`/`exit`/`pop` to the AnimatedNavHost?
and what value? null does indeed not work
Copy code
AnimatedNavHost(
    navController = navController,
    startDestination = bottomNavDestinations[0].route,
    modifier = modifier,
    enterTransition = {_,_ -> EnterTransition.None },
    exitTransition = {_,_ -> ExitTransition.None },
    popEnterTransition = {_,_ -> EnterTransition.None },
    popExitTransition = {_,_ -> ExitTransition.None },
)
Is this the way?
c

cb

10/07/2021, 11:14 AM
Yep, looks good to me
f

Florian

10/07/2021, 6:38 PM
thank you very much @cb
3 Views