Skip to content

Commit 9c71245

Browse files
arriolacjwill
andauthored
Fixing reference in Typography sample (#207)
* Fixed references in Typography sample. body1/body2/h4 don't exist in M3 Typography. The options are {display|headline|title|body|label}{Small|Medium|Large}. * Update TextDownloadableFontsSnippets.kt Typography should use m3 import. * Apply Spotless --------- Co-authored-by: James Williams <[email protected]> Co-authored-by: arriolac <[email protected]>
1 parent 864fd55 commit 9c71245

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

compose/snippets/src/main/java/com/example/compose/snippets/text/TextDownloadableFontsSnippets.kt

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ package com.example.compose.snippets.text
2121
import android.util.Log
2222
import androidx.compose.foundation.layout.Column
2323
import androidx.compose.material.Text
24-
import androidx.compose.material.Typography
2524
import androidx.compose.material3.MaterialTheme
25+
import androidx.compose.material3.Typography
2626
import androidx.compose.runtime.Composable
2727
import androidx.compose.runtime.CompositionLocalProvider
2828
import androidx.compose.runtime.LaunchedEffect
@@ -118,16 +118,16 @@ fun DownloadableFontsText() {
118118
private object TextDownloadableFontsSnippet4 {
119119
// [START android_compose_text_typography_definition]
120120
val MyTypography = Typography(
121-
body1 = TextStyle(
121+
labelMedium = TextStyle(
122122
fontFamily = fontFamily, fontWeight = FontWeight.Normal, fontSize = 12.sp/*...*/
123123
),
124-
body2 = TextStyle(
124+
labelLarge = TextStyle(
125125
fontFamily = fontFamily,
126126
fontWeight = FontWeight.Bold,
127127
letterSpacing = 2.sp,
128128
/*...*/
129129
),
130-
h4 = TextStyle(
130+
displayMedium = TextStyle(
131131
fontFamily = fontFamily, fontWeight = FontWeight.SemiBold/*...*/
132132
),
133133
/*...*/

0 commit comments

Comments
 (0)