Alex
06/16/2021, 11:54 AMAlex
06/16/2021, 11:54 AMMaterialTheme.typography.button
will provide different values locally than globally.
Kind of like ProvideTextStyle
but only changing one specific MaterialTheme style.
The UseCase is changing the textstyles for focused/unfocused label texts in an OutlinedTextField
Se7eN
06/16/2021, 12:00 PM@Composable
fun AppTheme(
typography: Typography = DefaultTypography,
darkTheme: Boolean = isSystemInDarkTheme(),
content: @Composable() () -> Unit
) {
...
MaterialTheme(
colors = colors,
typography = typography,
shapes = Shapes,
content = content
)
}
And then based on the focused or unfocused state of the text field you can pass a different typography:
AppTheme(typography = if(focused) ... else ...) {
TextField()
}