faizmalkani / Fabulous

[DEPRECATED]
MIT License
478 stars 117 forks source link

onTouchEvent only called with MotionEvent.Action_Down #16

Open mikef-dk opened 10 years ago

mikef-dk commented 10 years ago

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 commented 10 years ago

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).

rsicarelli commented 9 years ago

Perfect, thanks alot