Any suggestions on how I could farther make this a...
# compose
z
Any suggestions on how I could farther make this animation nicer?
Copy code
if (targetState == SettingsDestination.Main) {
    slideInHorizontally { width -> -width } + fadeIn() with fadeOut()
} else {
    slideInHorizontally { width -> width } + fadeIn() with fadeOut()
}
c
A couple suggestions to try: • Make the title (Settings/General) animate the same as its content • Speed up the fadeOut of the exiting content - in the video if you slow it down it looks like some content is being clipped
In general you can also look at this guideline for inspiration: https://m2.material.io/design/motion/the-motion-system.html
e
Circuit has a transition that mirrors the android activity transition, you can probably tweak it a bit to fit. One trick in that snippet is to disable clipping on the transition also
a
Also, if you move the background contents a third of what the new foreground moves, that can work too
similar to this I threw together months ago