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

jaqxues

03/06/2021, 5:01 PM
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

Doris Liu

03/06/2021, 8:15 PM
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

alorma

03/06/2021, 9:34 PM
Yes, it can be done
d

Doris Liu

03/07/2021, 6:22 AM
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

jaqxues

03/07/2021, 8:09 AM
without using animate on every single color on the theme
a

alorma

03/07/2021, 9:03 AM
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

jaqxues

03/07/2021, 9:38 AM
I was hoping more for a premade animation for material themes
6 Views