Page Summary
-
BaseGestureRecognizerserves as the foundation for gesture recognition in Sceneform, such as drag, pinch, and twist gestures. -
It processes touch input to identify gesture starts and triggers corresponding events.
-
Developers can listen to gesture object events to track gesture updates and completion.
-
Gesture Recognizers are extended by concrete classes like
DragGestureRecognizer,PinchGestureRecognizer, andTwistGestureRecognizerto handle specific user interactions. -
BaseGestureRecognizerincludes methods to add and remove gesture start listeners, as well as an abstract methodtryCreateGesturesto be implemented by subclasses for gesture creation logic.
| DragGestureRecognizer | Gesture Recognizer for when the user performs a drag motion on the touch screen. |
| PinchGestureRecognizer | Gesture Recognizer for when the user performs a two-finger pinch motion on the touch screen. |
| TwistGestureRecognizer | Gesture Recognizer for when the user performs a two-finger twist motion on the touch screen. |
Base class for all Gesture Recognizers (i.e. DragGestureRecognizer).
A Gesture recognizer processes touch input to determine if a gesture should start and fires an event when the gesture is started.
To determine when an gesture is finished/updated, listen to the events on the gesture object.
Nested Classes
Fields
| protected final GesturePointersUtility | gesturePointersUtility | * |
| protected final ArrayList <T extends BaseGesture <T>> | gestures | * |
|---|
Public Constructors
Public Methods
| void | |
| void | |
| void |
Protected Methods
Inherited Methods
Fields
protected final GesturePointersUtility gesturePointersUtility
protected final ArrayList <T extends BaseGesture <T>> gestures
Public Constructors
public BaseGestureRecognizer ( GesturePointersUtility gesturePointersUtility)
Parameters
Public Methods
public void addOnGestureStartedListener ( OnGestureStartedListener <T> listener)
Parameters
public void onTouch ( HitTestResult hitTestResult, MotionEvent motionEvent)
Parameters
| hitTestResult |
|---|
| motionEvent |
public void removeOnGestureStartedListener ( OnGestureStartedListener <T> listener)
Parameters
Protected Methods
protected abstract void tryCreateGestures ( HitTestResult hitTestResult, MotionEvent motionEvent)
Parameters
| hitTestResult |
|---|
| motionEvent |

