From 15d999229fcce865001d5fa77d0163e6e80e38db Mon Sep 17 00:00:00 2001 From: AntsyLich <59261191+AntsyLich@users.noreply.github.com> Date: Fri, 7 Jun 2024 04:30:17 +0600 Subject: [PATCH] MangaChapterListItem: Don't use alpha modifier Possibly fixes #822 Co-authored-by: Ivan Iskandar <12537387+ivaniskandar@users.noreply.github.com> --- .../manga/components/MangaChapterListItem.kt | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/eu/kanade/presentation/manga/components/MangaChapterListItem.kt b/app/src/main/java/eu/kanade/presentation/manga/components/MangaChapterListItem.kt index 12720957eb..6f323993c5 100644 --- a/app/src/main/java/eu/kanade/presentation/manga/components/MangaChapterListItem.kt +++ b/app/src/main/java/eu/kanade/presentation/manga/components/MangaChapterListItem.kt @@ -30,7 +30,6 @@ import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.draw.alpha import androidx.compose.ui.draw.clipToBounds import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.vector.ImageVector @@ -66,9 +65,6 @@ fun MangaChapterListItem( onChapterSwipe: (LibraryPreferences.ChapterSwipeAction) -> Unit, modifier: Modifier = Modifier, ) { - val textAlpha = if (read) ReadItemAlpha else 1f - val textSubtitleAlpha = if (read) ReadItemAlpha else SecondaryItemAlpha - val start = getSwipeAction( action = chapterSwipeStartAction, read = read, @@ -133,15 +129,20 @@ fun MangaChapterListItem( Text( text = title, style = MaterialTheme.typography.bodyMedium, - color = LocalContentColor.current.copy(alpha = textAlpha), maxLines = 1, overflow = TextOverflow.Ellipsis, onTextLayout = { textHeight = it.size.height }, + color = LocalContentColor.current.copy(alpha = if (read) ReadItemAlpha else 1f), ) } - Row(modifier = Modifier.alpha(textSubtitleAlpha)) { - ProvideTextStyle(value = MaterialTheme.typography.bodySmall) { + Row { + val subtitleStyle = MaterialTheme.typography.bodySmall + .merge( + color = LocalContentColor.current + .copy(alpha = if (read) ReadItemAlpha else SecondaryItemAlpha) + ) + ProvideTextStyle(value = subtitleStyle) { if (date != null) { Text( text = date,