I’m using recycler recyclerview-selection
for selection and ItemTouchHelper.SimpleCallback
for reorder the items. Like below:
I can drag and drop the icon on the right (green) part for reordering, also I can touch anywhere on the viewholder for selection.
The problem are:
- When I drag the icon the item also be selected. (the checkbox is enable state)
- When I touch the icon the item also be selected.
Is anyway to just touch the red rect for selecting and the icon for dragging?
I tried to both:
holder.binding.reorder.setOnLongClickListener {
touchHelper.startDrag(holder)
true
}
holder.binding.reorder.setOnTouchListener { view, event ->
if (event.actionMasked == MotionEvent.ACTION_DOWN) {
touchHelper.startDrag(holder)
}
return@setOnTouchListener false
}
onLongClick and Touch to distinguish the gestures, but still the same effect. Thanks in advance!