Last active
July 16, 2021 13:55
-
-
Save wesjon/a385165eb128733ece56cf4c96ad0cb5 to your computer and use it in GitHub Desktop.
A theme in Jetpack Compose example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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