Fix library dropdown arrow showing for a split second for those with 0 categories

But please use categories anyway
This commit is contained in:
Jays2Kings 2021-04-08 00:42:26 -04:00
parent 2c4ddcd555
commit 93d2145c43
2 changed files with 4 additions and 0 deletions

View File

@ -783,6 +783,7 @@ class LibraryController(
LibraryUpdateService.setListener(this) LibraryUpdateService.setListener(this)
binding.recyclerCover.isClickable = false binding.recyclerCover.isClickable = false
binding.recyclerCover.isFocusable = false binding.recyclerCover.isFocusable = false
singleCategory = presenter.categories.size <= 1
showDropdown() showDropdown()
} else { } else {
updateFilterSheetY() updateFilterSheetY()

View File

@ -100,6 +100,9 @@ class LibraryPresenter(
/** Get favorited manga for library and sort and filter it */ /** Get favorited manga for library and sort and filter it */
fun getLibrary() { fun getLibrary() {
if (categories.isEmpty()) {
categories = lastCategories ?: db.getCategories().executeAsBlocking().toMutableList()
}
scope.launch { scope.launch {
val library = withContext(Dispatchers.IO) { getLibraryFromDB() } val library = withContext(Dispatchers.IO) { getLibraryFromDB() }
library.apply { library.apply {