Tweak dragging so it works in action mode if there is only 1 manga selected
This commit is contained in:
parent
ad62a6b10b
commit
c834c2fbb0
@ -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.
|
* 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) {
|
override fun onItemLongClick(position: Int) {
|
||||||
controller.createActionModeIfNeeded()
|
controller.createActionModeIfNeeded()
|
||||||
// SY -->
|
// SY -->
|
||||||
adapter.isLongPressDragEnabled = false
|
adapter.isLongPressDragEnabled = canDrag()
|
||||||
// SY <--
|
// SY <--
|
||||||
when {
|
when {
|
||||||
lastClickPosition == -1 -> setSelection(position)
|
lastClickPosition == -1 -> setSelection(position)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user