Use new SurfaceContainer color roles

Non-dynamic themes need to be updated

Co-authored-by: Ivan Iskandar <12537387+ivaniskandar@users.noreply.github.com>
(cherry picked from commit 1df87eabf2b301cf6fc60cfa5f9391756984b790)

# Conflicts:
#	app/src/main/java/eu/kanade/presentation/reader/ReaderPageActionsDialog.kt
This commit is contained in:
AntsyLich
2024-05-05 01:53:45 +06:00
committed by Jobobby04
parent 089d1aba57
commit 517fd3a8f4
10 changed files with 11 additions and 28 deletions
@@ -38,7 +38,6 @@ import androidx.compose.ui.input.nestedscroll.NestedScrollSource
import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.layout.onSizeChanged
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.IntOffset
import androidx.compose.ui.unit.Velocity
import androidx.compose.ui.unit.dp
@@ -53,7 +52,6 @@ private val sheetAnimationSpec = tween<Float>(durationMillis = 350)
@Composable
fun AdaptiveSheet(
isTabletUi: Boolean,
tonalElevation: Dp,
enableSwipeDismiss: Boolean,
onDismissRequest: () -> Unit,
modifier: Modifier = Modifier,
@@ -97,7 +95,7 @@ fun AdaptiveSheet(
.padding(vertical = 16.dp)
.then(modifier),
shape = MaterialTheme.shapes.extraLarge,
tonalElevation = tonalElevation,
color = MaterialTheme.colorScheme.surfaceContainerHigh,
content = {
BackHandler(enabled = alpha > 0f, onBack = internalOnDismissRequest)
content()
@@ -178,7 +176,7 @@ fun AdaptiveSheet(
.navigationBarsPadding()
.statusBarsPadding(),
shape = MaterialTheme.shapes.extraLarge,
tonalElevation = tonalElevation,
color = MaterialTheme.colorScheme.surfaceContainerHigh,
content = {
BackHandler(
enabled = anchoredDraggableState.targetValue == 0,
@@ -10,7 +10,6 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.TextUnit
import androidx.compose.ui.unit.dp
@@ -18,9 +17,8 @@ import androidx.compose.ui.unit.dp
fun Pill(
text: String,
modifier: Modifier = Modifier,
color: Color = MaterialTheme.colorScheme.background,
contentColor: Color = MaterialTheme.colorScheme.onBackground,
elevation: Dp = 1.dp,
color: Color = MaterialTheme.colorScheme.surfaceContainerHigh,
contentColor: Color = MaterialTheme.colorScheme.onSurface,
fontSize: TextUnit = LocalTextStyle.current.fontSize,
) {
Surface(
@@ -29,7 +27,6 @@ fun Pill(
shape = MaterialTheme.shapes.extraLarge,
color = color,
contentColor = contentColor,
tonalElevation = elevation,
) {
Box(
modifier = Modifier
@@ -100,7 +100,6 @@ fun Button(
val containerColor = colors.containerColor(enabled).value
val contentColor = colors.contentColor(enabled).value
val shadowElevation = elevation?.shadowElevation(enabled, interactionSource)?.value ?: 0.dp
val tonalElevation = elevation?.tonalElevation(enabled, interactionSource)?.value ?: 0.dp
Surface(
onClick = onClick,
@@ -109,7 +108,6 @@ fun Button(
shape = shape,
color = containerColor,
contentColor = contentColor,
tonalElevation = tonalElevation,
shadowElevation = shadowElevation,
border = border,
interactionSource = interactionSource,