mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-13 00:05:08 +01:00
More fixes to D&D sorting with new presenter
This commit is contained in:
parent
d4153a9f41
commit
c48252b61c
@ -81,8 +81,6 @@ class LibraryCategoryView @JvmOverloads constructor(context: Context, attrs: Att
|
||||
|
||||
private var lastClickPosition = -1
|
||||
|
||||
private var justDraggedAndDropped = false
|
||||
|
||||
fun onCreate(controller: LibraryController) {
|
||||
this.controller = controller
|
||||
|
||||
@ -239,10 +237,10 @@ class LibraryCategoryView @JvmOverloads constructor(context: Context, attrs: Att
|
||||
val mangaForCategory = event.getMangaForCategory(category).orEmpty()
|
||||
|
||||
// Update the category with its manga.
|
||||
if (!justDraggedAndDropped)
|
||||
// if (!justDraggedAndDropped)
|
||||
adapter.setItems(mangaForCategory)
|
||||
else
|
||||
justDraggedAndDropped = false
|
||||
// else
|
||||
// justDraggedAndDropped = false
|
||||
|
||||
swipe_refresh.isEnabled = !preferences.hideCategories().getOrDefault()
|
||||
|
||||
@ -366,7 +364,7 @@ class LibraryCategoryView @JvmOverloads constructor(context: Context, attrs: Att
|
||||
preferences.defaultMangaOrder().set(mangaIds.joinToString("/"))
|
||||
else
|
||||
db.insertCategory(category).asRxObservable().subscribe()
|
||||
justDraggedAndDropped = true
|
||||
//justDraggedAndDropped = true
|
||||
controller.onCatSortChanged(category.id)
|
||||
controller.enableReorderItems(category)
|
||||
}
|
||||
|
@ -60,9 +60,9 @@ class LibraryGridHolder(
|
||||
local_text.visibility = if (item.manga.source == LocalSource.ID) View.VISIBLE else View.GONE
|
||||
|
||||
// Update the cover.
|
||||
GlideApp.with(view.context).clear(thumbnail)
|
||||
GlideApp.with(view.context)
|
||||
.load(item.manga)
|
||||
if (item.manga.thumbnail_url == null)
|
||||
GlideApp.with(view.context).clear(thumbnail)
|
||||
else GlideApp.with(view.context).load(item.manga)
|
||||
.diskCacheStrategy(DiskCacheStrategy.AUTOMATIC)
|
||||
.signature(ObjectKey(MangaImpl.getLastCoverFetch(item.manga.id!!).toString()))
|
||||
.centerCrop().into(thumbnail)
|
||||
|
@ -211,7 +211,11 @@ class LibraryPresenter(
|
||||
|
||||
private fun applySort(map: LibraryMap, catId: Int?): LibraryMap {
|
||||
if (catId == null) return map
|
||||
val category = allCategories.find { it.id == catId } ?: return map
|
||||
val category = db.getCategories().executeAsBlocking().find { it.id == catId } ?: return map
|
||||
allCategories.find { it.id == catId }?.apply {
|
||||
mangaOrder = category.mangaOrder
|
||||
mangaSort = category.mangaSort
|
||||
}
|
||||
|
||||
val lastReadManga by lazy {
|
||||
var counter = 0
|
||||
|
Loading…
Reference in New Issue
Block a user