Tweak dragging so it works in action mode if there is only 1 manga selected

This commit is contained in:
Jobobby04 2020-08-08 16:32:03 -04:00
parent ad62a6b10b
commit c834c2fbb0

View File

@ -306,7 +306,7 @@ class LibraryCategoryView @JvmOverloads constructor(context: Context, attrs: Att
}
}
fun canDrag() = adapter.mode != SelectableAdapter.Mode.MULTI && adapter.searchText.isBlank()
private fun canDrag() = ((adapter.mode == SelectableAdapter.Mode.MULTI && adapter.selectedItemCount == 1) || adapter.mode != SelectableAdapter.Mode.MULTI) && adapter.searchText.isBlank()
/**
* Toggles the selection for the given manga and updates the view if needed.
@ -348,7 +348,7 @@ class LibraryCategoryView @JvmOverloads constructor(context: Context, attrs: Att
override fun onItemLongClick(position: Int) {
controller.createActionModeIfNeeded()
// SY -->
adapter.isLongPressDragEnabled = false
adapter.isLongPressDragEnabled = canDrag()
// SY <--
when {
lastClickPosition == -1 -> setSelection(position)