Hopefully fix issues with certain actions for some people
This commit is contained in:
parent
ead5a258be
commit
74065afc27
@ -361,19 +361,7 @@ class LibraryCategoryView @JvmOverloads constructor(context: Context, attrs: Att
|
|||||||
}
|
}
|
||||||
// SY -->
|
// SY -->
|
||||||
override fun onItemReleased(position: Int) {
|
override fun onItemReleased(position: Int) {
|
||||||
controller.invalidateActionMode()
|
return
|
||||||
val mangaIds = adapter.currentItems.mapNotNull { it.manga.id }
|
|
||||||
category.mangaOrder = mangaIds
|
|
||||||
if (category.id == 0) {
|
|
||||||
preferences.defaultMangaOrder().set(mangaIds.joinToString("/"))
|
|
||||||
} else {
|
|
||||||
db.insertCategory(category).asRxObservable().subscribe()
|
|
||||||
}
|
|
||||||
if (preferences.librarySortingMode().get() != LibrarySort.DRAG_AND_DROP) {
|
|
||||||
preferences.librarySortingAscending().set(true)
|
|
||||||
preferences.librarySortingMode().set(LibrarySort.DRAG_AND_DROP)
|
|
||||||
controller.refreshSort()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun shouldMoveItem(fromPosition: Int, toPosition: Int): Boolean {
|
override fun shouldMoveItem(fromPosition: Int, toPosition: Int): Boolean {
|
||||||
@ -389,7 +377,20 @@ class LibraryCategoryView @JvmOverloads constructor(context: Context, attrs: Att
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onItemMove(fromPosition: Int, toPosition: Int) {
|
override fun onItemMove(fromPosition: Int, toPosition: Int) {
|
||||||
return
|
if (fromPosition == toPosition) return
|
||||||
|
controller.invalidateActionMode()
|
||||||
|
val mangaIds = adapter.currentItems.mapNotNull { it.manga.id }
|
||||||
|
category.mangaOrder = mangaIds
|
||||||
|
if (category.id == 0) {
|
||||||
|
preferences.defaultMangaOrder().set(mangaIds.joinToString("/"))
|
||||||
|
} else {
|
||||||
|
db.insertCategory(category).asRxObservable().subscribe()
|
||||||
|
}
|
||||||
|
if (preferences.librarySortingMode().get() != LibrarySort.DRAG_AND_DROP) {
|
||||||
|
preferences.librarySortingAscending().set(true)
|
||||||
|
preferences.librarySortingMode().set(LibrarySort.DRAG_AND_DROP)
|
||||||
|
controller.refreshSort()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// SY <--
|
// SY <--
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user