I've started playing with `NavHost` I love the way...
# compose
e
I've started playing with
NavHost
I love the way I can setup navigation with it. What I'm trying to understand is how I can get it to animate. I see that when I call
navigate()
I have a lambda where I can provide options such as Anim. I have something like this:
Copy code
navController.navigate(Destination.newGame) {
  anim { enter }
}
I'm guessing that I haven't defined the enter animation, since no animation is defined. Where do I define that? In the MaterialTheme somehow?
i
You can't use View animations for Composables, so that anim block isn't going to help. Transition support in NavHost isn't available yet (but we're working on it!). See the previous thread for more details: https://kotlinlang.slack.com/archives/CJLTWPH7S/p1616080704148700?thread_ts=1616080704.148700&cid=CJLTWPH7S
👍 1
e
Good to know :) looking forward to see what you guys are putting together. I really like how the Navigation integrates into compose thus far!
@Ian Lake I managed to get enter anim to work using
Copy code
AnimatedVisibility
But not exit, and I think I understand why. I'm guessing there's no workaround currently? I.e. I have to be more patient 😄
i
Correct, we're working on it right now 😀
🎉 1