Fabulous icon indicating copy to clipboard operation
Fabulous copied to clipboard

onTouchEvent only called with MotionEvent.Action_Down

Open mikef-dk opened this issue 10 years ago • 2 comments

There's an error in the library right inside the onTouchEvent method. It always jumps into the else-clause, because of this the Button is always tinted with the darkened color.

Fix: Change return super.onTouchEvent(event); to return true. This notifies the system that the event was handled and thus the method can retrieve the next Action. (Like MotionEvent.ActionUp)

mikef-dk avatar Sep 04 '14 21:09 mikef-dk

Additional change that's needed:
Inside the if (event.getAction() == MotionEvent.ACTION_UP) clause, performClick() must be called. Otherwise setting an onClickListener won't work (onClick won't be called).

mikef-dk avatar Sep 05 '14 09:09 mikef-dk

Perfect, thanks alot

rsicarelli avatar Sep 30 '14 14:09 rsicarelli