com.google.android.maps.TouchGestureDetector
Analyzes a series of motion events and detects gestures.
Right now only very simple gestures are detected:
scroll, tap, and double-tap.
Summary
Public Constructors
Public Methods
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
Details
Public Constructors
public
TouchGestureDetector(Handler handler)
Public Methods
public
void
analyze(MotionEvent ev, int width)
Analyze a motion event. Call this once for each motion event
that is received by a view.
Parameters
| ev
| the motion event to analyze.
|
public
float
getCurrentDownX()
This value is only defined if either
isTap() is true.
Returns
- the X position of the current tap event.
public
float
getCurrentDownY()
This value is only defined if either
isTap() is true.
Returns
- the Y position of the current tap event.
public
float
getFirstDownX()
This value is only defined if
isDoubleTap() is true. This returns
the X position of the first down X in the double tap.
Returns
- the X position of the double tap event.
public
float
getFirstDownY()
This value is only defined if
isDoubleTap() is true. This returns
the Y position of the first down Y in the double tap.
Returns
- the Y position of the double tap event.
public
boolean
isDoubleTap()
Returns
- true if the current motion event is a double-tap
event.
public
boolean
isEdgeZoomIn()
public
boolean
isEdgeZoomOut()
public
boolean
isEnteringEdgeZoomMode()
public
boolean
isExitingEdgeZoomMode()
public
boolean
isScroll()
Returns
- true if the current motion event is a scroll
event.
public
boolean
isTap()
Returns
- true if the current motion event is a single-tap
event.
public
void
registerLongPressCallback(Runnable runnable)
Register a runnable to be called when a longPress event is detected.
public
float
scrollX()
This value is only defined if
isScroll() is true.
Returns
- the X position of the current scroll event.
event.
public
float
scrollY()
This value is only defined if
isScroll() is true.
Returns
- the Y position of the current scroll event.
event.
public
void
setEdgeZoomingEnabled(boolean isEdgeZoomingEnabled)