https://kotlinlang.org logo
#compose
Title
# compose
g

galex

07/21/2020, 6:44 AM
Where does Compose stand about Material Motion? https://material.io/design/motion/the-motion-system.html I love the look of those transitions 😍
m

matvei

07/21/2020, 9:26 AM
Yeah these transitions are slick! Compose has material package, so it personally makes sense to have this transitions provided out of the box at some point in the future. Having said that, you already can make it on your own. Take a look at the
Crossfade
component (source). You can copy and tweak it to add some axis motion when content is changing, for example, making it same or at least very close to material motion specs
g

galex

07/21/2020, 10:24 AM
Awesome news! For transitions I see CrossFade is a good starting point, what about modal content?
m

matvei

07/21/2020, 10:30 AM
g

galex

07/21/2020, 10:33 AM
Like those ones https://material.io/design/motion/the-motion-system.html#fade when the end result is a modal Composable on top of the one where the user clicked on an item for example
I guess I should look at AlertDialog ?
m

matvei

07/21/2020, 10:35 AM
Maybe, but I think that
CrossFade
tweaking might be enough. You see, you can change CrossFade to be not only crossfade, but any enter / exit animation for appear/disappear content. To make it more like
EnterExitTransition
, and not Crossfade 🙂
And with that you can make everything from the section you've sent
g

galex

07/21/2020, 10:37 AM
Super interesting! I think at the end if would be super helpful if we had a composable ready to use for each of the examples there, in the meantime I’d deep dive inside of CrossFade, thanks!
👍 2
4 Views