From dedb87185355aba8cda3711ffb4e2fe32b600d9b Mon Sep 17 00:00:00 2001 From: Lauren Ward Date: Tue, 18 Aug 2026 14:21:49 -0600 Subject: [PATCH] Updating snippets on Compose architectural layering page to use Material 3 --- .../architecture/ArchitectureLayering.kt | 28 +++++++++---------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/compose/snippets/src/main/java/com/example/compose/snippets/architecture/ArchitectureLayering.kt b/compose/snippets/src/main/java/com/example/compose/snippets/architecture/ArchitectureLayering.kt index 9113a507f..d4680ae1e 100644 --- a/compose/snippets/src/main/java/com/example/compose/snippets/architecture/ArchitectureLayering.kt +++ b/compose/snippets/src/main/java/com/example/compose/snippets/architecture/ArchitectureLayering.kt @@ -22,11 +22,10 @@ import androidx.compose.foundation.background import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.RowScope -import androidx.compose.material.MaterialTheme -import androidx.compose.material.ProvideTextStyle +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.ProvideTextStyle import androidx.compose.material3.Surface import androidx.compose.runtime.Composable -import androidx.compose.runtime.CompositionLocalProvider import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.remember import androidx.compose.ui.Modifier @@ -56,14 +55,15 @@ fun Button( // … content: @Composable RowScope.() -> Unit ) { - Surface(/* … */) { - CompositionLocalProvider(/* … */) { // set LocalContentAlpha - ProvideTextStyle(MaterialTheme.typography.button) { - Row( - // … - content = content - ) - } + Surface( + // … + contentColor = Color.Unspecified // placeholder + ) { + ProvideTextStyle(MaterialTheme.typography.labelLarge) { + Row( + // … + content = content + ) } } } @@ -85,10 +85,8 @@ fun GradientButton( Brush.horizontalGradient(background) ) ) { - CompositionLocalProvider(/* … */) { // set material LocalContentAlpha - ProvideTextStyle(MaterialTheme.typography.button) { - content() - } + ProvideTextStyle(MaterialTheme.typography.labelLarge) { + content() } } }