From 020a5dc239ed706e6bbefbfffb35db031aed644b Mon Sep 17 00:00:00 2001 From: machiav3lli Date: Sat, 26 Feb 2022 03:09:51 +0100 Subject: [PATCH] Fix: Text coloring under MDC --- .../com/looker/droidify/ui/compose/Items.kt | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/src/main/kotlin/com/looker/droidify/ui/compose/Items.kt b/src/main/kotlin/com/looker/droidify/ui/compose/Items.kt index a39ccdac..4b1e6673 100644 --- a/src/main/kotlin/com/looker/droidify/ui/compose/Items.kt +++ b/src/main/kotlin/com/looker/droidify/ui/compose/Items.kt @@ -4,14 +4,15 @@ import androidx.compose.foundation.background import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.* import androidx.compose.foundation.shape.RoundedCornerShape -import androidx.compose.material.ContentAlpha -import androidx.compose.material.LocalContentAlpha import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.Favorite import androidx.compose.material.icons.filled.FavoriteBorder import androidx.compose.material3.* import androidx.compose.material3.ButtonDefaults.buttonColors -import androidx.compose.runtime.* +import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip @@ -83,15 +84,14 @@ fun ProductRow( style = MaterialTheme.typography.bodySmall ) } - CompositionLocalProvider(LocalContentAlpha provides ContentAlpha.medium) { - Text( - modifier = Modifier.fillMaxHeight(), - text = item.summary, - style = MaterialTheme.typography.bodySmall, - overflow = TextOverflow.Ellipsis, - maxLines = 2 - ) - } + Text( + modifier = Modifier.fillMaxHeight(), + text = item.summary, + style = MaterialTheme.typography.bodySmall, + overflow = TextOverflow.Ellipsis, + maxLines = 2, + color = MaterialTheme.colorScheme.onSurfaceVariant + ) } } } @@ -136,17 +136,17 @@ fun ProductColumn( text = item.name, style = MaterialTheme.typography.bodySmall, overflow = TextOverflow.Ellipsis, - maxLines = 1 + maxLines = 1, + color = MaterialTheme.colorScheme.onSurface + ) + Text( + modifier = Modifier.padding(4.dp, 1.dp), + text = item.version, + style = MaterialTheme.typography.labelSmall, + overflow = TextOverflow.Ellipsis, + maxLines = 1, + color = MaterialTheme.colorScheme.onSurfaceVariant ) - CompositionLocalProvider(LocalContentAlpha provides ContentAlpha.medium) { - Text( - modifier = Modifier.padding(4.dp, 1.dp), - text = item.version, - style = MaterialTheme.typography.labelSmall, - overflow = TextOverflow.Ellipsis, - maxLines = 1 - ) - } } }