In material design 3, there are 15 types of typography tokens:
- textAppearanceDisplayLarge (57sp)
- textAppearanceDisplayMedium (45sp)
- textAppearanceDisplaySmall (36sp)
- textAppearanceHeadlineLarge (32sp)
- textAppearanceHeadlineMedium (28sp)
- textAppearanceHeadlineSmall (24sp)
- textAppearanceTitleLarge (22sp)
- textAppearanceTitleMedium (16sp)
- textAppearanceTitleSmall (14sp)
- textAppearanceBodyLarge (16sp)
- textAppearanceBodyMedium (14sp)
- textAppearanceBodySmall (12sp)
- textAppearanceLabelLarge (14sp)
- textAppearanceLabelMedium (12sp)
- textAppearanceLabelSmall (11sp)
Here is how I used the tokens:
values\dimens.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="textSizeDisplay">36sp</dimen>
<dimen name="textSizeHeadline">24sp</dimen>
<dimen name="textSizeTitle">14sp</dimen>
<dimen name="textSizeBody">12sp</dimen>
<dimen name="textSizeLabel">11sp</dimen>
</resources>
values-large\dimens.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="textSizeDisplay">45sp</dimen>
<dimen name="textSizeHeadline">28sp</dimen>
<dimen name="textSizeTitle">16sp</dimen>
<dimen name="textSizeBody">14sp</dimen>
<dimen name="textSizeLabel">12sp</dimen>
</resources>
values-xlarge\dimens.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="textSizeDisplay">57sp</dimen>
<dimen name="textSizeHeadline">32sp</dimen>
<dimen name="textSizeTitle">22sp</dimen>
<dimen name="textSizeBody">16sp</dimen>
<dimen name="textSizeLabel">14sp</dimen>
</resources>
Depending on the text type, I use the tokens
<com.google.android.material.textview.MaterialTextView
...
android:textSize="@dimen/textSizeTitle" />
The question:
Did I use the tokens in the right way or there is another way to use the tokens?
Also, I know when I should use Display and Body, But when should I use Headline, Title, and Label because I think they are the same?
I read this and this but still don't know when should I use Headline, Title, and Label.
Thank you.