public static class EnchancedGestureDetector.SimpleOnGestureListener extends Object implements EnchancedGestureDetector.OnGestureListener
EnchancedGestureDetector.OnGestureListener but does nothing and
return false for all applicable methods.| Constructor and Description |
|---|
SimpleOnGestureListener() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
onDown(MotionEvent e)
Notified when a tap occurs with the down
MotionEvent
that triggered it. |
boolean |
onFling(MotionEvent e1,
MotionEvent e2,
float velocityX,
float velocityY)
Notified of a fling event when it occurs with the initial on down
MotionEvent
and the matching up MotionEvent. |
void |
onHidePress()
The user has performed a move or up
MotionEvent. |
void |
onLongPress(MotionEvent e)
Notified when a long press occurs with the initial on down
MotionEvent
that trigged it. |
boolean |
onScroll(MotionEvent first,
MotionEvent previous,
MotionEvent current,
float distanceX,
float distanceY)
Notified when a scroll occurs with the initial on down
MotionEvent and the
current move MotionEvent. |
boolean |
onScrollBegin(MotionEvent e)
Notified when a scroll begins with the initial on down
MotionEvent |
void |
onShowPress(MotionEvent e)
The user has performed a down
MotionEvent and not performed
a move or up yet. |
boolean |
onSingleTapUp(MotionEvent e)
Notified when a tap occurs with the up
MotionEvent
that triggered it. |
void |
onUp(MotionEvent e) |
public boolean onDown(@NonNull MotionEvent e)
MotionEvent
that triggered it. This will be triggered immediately for
every down event. All other events should be preceded by this.onDown in interface EnchancedGestureDetector.OnGestureListenere - The down motion event.public void onShowPress(@NonNull MotionEvent e)
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.onShowPress in interface EnchancedGestureDetector.OnGestureListenere - The down motion eventpublic boolean onSingleTapUp(@NonNull MotionEvent e)
MotionEvent
that triggered it.onSingleTapUp in interface EnchancedGestureDetector.OnGestureListenere - The up motion event that completed the first tappublic void onLongPress(@NonNull MotionEvent e)
MotionEvent
that trigged it.onLongPress in interface EnchancedGestureDetector.OnGestureListenere - The initial on down motion event that started the longpress.public boolean onFling(@NonNull MotionEvent e1, @NonNull MotionEvent e2, float velocityX, float velocityY)
MotionEvent
and the matching up MotionEvent. The calculated velocity is supplied along
the x and y axis in pixels per second.onFling in interface EnchancedGestureDetector.OnGestureListenere1 - The first down motion event that started the fling.e2 - The move motion event that triggered the current onFling.velocityX - The velocity of this fling measured in pixels per second
along the x axis.velocityY - The velocity of this fling measured in pixels per second
along the y axis.public boolean onScrollBegin(@NonNull MotionEvent e)
MotionEventonScrollBegin in interface EnchancedGestureDetector.OnGestureListenere - The first down motion event that started the scrolling.e1public boolean onScroll(@NonNull MotionEvent first, @NonNull MotionEvent previous, @NonNull MotionEvent current, float distanceX, float distanceY)
MotionEvent and the
current move MotionEvent. The distance in x and y is also supplied for
convenience.onScroll in interface EnchancedGestureDetector.OnGestureListenerfirst - The first down motion event that started the scrolling.previous - The move motion event that happen before the current event.current - The move motion event that triggered the current onScroll.distanceX - The distance along the X axis that has been scrolled since the last
call to onScroll. This is NOT the distance between e1
and e2.distanceY - The distance along the Y axis that has been scrolled since the last
call to onScroll. This is NOT the distance between e1
and e2.public void onHidePress()
MotionEvent.
This event is commonly used to provide visual feedback to the user
to let them know that their primary action has been cancelled
i.e. remove highlight from an element.onHidePress in interface EnchancedGestureDetector.OnGestureListenerpublic void onUp(@NonNull MotionEvent e)
onUp in interface EnchancedGestureDetector.OnGestureListener