fix(app): Fix next local chapter not being indicated as downloaded in transition

This commit is contained in:
arkon 2023-12-10 10:51:50 -05:00 committed by Claudemirovsky
parent 96d43f69fa
commit 6450eb775f
No known key found for this signature in database
GPG key ID: 82AE76162407356E
2 changed files with 10 additions and 6 deletions

View file

@ -94,7 +94,6 @@ private val whitespaceLineRegex = Regex("[\\r\\n]{2,}", setOf(RegexOption.MULTIL
@Composable
fun MangaInfoBox(
modifier: Modifier = Modifier,
isTabletUi: Boolean,
appBarPadding: Dp,
title: String,
@ -106,6 +105,7 @@ fun MangaInfoBox(
status: Long,
onCoverClick: () -> Unit,
doSearch: (query: String, global: Boolean) -> Unit,
modifier: Modifier = Modifier,
) {
Box(modifier = modifier) {
// Backdrop
@ -164,7 +164,6 @@ fun MangaInfoBox(
@Composable
fun MangaActionRow(
modifier: Modifier = Modifier,
favorite: Boolean,
trackingCount: Int,
fetchInterval: Int?,
@ -175,6 +174,7 @@ fun MangaActionRow(
onTrackingClicked: (() -> Unit)?,
onEditIntervalClicked: (() -> Unit)?,
onEditCategory: (() -> Unit)?,
modifier: Modifier = Modifier,
) {
val defaultActionButtonColor = MaterialTheme.colorScheme.onSurface.copy(alpha = .38f)
@ -232,12 +232,12 @@ fun MangaActionRow(
@Composable
fun ExpandableMangaDescription(
modifier: Modifier = Modifier,
defaultExpandState: Boolean,
description: String?,
tagsProvider: () -> List<String>?,
onTagSearch: (String) -> Unit,
onCopyTagToClipboard: (tag: String) -> Unit,
modifier: Modifier = Modifier,
) {
Column(modifier = modifier) {
val (expanded, onExpanded) = rememberSaveable {
@ -414,13 +414,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(
@ -564,7 +564,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(

View file

@ -16,6 +16,7 @@ import eu.kanade.presentation.theme.TachiyomiTheme
import eu.kanade.tachiyomi.data.download.manga.MangaDownloadManager
import eu.kanade.tachiyomi.ui.reader.model.ChapterTransition
import tachiyomi.domain.entries.manga.model.Manga
import tachiyomi.source.local.entries.manga.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,