mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-06 18:57:26 +01:00
parent
c288e6b8fa
commit
3f9820ac79
@ -38,7 +38,7 @@ fun LazyGridScope.globalSearchItem(
|
|||||||
searchQuery: String?,
|
searchQuery: String?,
|
||||||
onGlobalSearchClicked: () -> Unit,
|
onGlobalSearchClicked: () -> Unit,
|
||||||
) {
|
) {
|
||||||
if (searchQuery.isNullOrEmpty().not()) {
|
if (!searchQuery.isNullOrEmpty()) {
|
||||||
item(
|
item(
|
||||||
span = { GridItemSpan(maxLineSpan) },
|
span = { GridItemSpan(maxLineSpan) },
|
||||||
contentType = { "library_global_search_item" },
|
contentType = { "library_global_search_item" },
|
||||||
|
@ -32,7 +32,6 @@ fun LibraryContent(
|
|||||||
selection: List<LibraryManga>,
|
selection: List<LibraryManga>,
|
||||||
contentPadding: PaddingValues,
|
contentPadding: PaddingValues,
|
||||||
currentPage: () -> Int,
|
currentPage: () -> Int,
|
||||||
isLibraryEmpty: Boolean,
|
|
||||||
showPageTabs: Boolean,
|
showPageTabs: Boolean,
|
||||||
onChangeCurrentPage: (Int) -> Unit,
|
onChangeCurrentPage: (Int) -> Unit,
|
||||||
onMangaClicked: (Long) -> Unit,
|
onMangaClicked: (Long) -> Unit,
|
||||||
|
@ -747,7 +747,6 @@ class LibraryScreenModel(
|
|||||||
val selectionMode = selection.isNotEmpty()
|
val selectionMode = selection.isNotEmpty()
|
||||||
|
|
||||||
val categories = library.keys.toList()
|
val categories = library.keys.toList()
|
||||||
private val onlyDefaultCategory = categories.size == 1 && categories[0].isSystemCategory
|
|
||||||
|
|
||||||
val libraryCount by lazy {
|
val libraryCount by lazy {
|
||||||
library.values
|
library.values
|
||||||
@ -765,7 +764,7 @@ class LibraryScreenModel(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun getMangaCountForCategory(category: Category): Int? {
|
fun getMangaCountForCategory(category: Category): Int? {
|
||||||
return if (showMangaCount) library[category]?.size else null
|
return if (showMangaCount || !searchQuery.isNullOrEmpty()) library[category]?.size else null
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getToolbarTitle(
|
fun getToolbarTitle(
|
||||||
|
@ -170,8 +170,7 @@ object LibraryTab : Tab {
|
|||||||
selection = state.selection,
|
selection = state.selection,
|
||||||
contentPadding = contentPadding,
|
contentPadding = contentPadding,
|
||||||
currentPage = { screenModel.activeCategory },
|
currentPage = { screenModel.activeCategory },
|
||||||
isLibraryEmpty = state.libraryCount == 0,
|
showPageTabs = state.showCategoryTabs || !state.searchQuery.isNullOrEmpty(),
|
||||||
showPageTabs = state.showCategoryTabs,
|
|
||||||
onChangeCurrentPage = { screenModel.activeCategory = it },
|
onChangeCurrentPage = { screenModel.activeCategory = it },
|
||||||
onMangaClicked = { navigator.push(MangaScreen(it)) },
|
onMangaClicked = { navigator.push(MangaScreen(it)) },
|
||||||
onContinueReadingClicked = { it: LibraryManga ->
|
onContinueReadingClicked = { it: LibraryManga ->
|
||||||
|
Loading…
Reference in New Issue
Block a user