is it currently possible to set up theme, without using xml-theming at all? For example, I currently have to use xml theme with statusBarColor and primaryColor stuff set, otherwise colors are different, before activities start. I'm using accompanist to set up system bar colors tough
a
Adam Powell
07/17/2021, 2:02 PM
No, the static theme is used by the system to show part of your app startup before your code even has a chance to run. Loading your app code is part of what takes a while and the system showing this part of the app startup on your behalf is what keeps your app launch feeling more responsive
Adam Powell
07/17/2021, 2:03 PM
There may be variants in the future that don't strictly use xml as the developer-facing declaration mechanism, but it will need to be determined at build time, not runtime
p
Peter Mandeljc
07/17/2021, 2:05 PM
I see, thank you for explaining! Hope I would be able to do this in future, since declaring theme on two places is not ideal atm.
a
Adam Powell
07/17/2021, 2:30 PM
you can take a look at things like the material theme converters to read your xml themes into compose at runtime to address the single source of truth part, it won't help the being xml part though 🙂
👍 1
Adam Powell
07/17/2021, 2:31 PM
the mechanism used is
context.obtainStyledAttributes
under the hood
Adam Powell
07/17/2021, 2:36 PM
we decided to take a wait and see approach here in terms of what people end up wanting/needing, whether that's the full mdc-android stuff, appcompat, or just android framework theme attributes and styles. Different apps will need different things and if we offered all of the possible options it could get super confusing