- Sceneform SDK for Android
was open sourced and archived ( github.com/google-ar/sceneform-android-sdk
) with version 1.16.0.
- This site ( developers.google.com/sceneform
) serves as the documentation archive for the previous version, Sceneform SDK for Android
1.15.0.
- Do not use version 1.17.0 of the Sceneform Maven artifacts
.
- The 1.17.1 Maven artifacts can be used. Other than the version, however, the 1.17.1 artifacts are identical to the 1.15.0 artifacts.
PinchGesture
Stay organized with collections
Save and categorize content based on your preferences.
Gesture for when the user performs a two-finger pinch motion on the touch screen.
Nested Classes
interface
Interface definition for callbacks to be invoked by a PinchGesture
.
Inherited Methods
From class
java.lang.Object
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
void
onCancel
()
protected
void
onFinish
()
protected
boolean
updateGesture
( HitTestResult
hitTestResult, MotionEvent
motionEvent)
Parameters
hitTestResult |
motionEvent |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License
, and code samples are licensed under the Apache 2.0 License
. For details, see the Google Developers Site Policies
. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-06-26 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-06-26 UTC."],[[["\u003cp\u003e\u003ccode\u003ePinchGesture\u003c/code\u003e class detects and tracks two-finger pinch gestures on a touchscreen.\u003c/p\u003e\n"],["\u003cp\u003eIt provides methods to calculate the distance between the fingers (gap) and changes in this distance (gap delta) in both pixels and inches.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can use the \u003ccode\u003eOnGestureEventListener\u003c/code\u003e interface to receive callbacks for gesture events like start, finish, and cancel.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003ePinchGesture\u003c/code\u003e inherits functionality from \u003ccode\u003eBaseGesture\u003c/code\u003e, allowing for gesture management and interaction with Sceneform nodes.\u003c/p\u003e\n"],["\u003cp\u003eThis class is essential for implementing interactive features that respond to user pinch gestures within AR applications built with Sceneform.\u003c/p\u003e\n"]]],["The `PinchGesture` class manages two-finger pinch actions on a touchscreen. Key actions include: canceling (`cancel()`) an ongoing gesture; initiating (`onStart()`), finalizing (`onFinish()`), or aborting (`onCancel()`) gestures; and updating (`updateGesture()`) their state. It can determine if a gesture can start (`canStart()`). Information provided includes: the current gap (`getGap()`), change in gap (`getGapDelta()`), and these measurements in inches (`gapInches()`, `gapDeltaInches()`). The class interacts with `GesturePointersUtility`, `MotionEvent`, and `HitTestResult`.\n"],null,[]]