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

José Luis

03/04/2024, 4:17 PM
Hi everyone, is there any tutorial or guide for creating a custom theme which works with all plataforms? (in common Main) I want to change colors and style in the sample dowloaded from KMP wizard
g

Garret Yoder

03/04/2024, 4:18 PM
this will generate a theme for you given a color palette you select. you can also use the fantastic https://github.com/jordond/MaterialKolor library and do it at runtime & make it dynamic.
j

José Luis

03/04/2024, 4:52 PM
can it be used in a Kotlin multiplataform project?
g

Garret Yoder

03/04/2024, 4:56 PM
Yes
Most of compose (including themes) are not platform specific and just works on multiplat.
j

José Luis

03/04/2024, 7:03 PM
I've downloaded a custom theme from m3.material.io, do you know how I can add it to my project in Fleet??
g

Garret Yoder

03/04/2024, 7:27 PM
https://developer.android.com/codelabs/jetpack-compose-theming There's a lot of documentation on the android dev docs on how to do themes in material 3, compose has deep level built runtime theme support. The kotlin files you download from the material theme builder you just need to copy into your project. The one file provides an AppTheme method that themes every composable inside of it.