DragSelectRecyclerView icon indicating copy to clipboard operation
DragSelectRecyclerView copied to clipboard

Can not deselect immediately after a long press

Open thadikari opened this issue 6 years ago • 0 comments

Hi, thanks for the much useful library!

Here's how to recreate a bug I spotted. (See the Current behavior gif below.)

  1. Start the demo app.
  2. Long press any tile (for example tile 0 hereafter) to switch to dragselect mode. Important: do not perform any drag gesture, just long press tile 0 till it becomes red.
  3. Without touching anything else click on tile 0 again. This click should deselect tile 0 (make it white again) but right now it does not happen.
  4. If tile 0 is clicked on again (two times including step 3) now it is deselected.

Desired behavior should be being able to deselect at the step 3 right? I think bug is in the following line: https://github.com/MFlisar/DragSelectRecyclerView/blob/9d8b02e89568ab5507564626f1231d82babe1e5a/library/src/main/java/com/michaelflisar/dragselectrecyclerview/DragSelectTouchListener.java#L200

break; needs to be changed to return false; Right now the function onInterceptTouchEvent will return true in the case MotionEvent.ACTION_DOWN: and the user does not receive an onClick event for the ViewHolder of tile 0 .

Current behavior:

Desired behavior:

thadikari avatar Jan 05 '19 20:01 thadikari