:wave: I am migrating an existing app to jetpack c...
# compose
a
👋 I am migrating an existing app to jetpack compose. We use apart from the existing Material colors a lot of additional colors all of them defined in the theme xml. I was wondering if there is a way of using these colors directly from the xml file instead of duplicating these colors in a custom theme. I cannot find any example about this...hopefully this isn't a to dumb question here.
b
Not compose/android specific, but you could load & parse that xml from resources and get the colours in compose that way
a
Copy code
colorResource(id = R.color.your_color)
s
There's
colorResource(id: Int)
, at least. Is that what you're looking for?
Beat me to it, Attila! 😅
a
Indeed, but what then with things like custom
textAppearences
etc?
a
Indeed, then you just again have the basic Material typography. Custom added typography isn't available then.
s
Compose's
Typography
is part of androidx.compose.material. You'll need to roll your own/build on top of that if you have different styles.
👍 1
a
Thanks wasn't sure if there was a workaround or not