alexzhukovich
04/24/2020, 5:47 PMLouis Pullen-Freilich [G]
04/24/2020, 6:43 PMprimary
in the dark theme is 1f1f1f
? I'm wondering what you use it for, as this seems atypicalalexzhukovich
04/24/2020, 8:59 PMSiyamed
04/28/2020, 5:43 AMalexzhukovich
05/15/2020, 5:25 AMMBegemot
05/20/2020, 11:17 AMh1 = defaultTypography.h1.copy(fontFamily = appFontFamily)
then when you use Matherial.typografy.h1 in a text which of the family members will be applied? Thank you so much!alexzhukovich
05/25/2020, 8:38 PMdefaultTypography
, you can find a a typography constructor which initialize Typography properties, like h1
, h2
, h3
, etc.
constructor(
defaultFontFamily: FontFamily = FontFamily.Default,
h1: TextStyle = TextStyle(
fontWeight = FontWeight.Light,
fontSize = 96.sp,
letterSpacing = (-1.5).sp
),
h2: TextStyle = TextStyle(
fontWeight = FontWeight.Light,
fontSize = 60.sp,
letterSpacing = (-0.5).sp
),
...
)
As you can see every property is TextStyle
and if we want to replace only fontFamily
we need to use copy
functionTextStyle
has a fontWeight
and it helps the framework to understand which fontStyle will be used. In case of h1
we have the val Light = W300
. Every font has a weight
property:
ResourceFont(
resId = R.font.roboto_light,
weight = FontWeight.W300,
style = FontStyle.Normal
)