Package arc.input
Interface GestureDetector.GestureListener
- All Known Implementing Classes:
DesktopInput
,InputHandler
,MapView
,MobileInput
- Enclosing class:
- GestureDetector
public static interface GestureDetector.GestureListener
Register an instance of this class with a
GestureDetector
to receive gestures such as taps, long presses, flings,
panning or pinch zooming. Each method returns a boolean indicating if the event should be handed to the next listener (false
to hand it to the next listener, true otherwise).-
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
Called when the user dragged a finger over the screen and lifted it.default boolean
longPress
(float x, float y) default boolean
pan
(float x, float y, float deltaX, float deltaY) Called when the user drags a finger over the screen.default boolean
Called when no longer panning.default boolean
Called when a user performs a pinch zoom gesture.default void
Called when no longer pinching.default boolean
Called when a tap occured.default boolean
default boolean
zoom
(float initialDistance, float distance) Called when the user performs a pinch zoom gesture.
-
Method Details
-
touchDown
-
tap
Called when a tap occured. A tap happens if a touch went down on the screen and was lifted again without moving outside of the tap square. The tap square is a rectangular area around the initial touch position as specified on construction time of theGestureDetector
.- Parameters:
count
- the number of taps.
-
longPress
default boolean longPress(float x, float y) -
fling
Called when the user dragged a finger over the screen and lifted it. Reports the last known velocity of the finger in pixels per second.- Parameters:
velocityX
- velocity on x in secondsvelocityY
- velocity on y in seconds
-
pan
default boolean pan(float x, float y, float deltaX, float deltaY) Called when the user drags a finger over the screen.- Parameters:
deltaX
- the difference in pixels to the last drag event on x.deltaY
- the difference in pixels to the last drag event on y.
-
panStop
Called when no longer panning. -
zoom
default boolean zoom(float initialDistance, float distance) Called when the user performs a pinch zoom gesture. The original distance is the distance in pixels when the gesture started.- Parameters:
initialDistance
- distance between fingers when the gesture started.distance
- current distance between fingers.
-
pinch
Called when a user performs a pinch zoom gesture. Reports the initial positions of the two involved fingers and their current positions. -
pinchStop
default void pinchStop()Called when no longer pinching.
-