public class MoveGestureDetector extends ProgressiveGesture<MoveGestureDetector.OnMoveGestureListener>
MoveGestureDetector serves similar purpose to
#onScroll(MotionEvent, MotionEvent, float, float), however, it's a ProgressiveGesture that
introduces MoveGestureDetector.OnMoveGestureListener.onMoveBegin(MoveGestureDetector),
MoveGestureDetector.OnMoveGestureListener.onMoveEnd(MoveGestureDetector, float, float),
threshold with setMoveThreshold(float) and multi finger support thanks to
MoveDistancesObject.
| Modifier and Type | Class and Description |
|---|---|
static interface |
MoveGestureDetector.OnMoveGestureListener |
static class |
MoveGestureDetector.SimpleOnMoveGestureListener |
context, listener, windowManager| Constructor and Description |
|---|
MoveGestureDetector(android.content.Context context,
AndroidGesturesManager gesturesManager) |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
analyzeEvent(android.view.MotionEvent motionEvent) |
protected boolean |
analyzeMovement() |
protected boolean |
canExecute(int invokedGestureType) |
protected void |
gestureStopped() |
float |
getLastDistanceX()
Returns X distance of the focal point in pixels
calculated during the last
MoveGestureDetector.OnMoveGestureListener.onMove(MoveGestureDetector, float, float) call. |
float |
getLastDistanceY()
Returns Y distance of the focal point in pixels
calculated during the last
MoveGestureDetector.OnMoveGestureListener.onMove(MoveGestureDetector, float, float) call. |
MoveDistancesObject |
getMoveObject(int pointerIndex)
Returns
MoveDistancesObject referencing the pointer held under passed index. |
float |
getMoveThreshold()
Get the delta pixel threshold required to qualify it as a move gesture.
|
android.graphics.RectF |
getMoveThresholdRect()
Get the screen area in which the move gesture cannot be started.
|
protected int |
getRequiredPointersCount() |
protected java.util.Set<java.lang.Integer> |
provideHandledTypes() |
protected void |
reset() |
void |
setMoveThreshold(float moveThreshold)
Set the delta pixel threshold required to qualify it as a move gesture.
|
void |
setMoveThresholdRect(android.graphics.RectF moveThresholdRect)
Set the screen area in which the move gesture cannot be started.
|
void |
setMoveThresholdResource(int moveThresholdDimen)
Set the delta dp threshold required to qualify it as a move gesture.
|
gestureStarted, interrupt, isInProgress, setEnabledgetCurrentSpan, getCurrentSpanX, getCurrentSpanY, getFocalPoint, getPointersCount, getPreviousSpan, getPreviousSpanX, getPreviousSpanY, getSpanThreshold, isSloppyGesture, setSpanThreshold, setSpanThresholdResourcegetCurrentEvent, getGestureDuration, getPreviousEvent, isEnabled, onTouchEvent, removeListener, setListenerpublic MoveGestureDetector(android.content.Context context,
AndroidGesturesManager gesturesManager)
protected java.util.Set<java.lang.Integer> provideHandledTypes()
provideHandledTypes in class ProgressiveGesture<MoveGestureDetector.OnMoveGestureListener>protected boolean analyzeEvent(android.view.MotionEvent motionEvent)
analyzeEvent in class ProgressiveGesture<MoveGestureDetector.OnMoveGestureListener>protected boolean analyzeMovement()
analyzeMovement in class MultiFingerGesture<MoveGestureDetector.OnMoveGestureListener>protected boolean canExecute(int invokedGestureType)
canExecute in class MultiFingerGesture<MoveGestureDetector.OnMoveGestureListener>protected void reset()
reset in class MultiFingerGesture<MoveGestureDetector.OnMoveGestureListener>protected void gestureStopped()
gestureStopped in class ProgressiveGesture<MoveGestureDetector.OnMoveGestureListener>protected int getRequiredPointersCount()
getRequiredPointersCount in class MultiFingerGesture<MoveGestureDetector.OnMoveGestureListener>public float getMoveThreshold()
getMoveThresholdRect()public void setMoveThreshold(float moveThreshold)
We encourage to set those values from dimens to accommodate for various screen sizes.
moveThreshold - delta thresholdsetMoveThresholdRect(RectF)public android.graphics.RectF getMoveThresholdRect()
setMoveThreshold(float).public void setMoveThresholdRect(android.graphics.RectF moveThresholdRect)
setMoveThreshold(float).moveThresholdRect - the screen area in which the gesture cannot be startedpublic void setMoveThresholdResource(int moveThresholdDimen)
moveThresholdDimen - delta thresholdpublic float getLastDistanceX()
MoveGestureDetector.OnMoveGestureListener.onMove(MoveGestureDetector, float, float) call.public float getLastDistanceY()
MoveGestureDetector.OnMoveGestureListener.onMove(MoveGestureDetector, float, float) call.public MoveDistancesObject getMoveObject(int pointerIndex)
MoveDistancesObject referencing the pointer held under passed index.
Pointers are sorted by the time they were placed on the screen until lifted up.
This means that index 0 will reflect the oldest added, still active pointer
and index (MultiFingerGesture.getPointersCount() - 1) will reflect the latest added, still active pointer.
pointerIndex - pointer's index