mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-10 02:58:55 +01:00
Add "Play" button on manga in library (#8218)
* resume manga button in libarary * work on resume button * Backup * work on opening the last read chapter * backup * renaming * fab instead of image * done with logic * cleanup * cleanup * import cleanup * cleanup... * refactoring * fixing logic * fixing scopes * Reworking design * adding ability to turn on/off the feature * cleanup * refactoring, fixing logic, adding filter logic (partial) * backup * backup * logic done * backup before merge fix * merge conflict.... * merge conflict... * reworking ui logic * removing unnecessary file * refactoring * refactoring * review changes + minor parameter position movement * commiting suggestion Co-authored-by: arkon <arkon@users.noreply.github.com> * fixing minor mistake * moving ChapterFilter.kt Co-authored-by: arkon <arkon@users.noreply.github.com>
This commit is contained in:
@@ -11,6 +11,7 @@ import androidx.compose.ui.platform.LocalHapticFeedback
|
||||
import androidx.compose.ui.platform.LocalUriHandler
|
||||
import androidx.compose.ui.util.fastAll
|
||||
import eu.kanade.domain.category.model.Category
|
||||
import eu.kanade.domain.library.model.LibraryManga
|
||||
import eu.kanade.domain.library.model.display
|
||||
import eu.kanade.domain.manga.model.isLocal
|
||||
import eu.kanade.presentation.components.EmptyScreen
|
||||
@@ -29,6 +30,7 @@ import eu.kanade.tachiyomi.widget.TachiyomiBottomNavigationView
|
||||
fun LibraryScreen(
|
||||
presenter: LibraryPresenter,
|
||||
onMangaClicked: (Long) -> Unit,
|
||||
onContinueReadingClicked: (LibraryManga) -> Unit,
|
||||
onGlobalSearchClicked: () -> Unit,
|
||||
onChangeCategoryClicked: () -> Unit,
|
||||
onMarkAsReadClicked: () -> Unit,
|
||||
@@ -104,6 +106,7 @@ fun LibraryScreen(
|
||||
showMangaCount = presenter.mangaCountVisibility,
|
||||
onChangeCurrentPage = { presenter.activeCategory = it },
|
||||
onMangaClicked = onMangaClicked,
|
||||
onContinueReadingClicked = onContinueReadingClicked,
|
||||
onToggleSelection = { presenter.toggleSelection(it) },
|
||||
onToggleRangeSelection = {
|
||||
presenter.toggleRangeSelection(it)
|
||||
@@ -119,6 +122,7 @@ fun LibraryScreen(
|
||||
showUnreadBadges = presenter.showUnreadBadges,
|
||||
showLocalBadges = presenter.showLocalBadges,
|
||||
showLanguageBadges = presenter.showLanguageBadges,
|
||||
showContinueReadingButton = presenter.showContinueReadingButton,
|
||||
isIncognitoMode = presenter.isIncognitoMode,
|
||||
isDownloadOnly = presenter.isDownloadOnly,
|
||||
)
|
||||
|
||||
@@ -18,11 +18,13 @@ fun LibraryComfortableGrid(
|
||||
showUnreadBadges: Boolean,
|
||||
showLocalBadges: Boolean,
|
||||
showLanguageBadges: Boolean,
|
||||
showContinueReadingButton: Boolean,
|
||||
columns: Int,
|
||||
contentPadding: PaddingValues,
|
||||
selection: List<LibraryManga>,
|
||||
onClick: (LibraryManga) -> Unit,
|
||||
onLongClick: (LibraryManga) -> Unit,
|
||||
onClickContinueReading: (LibraryManga) -> Unit,
|
||||
searchQuery: String?,
|
||||
onGlobalSearchClicked: () -> Unit,
|
||||
) {
|
||||
@@ -65,8 +67,10 @@ fun LibraryComfortableGrid(
|
||||
item = libraryItem,
|
||||
)
|
||||
},
|
||||
showContinueReadingButton = showContinueReadingButton,
|
||||
onLongClick = { onLongClick(libraryItem.libraryManga) },
|
||||
onClick = { onClick(libraryItem.libraryManga) },
|
||||
onClickContinueReading = { onClickContinueReading(libraryItem.libraryManga) },
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,11 +19,13 @@ fun LibraryCompactGrid(
|
||||
showUnreadBadges: Boolean,
|
||||
showLocalBadges: Boolean,
|
||||
showLanguageBadges: Boolean,
|
||||
showContinueReadingButton: Boolean,
|
||||
columns: Int,
|
||||
contentPadding: PaddingValues,
|
||||
selection: List<LibraryManga>,
|
||||
onClick: (LibraryManga) -> Unit,
|
||||
onLongClick: (LibraryManga) -> Unit,
|
||||
onClickContinueReading: (LibraryManga) -> Unit,
|
||||
searchQuery: String?,
|
||||
onGlobalSearchClicked: () -> Unit,
|
||||
) {
|
||||
@@ -66,8 +68,10 @@ fun LibraryCompactGrid(
|
||||
item = libraryItem,
|
||||
)
|
||||
},
|
||||
showContinueReadingButton = showContinueReadingButton,
|
||||
onLongClick = { onLongClick(libraryItem.libraryManga) },
|
||||
onClick = { onClick(libraryItem.libraryManga) },
|
||||
onClickContinueReading = { onClickContinueReading(libraryItem.libraryManga) },
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@ fun LibraryContent(
|
||||
showMangaCount: Boolean,
|
||||
onChangeCurrentPage: (Int) -> Unit,
|
||||
onMangaClicked: (Long) -> Unit,
|
||||
onContinueReadingClicked: (LibraryManga) -> Unit,
|
||||
onToggleSelection: (LibraryManga) -> Unit,
|
||||
onToggleRangeSelection: (LibraryManga) -> Unit,
|
||||
onRefresh: (Category?) -> Boolean,
|
||||
@@ -49,6 +50,7 @@ fun LibraryContent(
|
||||
showUnreadBadges: Boolean,
|
||||
showLocalBadges: Boolean,
|
||||
showLanguageBadges: Boolean,
|
||||
showContinueReadingButton: Boolean,
|
||||
isDownloadOnly: Boolean,
|
||||
isIncognitoMode: Boolean,
|
||||
) {
|
||||
@@ -88,6 +90,9 @@ fun LibraryContent(
|
||||
val onLongClickManga = { manga: LibraryManga ->
|
||||
onToggleRangeSelection(manga)
|
||||
}
|
||||
val onClickContinueReading = { manga: LibraryManga ->
|
||||
onContinueReadingClicked(manga)
|
||||
}
|
||||
|
||||
SwipeRefresh(
|
||||
refreshing = isRefreshing,
|
||||
@@ -115,8 +120,10 @@ fun LibraryContent(
|
||||
showUnreadBadges = showUnreadBadges,
|
||||
showLocalBadges = showLocalBadges,
|
||||
showLanguageBadges = showLanguageBadges,
|
||||
showContinueReadingButton = showContinueReadingButton,
|
||||
onClickManga = onClickManga,
|
||||
onLongClickManga = onLongClickManga,
|
||||
onClickContinueReading = onClickContinueReading,
|
||||
onGlobalSearchClicked = onGlobalSearchClicked,
|
||||
searchQuery = state.searchQuery,
|
||||
)
|
||||
|
||||
@@ -27,10 +27,12 @@ fun LibraryList(
|
||||
showUnreadBadges: Boolean,
|
||||
showLocalBadges: Boolean,
|
||||
showLanguageBadges: Boolean,
|
||||
showContinueReadingButton: Boolean,
|
||||
contentPadding: PaddingValues,
|
||||
selection: List<LibraryManga>,
|
||||
onClick: (LibraryManga) -> Unit,
|
||||
onLongClick: (LibraryManga) -> Unit,
|
||||
onClickContinueReading: (LibraryManga) -> Unit,
|
||||
searchQuery: String?,
|
||||
onGlobalSearchClicked: () -> Unit,
|
||||
) {
|
||||
@@ -72,8 +74,10 @@ fun LibraryList(
|
||||
UnreadBadge(enabled = showUnreadBadges, item = libraryItem)
|
||||
LanguageBadge(showLanguage = showLanguageBadges, showLocal = showLocalBadges, item = libraryItem)
|
||||
},
|
||||
showContinueReadingButton = showContinueReadingButton,
|
||||
onLongClick = { onLongClick(libraryItem.libraryManga) },
|
||||
onClick = { onClick(libraryItem.libraryManga) },
|
||||
onClickContinueReading = { onClickContinueReading(libraryItem.libraryManga) },
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,8 +32,10 @@ fun LibraryPager(
|
||||
showUnreadBadges: Boolean,
|
||||
showLocalBadges: Boolean,
|
||||
showLanguageBadges: Boolean,
|
||||
showContinueReadingButton: Boolean,
|
||||
onClickManga: (LibraryManga) -> Unit,
|
||||
onLongClickManga: (LibraryManga) -> Unit,
|
||||
onClickContinueReading: (LibraryManga) -> Unit,
|
||||
) {
|
||||
HorizontalPager(
|
||||
count = pageCount,
|
||||
@@ -64,10 +66,12 @@ fun LibraryPager(
|
||||
showUnreadBadges = showUnreadBadges,
|
||||
showLocalBadges = showLocalBadges,
|
||||
showLanguageBadges = showLanguageBadges,
|
||||
showContinueReadingButton = showContinueReadingButton,
|
||||
contentPadding = contentPadding,
|
||||
selection = selectedManga,
|
||||
onClick = onClickManga,
|
||||
onLongClick = onLongClickManga,
|
||||
onClickContinueReading = onClickContinueReading,
|
||||
searchQuery = searchQuery,
|
||||
onGlobalSearchClicked = onGlobalSearchClicked,
|
||||
)
|
||||
@@ -80,11 +84,13 @@ fun LibraryPager(
|
||||
showUnreadBadges = showUnreadBadges,
|
||||
showLocalBadges = showLocalBadges,
|
||||
showLanguageBadges = showLanguageBadges,
|
||||
showContinueReadingButton = showContinueReadingButton,
|
||||
columns = columns,
|
||||
contentPadding = contentPadding,
|
||||
selection = selectedManga,
|
||||
onClick = onClickManga,
|
||||
onLongClick = onLongClickManga,
|
||||
onClickContinueReading = onClickContinueReading,
|
||||
searchQuery = searchQuery,
|
||||
onGlobalSearchClicked = onGlobalSearchClicked,
|
||||
)
|
||||
@@ -96,10 +102,12 @@ fun LibraryPager(
|
||||
showUnreadBadges = showUnreadBadges,
|
||||
showLocalBadges = showLocalBadges,
|
||||
showLanguageBadges = showLanguageBadges,
|
||||
showContinueReadingButton = showContinueReadingButton,
|
||||
columns = columns,
|
||||
contentPadding = contentPadding,
|
||||
selection = selectedManga,
|
||||
onClick = onClickManga,
|
||||
onClickContinueReading = onClickContinueReading,
|
||||
onLongClick = onLongClickManga,
|
||||
searchQuery = searchQuery,
|
||||
onGlobalSearchClicked = onGlobalSearchClicked,
|
||||
|
||||
Reference in New Issue
Block a user