Hi Team, After migrating the app from XML-based na...
# compose-android
n
Hi Team, After migrating the app from XML-based navigation to Jetpack Compose Navigation, we’re seeing noticeable visual differences, even though we haven’t explicitly set animations in either implementation. Is it possible to achieve the same static look and feel we had in XML navigation? Looking forward to your thoughts!
s
NavHost accepts parameters for what animation your navigations should have. Use them to define what you want.
a
We turned off animations on the nav host to make it appear faster. Its quite snappy without them
👍 1
n
My bad — it turns out that, by default, there are animations enabled in Jetpack Compose Navigation. When I disable them in
MainNavHost
like this:
enterTransition = { EnterTransition.None },
exitTransition = { ExitTransition.None },
popEnterTransition = { EnterTransition.None },
popExitTransition = { ExitTransition.None }
the navigation feels much faster and more similar to how it behaved before the migration to Compose Navigation. However, I’ve noticed that occasionally, some pages flicker when navigating to them before they are fully displayed.
s
Do you have a video of such a case? I see two possibilities. You're not doing fillMaxSize on the parent of that child, and there is some sort of size animation. Or your initial state of that screen is not what you want it to be yet, so you get flickering going from loading -> real data.
👍 1
n
It seems we’re experiencing the same flickering issue in our XML-based navigation, and it’s related to loading images from URLs as part of our pages. Thanks for the advice!
s
You got it 😊
🙏 1
a
Btw you don't need to post the answer of GenAI. It's long and useless. Just ask your question.
3
a
Wasn’t going to ask if it was genai but looked sus 😅