AI-generated Key Takeaways
-
PinchGestureclass detects and tracks two-finger pinch gestures on a touchscreen. -
It provides methods to calculate the distance between the fingers (gap) and changes in this distance (gap delta) in both pixels and inches.
-
Developers can use the
OnGestureEventListenerinterface to receive callbacks for gesture events like start, finish, and cancel. -
PinchGestureinherits functionality fromBaseGesture, allowing for gesture management and interaction with Sceneform nodes. -
This class is essential for implementing interactive features that respond to user pinch gestures within AR applications built with Sceneform.
Gesture for when the user performs a two-finger pinch motion on the touch screen.
Nested Classes
| interface | PinchGesture.OnGestureEventListener | Interface definition for callbacks to be invoked by a PinchGesture. |
|
Inherited Fields
Public Constructors
|
PinchGesture(GesturePointersUtility gesturePointersUtility, MotionEvent motionEvent, int pointerId2)
|
Public Methods
| void |
cancel()
Cancels the gesture in progress.
|
| float | |
| float | |
| float |
getGap()
|
| float |
Protected Methods
| boolean | |
| PinchGesture |
getSelf()
|
| void |
onCancel()
|
| void |
onFinish()
|
| void | |
| boolean |
Inherited Methods
Public Constructors
public PinchGesture (GesturePointersUtility gesturePointersUtility, MotionEvent motionEvent, int pointerId2)
Parameters
| gesturePointersUtility | |
|---|---|
| motionEvent | |
| pointerId2 |
Public Methods
public void cancel ()
Cancels the gesture in progress.
public float gapDeltaInches ()
public float gapInches ()
public float getGap ()
public float getGapDelta ()
Protected Methods
protected boolean canStart (HitTestResult hitTestResult, MotionEvent motionEvent)
Parameters
| hitTestResult | |
|---|---|
| motionEvent |
protected void onCancel ()
protected void onFinish ()
protected void onStart (HitTestResult hitTestResult, MotionEvent motionEvent)
Parameters
| hitTestResult | |
|---|---|
| motionEvent |
protected boolean updateGesture (HitTestResult hitTestResult, MotionEvent motionEvent)
Parameters
| hitTestResult | |
|---|---|
| motionEvent |