BaseGesture

public abstract class BaseGesture
Known Direct Subclasses

Base class for a gesture.

A gesture represents a sequence of touch events that are detected to represent a particular type of motion (i.e. Dragging, Pinching).

Gestures are created and updated by BaseGestureRecognizer's.

Nested Classes

interface BaseGesture.OnGestureEventListener<T extends BaseGesture<T>> Interface definition for callbacks to be invoked by a BaseGesture

Fields

protected final GesturePointersUtility gesturePointersUtility
protected Node targetNode

Public Constructors

BaseGesture(GesturePointersUtility gesturePointersUtility)

Public Methods

Node
boolean
boolean
float
inchesToPixels(float inches)
boolean
void
onTouch(HitTestResult hitTestResult, MotionEvent motionEvent)
float
pixelsToInches(float pixels)
void
boolean

Protected Methods

abstract boolean
canStart(HitTestResult hitTestResult, MotionEvent motionEvent)
void
cancel()
void
abstract T
abstract void
abstract void
abstract void
onStart(HitTestResult hitTestResult, MotionEvent motionEvent)
abstract boolean
updateGesture(HitTestResult hitTestResult, MotionEvent motionEvent)

Inherited Methods

Fields

protected final GesturePointersUtility gesturePointersUtility

protected Node targetNode

Public Constructors

public BaseGesture (GesturePointersUtility gesturePointersUtility)

Parameters
gesturePointersUtility

Public Methods

public Node getTargetNode ()

public boolean hasFinished ()

public boolean hasStarted ()

public float inchesToPixels (float inches)

Parameters
inches

public boolean justStarted ()

public void onTouch (HitTestResult hitTestResult, MotionEvent motionEvent)

Parameters
hitTestResult
motionEvent

public float pixelsToInches (float pixels)

Parameters
pixels

public void setGestureEventListener (OnGestureEventListener<T> listener)

Parameters
listener

public boolean wasCancelled ()

Protected Methods

protected abstract boolean canStart (HitTestResult hitTestResult, MotionEvent motionEvent)

Parameters
hitTestResult
motionEvent

protected void cancel ()

protected void complete ()

protected abstract T getSelf ()

protected abstract void onCancel ()

protected abstract void onFinish ()

protected abstract void onStart (HitTestResult hitTestResult, MotionEvent motionEvent)

Parameters
hitTestResult
motionEvent

protected abstract boolean updateGesture (HitTestResult hitTestResult, MotionEvent motionEvent)

Parameters
hitTestResult
motionEvent