L - listener that will be called with gesture events/updates.@UiThread
public abstract class BaseGesture<L>
extends java.lang.Object
| 限定符和类型 | 字段和说明 |
|---|---|
protected android.content.Context |
context |
protected L |
listener
Listener that will be called with gesture events/updates.
|
| 构造器和说明 |
|---|
BaseGesture(android.content.Context context,
PalmapGesturesManager gesturesManager) |
| 限定符和类型 | 方法和说明 |
|---|---|
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 L listener
public BaseGesture(android.content.Context context,
PalmapGesturesManager 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