balysv / material-ripple

Android L Ripple effect wrapper for Views
Apache License 2.0
2.36k stars 479 forks source link

onItemClick is called after onItemLongClick in ListView #15

Closed semsamot closed 9 years ago

semsamot commented 9 years ago

Hi,

At first, thank you for the awesome library! I tried it in a ListView with setting app:rippleInAdapter="true", When I long click on an item in the list, the listener correctly called but immediately after releasing touch (MotionEvent.ACTION_UP) the onItemClick method of OnItemClickListener get called! even if returning true in onItemLongClick method!

I've tested it with a normal FrameLayout and it hasn't any problem...

I suggest you forget about LongClick in your click handling mechanism for the layout...

Bubumuk commented 9 years ago

I just had the same issue. onItemClick fires even though you handle onLongItemClick.

samigehi commented 9 years ago

had same issue with me but i solve this ref http://stackoverflow.com/a/27378010/2685454

linfaxin commented 9 years ago

I have fix the bug, and pull request: https://github.com/balysv/material-ripple/pull/20

balysv commented 9 years ago

Fix in 2b853c371411845beb5f2f9624b2c5c784800025