diff --git a/app/src/main/java/eu/kanade/presentation/library/components/LazyLibraryGrid.kt b/app/src/main/java/eu/kanade/presentation/library/components/LazyLibraryGrid.kt index 2011247434..6e7a109ec0 100644 --- a/app/src/main/java/eu/kanade/presentation/library/components/LazyLibraryGrid.kt +++ b/app/src/main/java/eu/kanade/presentation/library/components/LazyLibraryGrid.kt @@ -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" }, diff --git a/app/src/main/java/eu/kanade/presentation/library/components/LibraryContent.kt b/app/src/main/java/eu/kanade/presentation/library/components/LibraryContent.kt index c0babd6d44..1038286d2a 100644 --- a/app/src/main/java/eu/kanade/presentation/library/components/LibraryContent.kt +++ b/app/src/main/java/eu/kanade/presentation/library/components/LibraryContent.kt @@ -32,7 +32,6 @@ fun LibraryContent( selection: List, contentPadding: PaddingValues, currentPage: () -> Int, - isLibraryEmpty: Boolean, showPageTabs: Boolean, onChangeCurrentPage: (Int) -> Unit, onMangaClicked: (Long) -> Unit, diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryScreenModel.kt index bcec9c5e21..6204c9346a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryScreenModel.kt @@ -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( diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryTab.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryTab.kt index 2ec310bd05..123895cee2 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryTab.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryTab.kt @@ -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 ->