I have a view that need to process onTouch gestures and onClick events. What is the proper way to achieve this?
I have an onTouchListener and an onClickListener set on the view. Whenever I do touch the view, first the onTouch event is triggered and later the onClick. However, from the onTouch event handler I have to return either true or false. Returning true means that the event is being consumed, so the android event system will not propagate the event any further.
Therefore, an onClick event is never generated, atleast my onClick listener is never triggered when I return true in my onTouch event handler. On the other hand, returning false there is not an option, since this prevents the onTouch listener from receiving any further events that are necessary in order to recognize a gesture. What's the usual way of solving this?
onTouchListener? A click is a sequence of at least two touch events, where theACTION_DOWNevent is fired at the very same position (or at least over the very same view) as the laterACTION_UPevent. Sure, one could implement this, and I will if there is no other solution. But my question is indeed, whether there is a built-in solution for this scenario? - theV0IDOnGestureListener- theV0ID