L - listener that will be called with gesture events/updates.public abstract class BaseGesture<L> extends Object
| Modifier and Type | Field and Description |
|---|---|
protected Context |
context |
protected L |
listener
Listener that will be called with gesture events/updates.
|
protected WindowManager |
windowManager |
| Constructor and Description |
|---|
BaseGesture(Context context,
AndroidGesturesManager gesturesManager) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract boolean |
analyzeEvent(MotionEvent motionEvent) |
protected boolean |
canExecute(int invokedGestureType) |
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. |
MotionEvent |
getPreviousEvent()
Returns previous event in this gesture chain.
|
boolean |
isEnabled()
Check whether this detector accepts and analyzes motion events.
|
protected boolean |
onTouchEvent(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 Context context
protected final WindowManager windowManager
protected L listener
public BaseGesture(Context context, AndroidGesturesManager gesturesManager)
protected boolean onTouchEvent(MotionEvent motionEvent)
protected abstract boolean analyzeEvent(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 MotionEvent getCurrentEvent()
public MotionEvent getPreviousEvent()
public boolean isEnabled()
public void setEnabled(boolean enabled)
enabled - true if it should analyze, false otherwise© 2015–2019 Mapbox. All rights reserved.