How can I animate switching from dark to light the...
# compose
j
How can I animate switching from dark to light theme (without using animate on every single color on the theme)
It only updates once you select another item From dark to light theme:
d
Could you file a bug for this including the code snippet and screenshot? 🙂
How can I animate switching from dark to light theme (without using animate on every single color on the theme)
I don't think there's a way to do that yet. Without knowing how you use it, I'd say it's more efficient to animate the color as you read it out from the theme than animating everything defined in the theme. But I'm curious whether this question is motivated by also animating the implicit theme color reads from material components.
a
Yes, it can be done
d
Thanks for sharing. @alorma Curious if you see any frame drop at all when all the colors animate during the theme change. I expect that to result in quite a few recompositions. 🙂
j
without using animate on every single color on the theme
a
This uses a transition, thats what them are fore, coordinate different animations
No @Doris Liu, as using a transition, it gets updated once per frame, it not animate each color on different steps, it's a single animation
j
I was hoping more for a premade animation for material themes