Skip to content

Commit

Permalink
Fixing reference in Typography sample (#207)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
3 people authored Feb 8, 2024
1 parent 864fd55 commit 9c71245
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ package com.example.compose.snippets.text
import android.util.Log
import androidx.compose.foundation.layout.Column
import androidx.compose.material.Text
import androidx.compose.material.Typography
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Typography
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.LaunchedEffect
Expand Down Expand Up @@ -118,16 +118,16 @@ fun DownloadableFontsText() {
private object TextDownloadableFontsSnippet4 {
// [START android_compose_text_typography_definition]
val MyTypography = Typography(
body1 = TextStyle(
labelMedium = TextStyle(
fontFamily = fontFamily, fontWeight = FontWeight.Normal, fontSize = 12.sp/*...*/
),
body2 = TextStyle(
labelLarge = TextStyle(
fontFamily = fontFamily,
fontWeight = FontWeight.Bold,
letterSpacing = 2.sp,
/*...*/
),
h4 = TextStyle(
displayMedium = TextStyle(
fontFamily = fontFamily, fontWeight = FontWeight.SemiBold/*...*/
),
/*...*/
Expand Down

0 comments on commit 9c71245

Please sign in to comment.