Open sosauce opened 1 month ago
The log in the content block will get called multiple times because the theme is animating from one to another.
As for the slowdown. Whole app theme changing isn't an issue usually. As I have used it several times with no slowdowns.
It's most likely the call to rememberThemeColor
. It is not very fast and in a future version I plan on removing the current API for it and modifying it.
It should really be called in a coroutine on a different thread.
I will also be investigating ways to improve its performance. But the current implementation does come from the material-color-utilities.
After some testing it appears the size of the image has an impact, I went from 640 x 480 to 50, 50 and it works perfectly fine now
Hello ! I am building a music app, and thought it would be cool to use your library to change the app's WHOLE (this might be important) theme based on the currently playing music's art. I've noticed that the app freezes for ~3 seconds (this probably will vary depending on the device), I also have to have my custom way of getting the imageBitmap from the currently playing musics art (code below) which even if run on the IO thread, still freezes the app. I also saw that the Log "content" gets logged 3 times when switching theme, if it helps.
Here is my question : If not already, is there a way to implement asynchronous theme switching ?
I think that it's due to the fact that's it's my whole app that is switching theme, but a smooth switching would be nice !
Full code :