mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-09 19:55:11 +01:00
Fix fast scroll when using a single category
No longer shows the refresh button for single category
This commit is contained in:
parent
14c2ac6067
commit
69214984e4
@ -96,13 +96,17 @@ class LibraryCategoryAdapter(val libraryListener: LibraryListener) :
|
||||
val preferences: PreferencesHelper by injectLazy()
|
||||
val db: DatabaseHelper by injectLazy()
|
||||
if (position == itemCount - 1) return "-"
|
||||
val sorting = if (preferences.hideCategories().getOrDefault())
|
||||
preferences.hideCategories().getOrDefault()
|
||||
else (headerItems.firstOrNull() as? LibraryHeaderItem)?.category?.sortingMode()
|
||||
?: LibrarySort.DRAG_AND_DROP
|
||||
return when (val item: IFlexible<*>? = getItem(position)) {
|
||||
is LibraryHeaderItem ->
|
||||
if (preferences.hideCategories().getOrDefault() || item.category.id == 0) null
|
||||
else item.category.name.first().toString() +
|
||||
"\u200B".repeat(max(0, item.category.order))
|
||||
is LibraryItem -> {
|
||||
when (preferences.librarySortingMode().getOrDefault()) {
|
||||
when (sorting) {
|
||||
LibrarySort.DRAG_AND_DROP -> {
|
||||
val category = db.getCategoriesForManga(item.manga).executeAsBlocking()
|
||||
.firstOrNull()
|
||||
|
@ -28,6 +28,7 @@ import eu.kanade.tachiyomi.util.system.getResourceColor
|
||||
import eu.kanade.tachiyomi.util.view.gone
|
||||
import eu.kanade.tachiyomi.util.view.invisible
|
||||
import eu.kanade.tachiyomi.util.view.updateLayoutParams
|
||||
import eu.kanade.tachiyomi.util.view.visInvisIf
|
||||
import eu.kanade.tachiyomi.util.view.visible
|
||||
import kotlinx.android.synthetic.main.library_category_header_item.view.*
|
||||
|
||||
@ -142,7 +143,7 @@ class LibraryHeaderItem(
|
||||
else -> {
|
||||
catProgress.gone()
|
||||
checkboxImage.gone()
|
||||
updateButton.visible()
|
||||
updateButton.visInvisIf(!(category.isFirst == true && category.isLast == true))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user