From fca4f251227f983d8313eda546f35644692f39cb Mon Sep 17 00:00:00 2001 From: arkon Date: Tue, 26 Dec 2023 17:11:26 -0500 Subject: [PATCH] Always show chapter download indicators - Local chapters are just always "downloaded", but you can't delete them from the app - Unavailable sources show proper state so long as it's stubbed with the name still, but you can't download anything new --- .../eu/kanade/presentation/manga/MangaScreen.kt | 5 +++-- .../manga/components/MangaChapterListItem.kt | 16 +++++++--------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/eu/kanade/presentation/manga/MangaScreen.kt b/app/src/main/java/eu/kanade/presentation/manga/MangaScreen.kt index 18fbbc3f51..69690ac5f5 100644 --- a/app/src/main/java/eu/kanade/presentation/manga/MangaScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/manga/MangaScreen.kt @@ -77,6 +77,7 @@ import tachiyomi.presentation.core.components.material.Scaffold import tachiyomi.presentation.core.i18n.stringResource import tachiyomi.presentation.core.util.isScrolledToEnd import tachiyomi.presentation.core.util.isScrollingUp +import tachiyomi.source.local.isLocal import java.text.DateFormat import java.util.Date @@ -718,13 +719,13 @@ fun MangaScreenLargeImpl( @Composable private fun SharedMangaBottomActionMenu( selected: List, - modifier: Modifier = Modifier, onMultiBookmarkClicked: (List, bookmarked: Boolean) -> Unit, onMultiMarkAsReadClicked: (List, markAsRead: Boolean) -> Unit, onMarkPreviousAsReadClicked: (Chapter) -> Unit, onDownloadChapter: ((List, ChapterDownloadAction) -> Unit)?, onMultiDeleteClicked: (List) -> Unit, fillFraction: Float, + modifier: Modifier = Modifier, ) { MangaBottomActionMenu( visible = selected.isNotEmpty(), @@ -818,7 +819,7 @@ private fun LazyListScope.sharedChapterItems( read = item.chapter.read, bookmark = item.chapter.bookmark, selected = item.selected, - downloadIndicatorEnabled = !isAnyChapterSelected, + downloadIndicatorEnabled = !isAnyChapterSelected && !manga.isLocal(), downloadStateProvider = { item.downloadState }, downloadProgressProvider = { item.downloadProgress }, chapterSwipeStartAction = chapterSwipeStartAction, 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 b14d2ed14f..9c9f07c1a4 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 @@ -203,15 +203,13 @@ fun MangaChapterListItem( } } - if (onDownloadClick != null) { - ChapterDownloadIndicator( - enabled = downloadIndicatorEnabled, - modifier = Modifier.padding(start = 4.dp), - downloadStateProvider = downloadStateProvider, - downloadProgressProvider = downloadProgressProvider, - onClick = onDownloadClick, - ) - } + ChapterDownloadIndicator( + enabled = downloadIndicatorEnabled, + modifier = Modifier.padding(start = 4.dp), + downloadStateProvider = downloadStateProvider, + downloadProgressProvider = downloadProgressProvider, + onClick = { onDownloadClick?.invoke(it) }, + ) } } }