Fix: Text coloring under MDC

This commit is contained in:
machiav3lli 2022-02-26 03:09:51 +01:00
parent 6a6958b7c3
commit 020a5dc239

View File

@ -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,19 +84,18 @@ 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
maxLines = 2,
color = MaterialTheme.colorScheme.onSurfaceVariant
)
}
}
}
}
}
@Composable
fun ProductColumn(
@ -136,19 +136,19 @@ fun ProductColumn(
text = item.name,
style = MaterialTheme.typography.bodySmall,
overflow = TextOverflow.Ellipsis,
maxLines = 1
maxLines = 1,
color = MaterialTheme.colorScheme.onSurface
)
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
maxLines = 1,
color = MaterialTheme.colorScheme.onSurfaceVariant
)
}
}
}
@Composable
fun ExpandedItemContent(