Daniele B
10/22/2020, 12:23 PMval typography = Typography(
body1 = TextStyle(
fontWeight = FontWeight.Normal,
fontSize = 20.sp,
letterSpacing = 0.5.sp
)
)
If I change the fontsize on my own typography, it also seems to affect Texts where I specify a MaterialTheme
style
Text(text = row.nome, style = MaterialTheme.typography.body1, fontWeight = FontWeight.Bold)
I was expecting it would only affect Text where my own typography is specified:
Text(text = row.nome, style = typography.body1, fontWeight = FontWeight.Bold)
How is it supposed to work?Halil Ozercan
10/22/2020, 12:26 PMDaniele B
10/22/2020, 12:28 PMmyTypography
, but it’s still affecting Text components styled with MaterialTheme.typography
. Very strange to meBryan Herbst
10/22/2020, 1:24 PMMaterialTheme
composable somewhere? If so, what values are you passing to it for color, typography, and shape?Daniele B
10/23/2020, 3:02 PM@Composable
fun MyAppTheme(coreViewModel: CoreViewModel, darkTheme: Boolean = isSystemInDarkTheme(), content: @Composable() () -> Unit) {
val themeColors : Colors = if (darkTheme) {
getThemeColors(coreViewModel.themes.DarkColorPalette, false)
} else {
getThemeColors(coreViewModel.themes.LightColorPalette, true)
}
MaterialTheme(
colors = themeColors,
typography = myTypography,
shapes = shapes,
content = content
)
}