We have an app that's like 50% views and 50% compo...
# compose-android
c
We have an app that's like 50% views and 50% compose. We re-wrote our entire theme in compose, but now I'm tasked with applying things like our TextStyle to our view portion part of our app so everything looks consistent. Is that possible, or do I have to duplicate certain TextStyles to still be used in the view system?
f
there is the XML theme to compose tool (MdcTheme), but that works the opposite way of what you want https://developer.android.com/jetpack/compose/designsystems/views-to-compose there is no way to get a compose theme and generate XML theme from it
as far as I know, you'll have to duplicate the compose styles in XML
e
my team's solution is to leave the values in XML and write a custom Gradle task to generate various `object`s with `const val`s at build time, sorta like design tokens. then the Compose theme etc. can just reference those
f
isn't this basically what the MDC theme adapter does?
e
in principle yes, but that is at runtime and our DS doesn't all line up with Material
f
ok, but that does not address Colton's issue, as he wants to go the other way around. I don't believe any tools exists for that, and the MDC adapter docs indicate that you can't go that route (compose to XML)
e
you could probably try to do things like my team's approach, but it's definitely a lot crazier in reverse because you'd have to assume a specific code structure to parse values from Kotlin at build time
so for practical purposes I agree, only XML to compose theming and not the other way around
f
so Colton, you have your work cut out for you
c
so Colton, you have your work cut out for you
😂 😂 😂 😂
well. it looks like I'll just copy stuff that I need... over.