L - listener that will be called with gesture events/updates.public abstract class BaseGesture<L>
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected android.content.Context |
context |
protected L |
listener
Listener that will be called with gesture events/updates.
|
protected android.view.WindowManager |
windowManager |
| Constructor and Description |
|---|
BaseGesture(android.content.Context context,
AndroidGesturesManager gesturesManager) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract boolean |
analyzeEvent(android.view.MotionEvent motionEvent) |
protected boolean |
canExecute(int invokedGestureType) |
android.view.MotionEvent |
getCurrentEvent()
Returns most recent event in this gesture chain.
|
long |
getGestureDuration()
Returns a difference in millis between
MotionEvent.getDownTime() and MotionEvent.getEventTime()
(most recent event's time) associated with this gesture. |
android.view.MotionEvent |
getPreviousEvent()
Returns previous event in this gesture chain.
|
boolean |
isEnabled()
Check whether this detector accepts and analyzes motion events.
|
protected boolean |
onTouchEvent(android.view.MotionEvent motionEvent) |
protected void |
removeListener() |
void |
setEnabled(boolean enabled)
Set whether this detector should accept and analyze motion events.
|
protected void |
setListener(L listener) |
protected final android.content.Context context
protected final android.view.WindowManager windowManager
protected L listener
public BaseGesture(android.content.Context context,
AndroidGesturesManager gesturesManager)
protected boolean onTouchEvent(android.view.MotionEvent motionEvent)
protected abstract boolean analyzeEvent(android.view.MotionEvent motionEvent)
protected boolean canExecute(int invokedGestureType)
protected void setListener(L listener)
protected void removeListener()
public long getGestureDuration()
MotionEvent.getDownTime() and MotionEvent.getEventTime()
(most recent event's time) associated with this gesture.
This is a duration of the user's total interaction with the touch screen, accounting for the time before the gesture was recognized by the detector.
public android.view.MotionEvent getCurrentEvent()
public android.view.MotionEvent getPreviousEvent()
public boolean isEnabled()
public void setEnabled(boolean enabled)
enabled - true if it should analyze, false otherwise