emileb/DragSortRecycler

Click listener

Closed this issue · 5 comments

The DragSortRecylcer is intercepting all touch events. I have a click listener defined for the itemView that will never be invoked (which seems to be the recommended way to handle click events for RecyclerView). That will probably require some changes to your code in order to distinguish between a click event and a drag event. Any idea on how to handle this?

What have you got the drag handle set to, so are you clicking on the drag
handle? It should only intercept when touching the handle I think.
On 3 Jan 2015 19:47, "apuder" notifications@github.com wrote:

The DragSortRecylcer is intercepting all touch events. I have a click
listener defined for the itemView that will never be invoked (which seems
to be the recommended way to handle click events for RecyclerView). That
will probably require some changes to your code in order to distinguish
between a click event and a drag event. Any idea on how to handle this?

Reply to this email directly or view it on GitHub
#8.

Well, I set the handle to the top-level view, which explains why it gobbles up all touch events. One solution would be to make the draggable-area only one area of the itemView allowing the other area for click events. However, I don't think that is very intuitive and user-friendly. I would expect that I can drag from anywhere in the itemView just like I want to single-click (or long-click for a context menu) from anywhere as well.

Ah OK I see, yes I presumed one would have a specific place on the view you
use to drag because otherwise you wouldn't be able to scroll the list up
and down if it was bigger than the screen.
On 3 Jan 2015 20:14, "apuder" notifications@github.com wrote:

Well, I set the handle to the top-level view, which explains why it
gobbles up all touch events. One solution would be to make the
draggable-area only one area of the itemView allowing the other area for
click events. However, I don't think that is very intuitive and
user-friendly. I would expect that I can drag from anywhere in the itemView
just like I want to single-click (or long-click for a context menu) from
anywhere as well.

Reply to this email directly or view it on GitHub
#8 (comment)
.

That is a good point. If the whole itemView is draggable you can no longer distinguish between dragging and scrolling. I guess you are right to do it that way. I'll close this issue.

OK if this become an issue or you think of anything else please let me
know

On 3 Jan 2015 20:28, "apuder" notifications@github.com wrote:

That is a good point. If the whole itemView is draggable you can no longer
distinguish between dragging and scrolling. I guess you are right to do it
that way. I'll close this issue.


Reply to this email directly or view it on GitHub
#8 (comment)
.