mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-23 23:51:53 +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 preferences: PreferencesHelper by injectLazy()
|
||||||
val db: DatabaseHelper by injectLazy()
|
val db: DatabaseHelper by injectLazy()
|
||||||
if (position == itemCount - 1) return "-"
|
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)) {
|
return when (val item: IFlexible<*>? = getItem(position)) {
|
||||||
is LibraryHeaderItem ->
|
is LibraryHeaderItem ->
|
||||||
if (preferences.hideCategories().getOrDefault() || item.category.id == 0) null
|
if (preferences.hideCategories().getOrDefault() || item.category.id == 0) null
|
||||||
else item.category.name.first().toString() +
|
else item.category.name.first().toString() +
|
||||||
"\u200B".repeat(max(0, item.category.order))
|
"\u200B".repeat(max(0, item.category.order))
|
||||||
is LibraryItem -> {
|
is LibraryItem -> {
|
||||||
when (preferences.librarySortingMode().getOrDefault()) {
|
when (sorting) {
|
||||||
LibrarySort.DRAG_AND_DROP -> {
|
LibrarySort.DRAG_AND_DROP -> {
|
||||||
val category = db.getCategoriesForManga(item.manga).executeAsBlocking()
|
val category = db.getCategoriesForManga(item.manga).executeAsBlocking()
|
||||||
.firstOrNull()
|
.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.gone
|
||||||
import eu.kanade.tachiyomi.util.view.invisible
|
import eu.kanade.tachiyomi.util.view.invisible
|
||||||
import eu.kanade.tachiyomi.util.view.updateLayoutParams
|
import eu.kanade.tachiyomi.util.view.updateLayoutParams
|
||||||
|
import eu.kanade.tachiyomi.util.view.visInvisIf
|
||||||
import eu.kanade.tachiyomi.util.view.visible
|
import eu.kanade.tachiyomi.util.view.visible
|
||||||
import kotlinx.android.synthetic.main.library_category_header_item.view.*
|
import kotlinx.android.synthetic.main.library_category_header_item.view.*
|
||||||
|
|
||||||
@ -142,7 +143,7 @@ class LibraryHeaderItem(
|
|||||||
else -> {
|
else -> {
|
||||||
catProgress.gone()
|
catProgress.gone()
|
||||||
checkboxImage.gone()
|
checkboxImage.gone()
|
||||||
updateButton.visible()
|
updateButton.visInvisIf(!(category.isFirst == true && category.isLast == true))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user