Skip to content

Instantly share code, notes, and snippets.

@wesjon
Last active July 16, 2021 13:55
Show Gist options
  • Save wesjon/a385165eb128733ece56cf4c96ad0cb5 to your computer and use it in GitHub Desktop.
Save wesjon/a385165eb128733ece56cf4c96ad0cb5 to your computer and use it in GitHub Desktop.
A theme in Jetpack Compose example
@Composable
fun ContactList() {
MyTheme {
// Todos os composables deste bloco irão herdar o aspecto visual de MyTheme
Text("Hello world")
}
}
@Composable
fun MyTheme(
darkTheme: Boolean = isSystemInDarkTheme(),
content: @Composable () -> Unit
) {
MaterialTheme(
colors = if (darkTheme) DarkColors else LightColors,
/*...*/
content = content
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment