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 91546f57f4..ee75baf941 100644 --- a/app/src/main/java/eu/kanade/presentation/manga/MangaScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/manga/MangaScreen.kt @@ -84,6 +84,7 @@ fun MangaScreen( state: MangaScreenModel.State.Success, snackbarHostState: SnackbarHostState, nextUpdate: Instant?, + isUpdateIntervalEnabled: Boolean, isTabletUi: Boolean, chapterSwipeStartAction: LibraryPreferences.ChapterSwipeAction, chapterSwipeEndAction: LibraryPreferences.ChapterSwipeAction, @@ -139,6 +140,7 @@ fun MangaScreen( state = state, snackbarHostState = snackbarHostState, nextUpdate = nextUpdate, + isUpdateIntervalEnabled = isUpdateIntervalEnabled, chapterSwipeStartAction = chapterSwipeStartAction, chapterSwipeEndAction = chapterSwipeEndAction, onBackClicked = onBackClicked, @@ -176,6 +178,7 @@ fun MangaScreen( chapterSwipeStartAction = chapterSwipeStartAction, chapterSwipeEndAction = chapterSwipeEndAction, nextUpdate = nextUpdate, + isUpdateIntervalEnabled = isUpdateIntervalEnabled, onBackClicked = onBackClicked, onChapterClicked = onChapterClicked, onDownloadChapter = onDownloadChapter, @@ -212,6 +215,7 @@ private fun MangaScreenSmallImpl( state: MangaScreenModel.State.Success, snackbarHostState: SnackbarHostState, nextUpdate: Instant?, + isUpdateIntervalEnabled: Boolean, chapterSwipeStartAction: LibraryPreferences.ChapterSwipeAction, chapterSwipeEndAction: LibraryPreferences.ChapterSwipeAction, onBackClicked: () -> Unit, @@ -400,6 +404,7 @@ private fun MangaScreenSmallImpl( favorite = state.manga.favorite, trackingCount = state.trackingCount, nextUpdate = nextUpdate, + isUpdateIntervalEnabled = isUpdateIntervalEnabled, isUserIntervalMode = state.manga.fetchInterval < 0, onAddToLibraryClicked = onAddToLibraryClicked, onWebViewClicked = onWebViewClicked, @@ -460,6 +465,7 @@ fun MangaScreenLargeImpl( state: MangaScreenModel.State.Success, snackbarHostState: SnackbarHostState, nextUpdate: Instant?, + isUpdateIntervalEnabled: Boolean, chapterSwipeStartAction: LibraryPreferences.ChapterSwipeAction, chapterSwipeEndAction: LibraryPreferences.ChapterSwipeAction, onBackClicked: () -> Unit, @@ -636,6 +642,7 @@ fun MangaScreenLargeImpl( favorite = state.manga.favorite, trackingCount = state.trackingCount, nextUpdate = nextUpdate, + isUpdateIntervalEnabled = isUpdateIntervalEnabled, isUserIntervalMode = state.manga.fetchInterval < 0, onAddToLibraryClicked = onAddToLibraryClicked, onWebViewClicked = onWebViewClicked, 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 f1b660626a..efa6c95dee 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 @@ -162,11 +162,13 @@ fun MangaInfoBox( } } +@Suppress("CyclomaticComplexMethod") @Composable fun MangaActionRow( favorite: Boolean, trackingCount: Int, nextUpdate: Instant?, + isUpdateIntervalEnabled: Boolean, isUserIntervalMode: Boolean, onAddToLibraryClicked: () -> Unit, onWebViewClicked: (() -> Unit)?, @@ -200,20 +202,22 @@ fun MangaActionRow( onClick = onAddToLibraryClicked, onLongClick = onEditCategory, ) - MangaActionButton( - title = when (nextUpdateDays) { - null -> stringResource(MR.strings.not_applicable) - 0 -> stringResource(MR.strings.manga_interval_expected_update_soon) - else -> pluralStringResource( - MR.plurals.day, - count = nextUpdateDays, - nextUpdateDays, - ) - }, - icon = Icons.Default.HourglassEmpty, - color = if (isUserIntervalMode) MaterialTheme.colorScheme.primary else defaultActionButtonColor, - onClick = { onEditIntervalClicked?.invoke() }, - ) + if (nextUpdateDays != null || isUpdateIntervalEnabled) { + MangaActionButton( + title = when (nextUpdateDays) { + null -> stringResource(MR.strings.not_applicable) + 0 -> stringResource(MR.strings.manga_interval_expected_update_soon) + else -> pluralStringResource( + MR.plurals.day, + count = nextUpdateDays, + nextUpdateDays, + ) + }, + icon = Icons.Default.HourglassEmpty, + color = if (isUserIntervalMode) MaterialTheme.colorScheme.primary else defaultActionButtonColor, + onClick = { onEditIntervalClicked?.invoke() }, + ) + } MangaActionButton( title = if (trackingCount == 0) { stringResource(MR.strings.manga_tracking_tab) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaScreen.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaScreen.kt index e500a04d37..7cc3ae7181 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaScreen.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaScreen.kt @@ -113,6 +113,7 @@ class MangaScreen( state = successState, snackbarHostState = screenModel.snackbarHostState, nextUpdate = successState.manga.expectedNextUpdate, + isUpdateIntervalEnabled = screenModel.isUpdateIntervalEnabled, isTabletUi = isTabletUi(), chapterSwipeStartAction = screenModel.chapterSwipeStartAction, chapterSwipeEndAction = screenModel.chapterSwipeEndAction,