Always show library tabs and counts when searching

Closes #8680
This commit is contained in:
arkon 2022-12-05 10:06:41 -05:00
parent c288e6b8fa
commit 3f9820ac79
4 changed files with 3 additions and 6 deletions

View File

@ -38,7 +38,7 @@ fun LazyGridScope.globalSearchItem(
searchQuery: String?,
onGlobalSearchClicked: () -> Unit,
) {
if (searchQuery.isNullOrEmpty().not()) {
if (!searchQuery.isNullOrEmpty()) {
item(
span = { GridItemSpan(maxLineSpan) },
contentType = { "library_global_search_item" },

View File

@ -32,7 +32,6 @@ fun LibraryContent(
selection: List<LibraryManga>,
contentPadding: PaddingValues,
currentPage: () -> Int,
isLibraryEmpty: Boolean,
showPageTabs: Boolean,
onChangeCurrentPage: (Int) -> Unit,
onMangaClicked: (Long) -> Unit,

View File

@ -747,7 +747,6 @@ class LibraryScreenModel(
val selectionMode = selection.isNotEmpty()
val categories = library.keys.toList()
private val onlyDefaultCategory = categories.size == 1 && categories[0].isSystemCategory
val libraryCount by lazy {
library.values
@ -765,7 +764,7 @@ class LibraryScreenModel(
}
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(

View File

@ -170,8 +170,7 @@ object LibraryTab : Tab {
selection = state.selection,
contentPadding = contentPadding,
currentPage = { screenModel.activeCategory },
isLibraryEmpty = state.libraryCount == 0,
showPageTabs = state.showCategoryTabs,
showPageTabs = state.showCategoryTabs || !state.searchQuery.isNullOrEmpty(),
onChangeCurrentPage = { screenModel.activeCategory = it },
onMangaClicked = { navigator.push(MangaScreen(it)) },
onContinueReadingClicked = { it: LibraryManga ->