Skip to main content

Compose Theme

There is an extension to change the Compose Theme.

Setup

Add the katalog-ext-theme package.

dependencies {
implementation("com.moriatsushi.katalog:katalog:`LATEST_VERSION`")
implementation("com.moriatsushi.katalog:katalog-ext-theme:`LATEST_VERSION`")
}

Examples

You can set the Material Theme when calling registerKatalog. The background color will be applied automatically. Don't forget to set the content.

registerKatalog(
title = "Android Sample",
extensions = listOf(
ThemeExt { content ->
MaterialTheme(
colors = MaterialTheme.colors.copy(
background = Color.Red
),
content = content
)
}
)
) {
compose("Text") {
Text(text = "Hello, World")
}
}