What is the difference between onSingleTapConfirmed
and onSingleTapUp
in GestureDetector.SimpleOnGestureListener
? Which one of these is similar to onClick
methods?
onSingleTapConfirmed. Notified when a single-tap occurs. Unlike OnGestureListener#onSingleTapUp(MotionEvent) , this will only be called after the detector is confident that the user's first tap is not followed by a second tap leading to a double-tap gesture.
onShowPress The user has performed a down MotionEvent and not performed a move or up yet. This event is commonly used to provide visual feedback to the user to let them know that their action has been recognized i.e. highlight an element.
According to the GestureDetector.SimpleOnGestureListener
documentation,
onSingleTapConfirmed
Notified when a single-tap occurs.
Unlike
onSingleTapUp(MotionEvent)
, this will only be called after the detector is confident that the user's first tap is not followed by a second tap leading to a double-tap gesture.
onSingleTapUp
Notified when a tap occurs with the up MotionEvent that triggered it.
I think the onClick
method is similar to onSingleTapConfirmed
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With