com.google.android.maps.TrackballGestureDetector
Analyzes a series of MotionEvent and detects gestures.
Right now only very simple gestures are detected:
scroll, tap, and double-tap.
Summary
Public Methods
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
Details
Public Methods
public
void
analyze(MotionEvent ev)
Analyze a MotionEvent. Call this once for each MotionEvent
that is received by a view.
Parameters
ev
| The MotionEvent to analyze.
|
public
float
getCurrentDownX()
Returns the X-cordinate position of the current tap event.
This value is only defined if either
isTap() is true.
Returns
- The X position of the current tap event.
public
float
getCurrentDownY()
Returns the Y-cordinate position of the current tap event.
This value is only defined if either
isTap() is true.
Returns
- The Y position of the current tap event.
public
float
getFirstDownX()
Returns the X-cordinate position of the current double-tap event.
This value is only defined if
isDoubleTap() is true.
Returns
- The X position of the (first tap in a) double-tap event.
public
float
getFirstDownY()
Returns the Y-cordinate position of the current double-tap event.
This value is only defined if
isDoubleTap() is true.
Returns
- The Y position of the (first tap in a) double-tap event.
public
boolean
isDoubleTap()
Checks whether the current MotionEvent is a double-tap event.
Returns
- True if the current motion event is a double-tap
event; false otherwise.
public
boolean
isScroll()
Checks whether the current MotionEvent is a scroll event.
Returns
- True if the current motion event is a scroll
event; false otherwise.
public
boolean
isTap()
Checks whether the current MotionEvent is a single-tap event.
Returns
- True if the current motion event is a single-tap
event; false otherwise.
public
void
registerLongPressCallback(Runnable runnable)
Register a runnable to be called when a longPress event is detected.
Parameters
runnable
| The runnable to use for the callback.
|
public
float
scrollX()
Returns the X-coordinate position of the current scroll event.
This value is only defined if
isScroll() is true.
Returns
- the X position of the current scroll event.
public
float
scrollY()
Returns the Y-coordinate position of the current scroll event.
This value is only defined if
isScroll() is true.
Returns
- the Y position of the current scroll event.