From ebb96a6ff46230686fa260e96917bdb7de3ec288 Mon Sep 17 00:00:00 2001 From: zbue <108109611+zbue@users.noreply.github.com> Date: Tue, 1 Nov 2022 05:20:31 +0800 Subject: [PATCH] Use `selectedBackground` for other list items to match with others (#8379) * Use `selectedBackground` for other list items to match with others * Remove unused imports --- .../presentation/manga/components/MangaChapterListItem.kt | 5 ++--- .../java/eu/kanade/presentation/updates/UpdatesUiItem.kt | 5 ++--- 2 files changed, 4 insertions(+), 6 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 d07a74d9dc..33ca32055e 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 @@ -1,6 +1,5 @@ package eu.kanade.presentation.manga.components -import androidx.compose.foundation.background import androidx.compose.foundation.combinedClickable import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row @@ -23,7 +22,6 @@ 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.graphics.Color import androidx.compose.ui.platform.LocalDensity import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextOverflow @@ -33,6 +31,7 @@ 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.presentation.util.selectedBackground import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.download.model.Download @@ -55,7 +54,7 @@ fun MangaChapterListItem( ) { Row( modifier = modifier - .background(if (selected) MaterialTheme.colorScheme.surfaceVariant else Color.Transparent) + .selectedBackground(selected) .combinedClickable( onClick = onClick, onLongClick = onLongClick, diff --git a/app/src/main/java/eu/kanade/presentation/updates/UpdatesUiItem.kt b/app/src/main/java/eu/kanade/presentation/updates/UpdatesUiItem.kt index b339d026d0..c4a2d666f1 100644 --- a/app/src/main/java/eu/kanade/presentation/updates/UpdatesUiItem.kt +++ b/app/src/main/java/eu/kanade/presentation/updates/UpdatesUiItem.kt @@ -1,7 +1,6 @@ package eu.kanade.presentation.updates import android.text.format.DateUtils -import androidx.compose.foundation.background import androidx.compose.foundation.combinedClickable import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column @@ -28,7 +27,6 @@ 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.graphics.Color import androidx.compose.ui.hapticfeedback.HapticFeedbackType import androidx.compose.ui.platform.LocalDensity import androidx.compose.ui.platform.LocalHapticFeedback @@ -43,6 +41,7 @@ import eu.kanade.presentation.components.MangaCover import eu.kanade.presentation.components.RelativeDateHeader import eu.kanade.presentation.util.ReadItemAlpha import eu.kanade.presentation.util.horizontalPadding +import eu.kanade.presentation.util.selectedBackground import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.download.model.Download import eu.kanade.tachiyomi.ui.recent.updates.UpdatesItem @@ -161,7 +160,7 @@ fun UpdatesUiItem( val haptic = LocalHapticFeedback.current Row( modifier = modifier - .background(if (selected) MaterialTheme.colorScheme.surfaceVariant else Color.Transparent) + .selectedBackground(selected) .combinedClickable( onClick = onClick, onLongClick = {