-
public abstract class GestureFinderBase class for gesture finders. Gesture finders are passed down touch events to detect gestures.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceGestureFinder.Controller
-
Method Summary
Modifier and Type Method Description voidsetActive(boolean active)Makes this instance active, which means, listening to events. booleanisActive()Whether this instance is active, which means, it is listeningto events and identifying new gestures. final booleanonTouchEvent(@NonNull() MotionEvent event)Called when new events are available. final GesturegetGesture()Returns the gesture that this instance is currently detecting.This is mutable - for instance, a scroll layout can detect bothhorizontal and vertical scroll gestures. final Array<PointF>getPoints()Returns an array of points that identify the currentlydetected gesture. final floatcomputeValue(float currValue, float minValue, float maxValue)For CONTINUOUS gestures, returns the float value at the currentgesture state. -
-
Method Detail
-
setActive
void setActive(boolean active)
Makes this instance active, which means, listening to events.
- Parameters:
active- whether this should be active or not
-
isActive
boolean isActive()
Whether this instance is active, which means, it is listeningto events and identifying new gestures.
-
onTouchEvent
final boolean onTouchEvent(@NonNull() MotionEvent event)
Called when new events are available.If true is returned, users will call getGesture, getPoints and maybe getValue to know more about the gesture.
- Parameters:
event- the new event
-
getGesture
@NonNull() final Gesture getGesture()
Returns the gesture that this instance is currently detecting.This is mutable - for instance, a scroll layout can detect bothhorizontal and vertical scroll gestures.
-
getPoints
@NonNull() final Array<PointF> getPoints()
Returns an array of points that identify the currentlydetected gesture. If no gesture was detected, this returnsan array of points with x and y set to 0.
-
computeValue
final float computeValue(float currValue, float minValue, float maxValue)
For CONTINUOUS gestures, returns the float value at the currentgesture state. This means, for example, scaling the old value with a pinch factor,taking into account the minimum and maximum values.
- Parameters:
currValue- the last valueminValue- the min possible valuemaxValue- the max possible value
-
-
-
-