From 47e544b710c1d9337a52dd8fbd5401903a14059a Mon Sep 17 00:00:00 2001 From: arkon Date: Sun, 10 Dec 2023 10:51:50 -0500 Subject: [PATCH] Fix next local chapter not being indicated as downloaded in transition --- .../manga/components/MangaInfoHeader.kt | 13 ++++++++----- .../ui/reader/viewer/ReaderTransitionView.kt | 3 ++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/eu/kanade/presentation/manga/components/MangaInfoHeader.kt b/app/src/main/java/eu/kanade/presentation/manga/components/MangaInfoHeader.kt index 01a94057a8..e844e8d943 100644 --- a/app/src/main/java/eu/kanade/presentation/manga/components/MangaInfoHeader.kt +++ b/app/src/main/java/eu/kanade/presentation/manga/components/MangaInfoHeader.kt @@ -92,7 +92,6 @@ private val whitespaceLineRegex = Regex("[\\r\\n]{2,}", setOf(RegexOption.MULTIL @Composable fun MangaInfoBox( - modifier: Modifier = Modifier, isTabletUi: Boolean, appBarPadding: Dp, title: String, @@ -104,6 +103,7 @@ fun MangaInfoBox( status: Long, onCoverClick: () -> Unit, doSearch: (query: String, global: Boolean) -> Unit, + modifier: Modifier = Modifier, ) { Box(modifier = modifier) { // Backdrop @@ -162,7 +162,6 @@ fun MangaInfoBox( @Composable fun MangaActionRow( - modifier: Modifier = Modifier, favorite: Boolean, trackingCount: Int, fetchInterval: Int?, @@ -173,6 +172,7 @@ fun MangaActionRow( onTrackingClicked: (() -> Unit)?, onEditIntervalClicked: (() -> Unit)?, onEditCategory: (() -> Unit)?, + modifier: Modifier = Modifier, ) { val defaultActionButtonColor = MaterialTheme.colorScheme.onSurface.copy(alpha = .38f) @@ -226,12 +226,12 @@ fun MangaActionRow( @Composable fun ExpandableMangaDescription( - modifier: Modifier = Modifier, defaultExpandState: Boolean, description: String?, tagsProvider: () -> List?, onTagSearch: (String) -> Unit, onCopyTagToClipboard: (tag: String) -> Unit, + modifier: Modifier = Modifier, ) { Column(modifier = modifier) { val (expanded, onExpanded) = rememberSaveable { @@ -406,13 +406,13 @@ private fun MangaAndSourceTitlesSmall( @Composable private fun MangaContentInfo( title: String, - textAlign: TextAlign? = LocalTextStyle.current.textAlign, doSearch: (query: String, global: Boolean) -> Unit, author: String?, artist: String?, status: Long, sourceName: String, isStubSource: Boolean, + textAlign: TextAlign? = LocalTextStyle.current.textAlign, ) { val context = LocalContext.current Text( @@ -556,7 +556,10 @@ private fun MangaSummary( expanded: Boolean, modifier: Modifier = Modifier, ) { - val animProgress by animateFloatAsState(if (expanded) 1f else 0f) + val animProgress by animateFloatAsState( + targetValue = if (expanded) 1f else 0f, + label = "summary", + ) Layout( modifier = modifier.clipToBounds(), contents = listOf( diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/ReaderTransitionView.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/ReaderTransitionView.kt index 295772c43d..737b3633be 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/ReaderTransitionView.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/ReaderTransitionView.kt @@ -16,6 +16,7 @@ import eu.kanade.presentation.theme.TachiyomiTheme import eu.kanade.tachiyomi.data.download.DownloadManager import eu.kanade.tachiyomi.ui.reader.model.ChapterTransition import tachiyomi.domain.manga.model.Manga +import tachiyomi.source.local.isLocal class ReaderTransitionView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) : AbstractComposeView(context, attrs) { @@ -31,7 +32,7 @@ class ReaderTransitionView @JvmOverloads constructor(context: Context, attrs: At Data( transition = transition, currChapterDownloaded = transition.from.pageLoader?.isLocal == true, - goingToChapterDownloaded = transition.to?.chapter?.let { goingToChapter -> + goingToChapterDownloaded = manga.isLocal() || transition.to?.chapter?.let { goingToChapter -> downloadManager.isChapterDownloaded( chapterName = goingToChapter.name, chapterScanlator = goingToChapter.scanlator,