mirror of
https://github.com/mihonapp/mihon.git
synced 2024-12-27 11:28:23 +01:00
Merge 3d8f6dd310
into 47b0e9d7be
This commit is contained in:
commit
9584bb0eb2
@ -84,6 +84,7 @@ fun MangaScreen(
|
|||||||
state: MangaScreenModel.State.Success,
|
state: MangaScreenModel.State.Success,
|
||||||
snackbarHostState: SnackbarHostState,
|
snackbarHostState: SnackbarHostState,
|
||||||
nextUpdate: Instant?,
|
nextUpdate: Instant?,
|
||||||
|
isUpdateIntervalEnabled: Boolean,
|
||||||
isTabletUi: Boolean,
|
isTabletUi: Boolean,
|
||||||
chapterSwipeStartAction: LibraryPreferences.ChapterSwipeAction,
|
chapterSwipeStartAction: LibraryPreferences.ChapterSwipeAction,
|
||||||
chapterSwipeEndAction: LibraryPreferences.ChapterSwipeAction,
|
chapterSwipeEndAction: LibraryPreferences.ChapterSwipeAction,
|
||||||
@ -139,6 +140,7 @@ fun MangaScreen(
|
|||||||
state = state,
|
state = state,
|
||||||
snackbarHostState = snackbarHostState,
|
snackbarHostState = snackbarHostState,
|
||||||
nextUpdate = nextUpdate,
|
nextUpdate = nextUpdate,
|
||||||
|
isUpdateIntervalEnabled = isUpdateIntervalEnabled,
|
||||||
chapterSwipeStartAction = chapterSwipeStartAction,
|
chapterSwipeStartAction = chapterSwipeStartAction,
|
||||||
chapterSwipeEndAction = chapterSwipeEndAction,
|
chapterSwipeEndAction = chapterSwipeEndAction,
|
||||||
onBackClicked = onBackClicked,
|
onBackClicked = onBackClicked,
|
||||||
@ -176,6 +178,7 @@ fun MangaScreen(
|
|||||||
chapterSwipeStartAction = chapterSwipeStartAction,
|
chapterSwipeStartAction = chapterSwipeStartAction,
|
||||||
chapterSwipeEndAction = chapterSwipeEndAction,
|
chapterSwipeEndAction = chapterSwipeEndAction,
|
||||||
nextUpdate = nextUpdate,
|
nextUpdate = nextUpdate,
|
||||||
|
isUpdateIntervalEnabled = isUpdateIntervalEnabled,
|
||||||
onBackClicked = onBackClicked,
|
onBackClicked = onBackClicked,
|
||||||
onChapterClicked = onChapterClicked,
|
onChapterClicked = onChapterClicked,
|
||||||
onDownloadChapter = onDownloadChapter,
|
onDownloadChapter = onDownloadChapter,
|
||||||
@ -212,6 +215,7 @@ private fun MangaScreenSmallImpl(
|
|||||||
state: MangaScreenModel.State.Success,
|
state: MangaScreenModel.State.Success,
|
||||||
snackbarHostState: SnackbarHostState,
|
snackbarHostState: SnackbarHostState,
|
||||||
nextUpdate: Instant?,
|
nextUpdate: Instant?,
|
||||||
|
isUpdateIntervalEnabled: Boolean,
|
||||||
chapterSwipeStartAction: LibraryPreferences.ChapterSwipeAction,
|
chapterSwipeStartAction: LibraryPreferences.ChapterSwipeAction,
|
||||||
chapterSwipeEndAction: LibraryPreferences.ChapterSwipeAction,
|
chapterSwipeEndAction: LibraryPreferences.ChapterSwipeAction,
|
||||||
onBackClicked: () -> Unit,
|
onBackClicked: () -> Unit,
|
||||||
@ -396,6 +400,7 @@ private fun MangaScreenSmallImpl(
|
|||||||
favorite = state.manga.favorite,
|
favorite = state.manga.favorite,
|
||||||
trackingCount = state.trackingCount,
|
trackingCount = state.trackingCount,
|
||||||
nextUpdate = nextUpdate,
|
nextUpdate = nextUpdate,
|
||||||
|
isUpdateIntervalEnabled = isUpdateIntervalEnabled,
|
||||||
isUserIntervalMode = state.manga.fetchInterval < 0,
|
isUserIntervalMode = state.manga.fetchInterval < 0,
|
||||||
onAddToLibraryClicked = onAddToLibraryClicked,
|
onAddToLibraryClicked = onAddToLibraryClicked,
|
||||||
onWebViewClicked = onWebViewClicked,
|
onWebViewClicked = onWebViewClicked,
|
||||||
@ -456,6 +461,7 @@ fun MangaScreenLargeImpl(
|
|||||||
state: MangaScreenModel.State.Success,
|
state: MangaScreenModel.State.Success,
|
||||||
snackbarHostState: SnackbarHostState,
|
snackbarHostState: SnackbarHostState,
|
||||||
nextUpdate: Instant?,
|
nextUpdate: Instant?,
|
||||||
|
isUpdateIntervalEnabled: Boolean,
|
||||||
chapterSwipeStartAction: LibraryPreferences.ChapterSwipeAction,
|
chapterSwipeStartAction: LibraryPreferences.ChapterSwipeAction,
|
||||||
chapterSwipeEndAction: LibraryPreferences.ChapterSwipeAction,
|
chapterSwipeEndAction: LibraryPreferences.ChapterSwipeAction,
|
||||||
onBackClicked: () -> Unit,
|
onBackClicked: () -> Unit,
|
||||||
@ -628,6 +634,7 @@ fun MangaScreenLargeImpl(
|
|||||||
favorite = state.manga.favorite,
|
favorite = state.manga.favorite,
|
||||||
trackingCount = state.trackingCount,
|
trackingCount = state.trackingCount,
|
||||||
nextUpdate = nextUpdate,
|
nextUpdate = nextUpdate,
|
||||||
|
isUpdateIntervalEnabled = isUpdateIntervalEnabled,
|
||||||
isUserIntervalMode = state.manga.fetchInterval < 0,
|
isUserIntervalMode = state.manga.fetchInterval < 0,
|
||||||
onAddToLibraryClicked = onAddToLibraryClicked,
|
onAddToLibraryClicked = onAddToLibraryClicked,
|
||||||
onWebViewClicked = onWebViewClicked,
|
onWebViewClicked = onWebViewClicked,
|
||||||
|
@ -157,11 +157,13 @@ fun MangaInfoBox(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Suppress("CyclomaticComplexMethod")
|
||||||
@Composable
|
@Composable
|
||||||
fun MangaActionRow(
|
fun MangaActionRow(
|
||||||
favorite: Boolean,
|
favorite: Boolean,
|
||||||
trackingCount: Int,
|
trackingCount: Int,
|
||||||
nextUpdate: Instant?,
|
nextUpdate: Instant?,
|
||||||
|
isUpdateIntervalEnabled: Boolean,
|
||||||
isUserIntervalMode: Boolean,
|
isUserIntervalMode: Boolean,
|
||||||
onAddToLibraryClicked: () -> Unit,
|
onAddToLibraryClicked: () -> Unit,
|
||||||
onWebViewClicked: (() -> Unit)?,
|
onWebViewClicked: (() -> Unit)?,
|
||||||
@ -195,20 +197,22 @@ fun MangaActionRow(
|
|||||||
onClick = onAddToLibraryClicked,
|
onClick = onAddToLibraryClicked,
|
||||||
onLongClick = onEditCategory,
|
onLongClick = onEditCategory,
|
||||||
)
|
)
|
||||||
MangaActionButton(
|
if (nextUpdateDays != null || isUpdateIntervalEnabled) {
|
||||||
title = when (nextUpdateDays) {
|
MangaActionButton(
|
||||||
null -> stringResource(MR.strings.not_applicable)
|
title = when (nextUpdateDays) {
|
||||||
0 -> stringResource(MR.strings.manga_interval_expected_update_soon)
|
null -> stringResource(MR.strings.not_applicable)
|
||||||
else -> pluralStringResource(
|
0 -> stringResource(MR.strings.manga_interval_expected_update_soon)
|
||||||
MR.plurals.day,
|
else -> pluralStringResource(
|
||||||
count = nextUpdateDays,
|
MR.plurals.day,
|
||||||
nextUpdateDays,
|
count = nextUpdateDays,
|
||||||
)
|
nextUpdateDays,
|
||||||
},
|
)
|
||||||
icon = Icons.Default.HourglassEmpty,
|
},
|
||||||
color = if (isUserIntervalMode) MaterialTheme.colorScheme.primary else defaultActionButtonColor,
|
icon = Icons.Default.HourglassEmpty,
|
||||||
onClick = { onEditIntervalClicked?.invoke() },
|
color = if (isUserIntervalMode) MaterialTheme.colorScheme.primary else defaultActionButtonColor,
|
||||||
)
|
onClick = { onEditIntervalClicked?.invoke() },
|
||||||
|
)
|
||||||
|
}
|
||||||
MangaActionButton(
|
MangaActionButton(
|
||||||
title = if (trackingCount == 0) {
|
title = if (trackingCount == 0) {
|
||||||
stringResource(MR.strings.manga_tracking_tab)
|
stringResource(MR.strings.manga_tracking_tab)
|
||||||
|
@ -118,6 +118,7 @@ class MangaScreen(
|
|||||||
state = successState,
|
state = successState,
|
||||||
snackbarHostState = screenModel.snackbarHostState,
|
snackbarHostState = screenModel.snackbarHostState,
|
||||||
nextUpdate = successState.manga.expectedNextUpdate,
|
nextUpdate = successState.manga.expectedNextUpdate,
|
||||||
|
isUpdateIntervalEnabled = screenModel.isUpdateIntervalEnabled,
|
||||||
isTabletUi = isTabletUi(),
|
isTabletUi = isTabletUi(),
|
||||||
chapterSwipeStartAction = screenModel.chapterSwipeStartAction,
|
chapterSwipeStartAction = screenModel.chapterSwipeStartAction,
|
||||||
chapterSwipeEndAction = screenModel.chapterSwipeEndAction,
|
chapterSwipeEndAction = screenModel.chapterSwipeEndAction,
|
||||||
|
Loading…
Reference in New Issue
Block a user