From b7e091d5d039e00cababc7daf555280df6cf9c03 Mon Sep 17 00:00:00 2001 From: AntsyLich <59261191+AntsyLich@users.noreply.github.com> Date: Sun, 3 Mar 2024 05:16:35 +0600 Subject: [PATCH] Small cleanup --- .../manga/components/ChapterDownloadIndicator.kt | 12 ++++-------- .../manga/components/MangaChapterListItem.kt | 11 +++-------- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/app/src/main/java/eu/kanade/presentation/manga/components/ChapterDownloadIndicator.kt b/app/src/main/java/eu/kanade/presentation/manga/components/ChapterDownloadIndicator.kt index 3066fe5ed1..85b54eac02 100644 --- a/app/src/main/java/eu/kanade/presentation/manga/components/ChapterDownloadIndicator.kt +++ b/app/src/main/java/eu/kanade/presentation/manga/components/ChapterDownloadIndicator.kt @@ -85,13 +85,12 @@ private fun NotDownloadedIndicator( modifier: Modifier = Modifier, onClick: (ChapterDownloadAction) -> Unit, ) { - val hapticFeedback = LocalHapticFeedback.current Box( modifier = modifier .size(IconButtonTokens.StateLayerSize) .commonClickable( enabled = enabled, - hapticFeedback = hapticFeedback, + hapticFeedback = LocalHapticFeedback.current, onLongClick = { onClick(ChapterDownloadAction.START_NOW) }, onClick = { onClick(ChapterDownloadAction.START) }, ) @@ -115,14 +114,13 @@ private fun DownloadingIndicator( onClick: (ChapterDownloadAction) -> Unit, modifier: Modifier = Modifier, ) { - val hapticFeedback = LocalHapticFeedback.current var isMenuExpanded by remember { mutableStateOf(false) } Box( modifier = modifier .size(IconButtonTokens.StateLayerSize) .commonClickable( enabled = enabled, - hapticFeedback = hapticFeedback, + hapticFeedback = LocalHapticFeedback.current, onLongClick = { onClick(ChapterDownloadAction.CANCEL) }, onClick = { isMenuExpanded = true }, ), @@ -189,14 +187,13 @@ private fun DownloadedIndicator( modifier: Modifier = Modifier, onClick: (ChapterDownloadAction) -> Unit, ) { - val hapticFeedback = LocalHapticFeedback.current var isMenuExpanded by remember { mutableStateOf(false) } Box( modifier = modifier .size(IconButtonTokens.StateLayerSize) .commonClickable( enabled = enabled, - hapticFeedback = hapticFeedback, + hapticFeedback = LocalHapticFeedback.current, onLongClick = { isMenuExpanded = true }, onClick = { isMenuExpanded = true }, ), @@ -226,13 +223,12 @@ private fun ErrorIndicator( modifier: Modifier = Modifier, onClick: (ChapterDownloadAction) -> Unit, ) { - val hapticFeedback = LocalHapticFeedback.current Box( modifier = modifier .size(IconButtonTokens.StateLayerSize) .commonClickable( enabled = enabled, - hapticFeedback = hapticFeedback, + hapticFeedback = LocalHapticFeedback.current, onLongClick = { onClick(ChapterDownloadAction.START) }, onClick = { onClick(ChapterDownloadAction.START) }, ), 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 5054787150..12720957eb 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,13 +30,13 @@ 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 import androidx.compose.ui.platform.LocalDensity import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.dp -import androidx.compose.ui.unit.sp import eu.kanade.tachiyomi.data.download.model.Download import me.saket.swipe.SwipeableActionsBox import tachiyomi.domain.library.service.LibraryPreferences @@ -140,13 +140,8 @@ fun MangaChapterListItem( ) } - Row { - ProvideTextStyle( - value = MaterialTheme.typography.bodyMedium.copy( - fontSize = 12.sp, - color = LocalContentColor.current.copy(alpha = textSubtitleAlpha), - ), - ) { + Row(modifier = Modifier.alpha(textSubtitleAlpha)) { + ProvideTextStyle(value = MaterialTheme.typography.bodySmall) { if (date != null) { Text( text = date,