From 04d2a3399b4c1e708e8da2a7bf7bfd0ec4ecb77a Mon Sep 17 00:00:00 2001 From: Soitora Date: Sun, 30 Oct 2022 03:58:18 +0100 Subject: [PATCH] Restore chapter description alpha (#8345) Restore "Darken the description colors" Restores #3858, with new values based on current standards (0.78f rather than 0.62f) I wanted to accomplish this without having to call a const, but that felt like a logical solution as well Of course, if you got cleaner methods do tell, thanks --- .../presentation/manga/components/MangaChapterListItem.kt | 4 +++- app/src/main/java/eu/kanade/presentation/util/Constants.kt | 1 + app/src/main/java/eu/kanade/presentation/util/Modifier.kt | 2 +- 3 files changed, 5 insertions(+), 2 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 0c491a78f..3a0760a28 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 @@ -32,6 +32,7 @@ import androidx.compose.ui.unit.sp import eu.kanade.presentation.components.ChapterDownloadAction import eu.kanade.presentation.components.ChapterDownloadIndicator import eu.kanade.presentation.util.ReadItemAlpha +import eu.kanade.presentation.util.SecondaryItemAlpha import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.download.model.Download @@ -67,6 +68,7 @@ fun MangaChapterListItem( MaterialTheme.colorScheme.onSurface } val textAlpha = remember(read) { if (read) ReadItemAlpha else 1f } + val textSubtitleAlpha = remember(read) { if (read) ReadItemAlpha else SecondaryItemAlpha } Row(verticalAlignment = Alignment.CenterVertically) { var textHeight by remember { mutableStateOf(0) } @@ -91,7 +93,7 @@ fun MangaChapterListItem( ) } Spacer(modifier = Modifier.height(6.dp)) - Row(modifier = Modifier.alpha(textAlpha)) { + Row(modifier = Modifier.alpha(textSubtitleAlpha)) { ProvideTextStyle( value = MaterialTheme.typography.bodyMedium .copy(color = textColor, fontSize = 12.sp), diff --git a/app/src/main/java/eu/kanade/presentation/util/Constants.kt b/app/src/main/java/eu/kanade/presentation/util/Constants.kt index 7790dd80b..25ec0dc53 100644 --- a/app/src/main/java/eu/kanade/presentation/util/Constants.kt +++ b/app/src/main/java/eu/kanade/presentation/util/Constants.kt @@ -12,3 +12,4 @@ val verticalPadding = vertical val topPaddingValues = PaddingValues(top = vertical) const val ReadItemAlpha = .38f +const val SecondaryItemAlpha = .78f diff --git a/app/src/main/java/eu/kanade/presentation/util/Modifier.kt b/app/src/main/java/eu/kanade/presentation/util/Modifier.kt index d3ab2c473..e1c5b8725 100644 --- a/app/src/main/java/eu/kanade/presentation/util/Modifier.kt +++ b/app/src/main/java/eu/kanade/presentation/util/Modifier.kt @@ -29,7 +29,7 @@ fun Modifier.selectedBackground(isSelected: Boolean): Modifier = composed { } } -fun Modifier.secondaryItemAlpha(): Modifier = this.alpha(.78f) +fun Modifier.secondaryItemAlpha(): Modifier = this.alpha(SecondaryItemAlpha) fun Modifier.clickableNoIndication( onLongClick: (() -> Unit)? = null,