diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt index e935205fc2..c6d6dd10ad 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt @@ -724,8 +724,8 @@ class LibraryController( if (justStarted && freshStart) { scrollToHeader(activeCategory) } - recycler.post { - elevateAppBar(recycler.canScrollVertically(-1)) + recycler?.post { + elevateAppBar(recycler?.canScrollVertically(-1) == true) setActiveCategory() } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt index 4cf63bcc87..5bc4460098 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt @@ -158,7 +158,7 @@ class LibraryPresenter( private suspend fun sectionLibrary(items: List, freshStart: Boolean = false) { libraryItems = items val showAll = showAllCategories || !libraryIsGrouped || - categories.size == 1 + categories.size <= 1 if (!showAll) { sectionedLibraryItems = items.groupBy { it.header.category.id ?: 0 }.toMutableMap() if (currentCategory == -1) currentCategory = categories.find {