chore(migrate-manga): Allow open manga by clicking cover while in selection mode (#924)
This commit is contained in:
parent
cfa9f6bfef
commit
49c012e548
2 changed files with 14 additions and 16 deletions
|
|
@ -60,7 +60,7 @@ fun MigrateMangaScreen(
|
||||||
navigateUp: () -> Unit,
|
navigateUp: () -> Unit,
|
||||||
title: String,
|
title: String,
|
||||||
state: MigrateMangaScreenModel.State,
|
state: MigrateMangaScreenModel.State,
|
||||||
onClickItem: (MigrateMangaItem) -> Unit,
|
onClickItem: (Manga) -> Unit,
|
||||||
onClickCover: (Manga) -> Unit,
|
onClickCover: (Manga) -> Unit,
|
||||||
// KMK -->
|
// KMK -->
|
||||||
onMultiMigrateClicked: (() -> Unit),
|
onMultiMigrateClicked: (() -> Unit),
|
||||||
|
|
@ -145,7 +145,7 @@ fun MigrateMangaScreen(
|
||||||
private fun MigrateMangaContent(
|
private fun MigrateMangaContent(
|
||||||
contentPadding: PaddingValues,
|
contentPadding: PaddingValues,
|
||||||
state: MigrateMangaScreenModel.State,
|
state: MigrateMangaScreenModel.State,
|
||||||
onClickItem: (MigrateMangaItem) -> Unit,
|
onClickItem: (Manga) -> Unit,
|
||||||
onClickCover: (Manga) -> Unit,
|
onClickCover: (Manga) -> Unit,
|
||||||
// KMK -->
|
// KMK -->
|
||||||
onMangaSelected: (MigrateMangaItem, Boolean, Boolean, Boolean) -> Unit,
|
onMangaSelected: (MigrateMangaItem, Boolean, Boolean, Boolean) -> Unit,
|
||||||
|
|
@ -156,23 +156,21 @@ private fun MigrateMangaContent(
|
||||||
state = listState,
|
state = listState,
|
||||||
) {
|
) {
|
||||||
// KMK <--
|
// KMK <--
|
||||||
items(items = state.titles) {
|
items(items = state.titles) { item ->
|
||||||
MigrateMangaItem(
|
MigrateMangaItem(
|
||||||
manga = it.manga,
|
manga = item.manga,
|
||||||
onClickItem = {
|
onClickItem = {
|
||||||
// KMK -->
|
// KMK -->
|
||||||
when {
|
when {
|
||||||
state.selectionMode -> onMangaSelected(it, !it.selected, true, false)
|
state.selectionMode -> onMangaSelected(item, !item.selected, true, false)
|
||||||
// KMK <--
|
// KMK <--
|
||||||
else -> onClickItem(it)
|
else -> onClickItem(it)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onClickCover = {
|
onClickCover = onClickCover,
|
||||||
onClickCover(it.manga)
|
|
||||||
// KMK -->
|
// KMK -->
|
||||||
}.takeIf { !state.selectionMode },
|
onLongClick = { onMangaSelected(item, !item.selected, true, true) },
|
||||||
onLongClick = { onMangaSelected(it, !it.selected, true, true) },
|
selected = item.selected,
|
||||||
selected = it.selected,
|
|
||||||
modifier = Modifier.animateItemFastScroll(),
|
modifier = Modifier.animateItemFastScroll(),
|
||||||
// KMK <--
|
// KMK <--
|
||||||
)
|
)
|
||||||
|
|
@ -183,8 +181,8 @@ private fun MigrateMangaContent(
|
||||||
@Composable
|
@Composable
|
||||||
private fun MigrateMangaItem(
|
private fun MigrateMangaItem(
|
||||||
manga: Manga,
|
manga: Manga,
|
||||||
onClickItem: () -> Unit,
|
onClickItem: (Manga) -> Unit,
|
||||||
onClickCover: (() -> Unit)?,
|
onClickCover: (Manga) -> Unit,
|
||||||
// KMK -->
|
// KMK -->
|
||||||
onLongClick: () -> Unit,
|
onLongClick: () -> Unit,
|
||||||
selected: Boolean,
|
selected: Boolean,
|
||||||
|
|
@ -194,8 +192,8 @@ private fun MigrateMangaItem(
|
||||||
BaseMangaListItem(
|
BaseMangaListItem(
|
||||||
modifier = modifier,
|
modifier = modifier,
|
||||||
manga = manga,
|
manga = manga,
|
||||||
onClickItem = onClickItem,
|
onClickItem = { onClickItem(manga) },
|
||||||
onClickCover = { onClickCover?.invoke() },
|
onClickCover = { onClickCover(manga) },
|
||||||
// KMK -->
|
// KMK -->
|
||||||
onLongClick = onLongClick,
|
onLongClick = onLongClick,
|
||||||
selected = selected,
|
selected = selected,
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ data class MigrateMangaScreen(
|
||||||
PreMigrationScreen.navigateToMigration(
|
PreMigrationScreen.navigateToMigration(
|
||||||
Injekt.get<UnsortedPreferences>().skipPreMigration().get(),
|
Injekt.get<UnsortedPreferences>().skipPreMigration().get(),
|
||||||
navigator,
|
navigator,
|
||||||
listOf(it.manga.id),
|
listOf(it.id),
|
||||||
)
|
)
|
||||||
// SY <--
|
// SY <--
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue