Is it possible with the Accompanist Navigation Ani...
# compose
j
Is it possible with the Accompanist Navigation Animation library to perform a Crossfade animation? Currently it fades out the old view and fades in the new one, which is not 100% the same, e.g. you might see the background behind both views while the animation is performed.
a
By definition cross fade means A fades out and B fades in at the same time so there will always be some time where both are transparent. If you don't want the background to be visible, you may want to use fade in.
j
I'm observing the animation if my TopAppBar has a different color that the background color of the MaterialTheme. Then the background color from the theme is visible while the animation is in progress. I'm using the default transitions from the Accompanist library (fadein + fadeout).
a
I'm saying that this is normal with cross fade. If you don't want this you should look at transition patterns other than cross fade.
j
I see. I need to use some kind of Crossfade though 😕 Maybe I have to wait for the shared element transitions on the navigation roadmap 😉
Ah well. As a workaround it seems to work to just paint something behind the StatusBar/TopAppBar with the same color as the TopAppBar. To be more precise: Behind the
AnimatedNavHost
.