I'm adding enterTransition and exitTransition to m...
# compose-android
b
I'm adding enterTransition and exitTransition to my composable() in my nested navGraph. When doing a sliding transition, should the currentScreens exitTransition be doing a slide animation as well as the screen that's going to be navigated to doing a slide animation? Using both of these together makes it seem a little weird visually? Has anyone implemented animation transitions with the newer compose navigation version?
I'm thinking it should be one or the other? either the existing view should slide out, or the new view should slide in? but not both?
This is only an enter transition on the details page that I'm navigating to.
this is an enter transition on the details page and an exit transition on the list page.
c
I’ve added custom transitions to my sample app this week, using the latest Compose navigation library. I used a mix of the guidance and motion tokens from the Material3 Motion guides and a bit of trial and error, since the patterns described in the guides are not used by default in the library.
This is the result. Note there are many animations in this app, but the ones you’re looking for are the screen transitions. You should be able to see here that when navigating from the home screen to the other screens, there is an exit and enter transition for the incoming and outgoing screen. I also have similar animations when going back, i.e. popEnter/popExit.
I also started out using these premade transitions that I created based on reading through the older Material2 motion guidance: https://gist.github.com/c5inco/796edc5d88e8561872380b61e6089c04
🙌 1
136 Views