diff options
| -rw-r--r-- | api/current.txt | 1 | ||||
| -rw-r--r-- | core/java/android/view/ScaleGestureDetector.java | 16 |
2 files changed, 13 insertions, 4 deletions
diff --git a/api/current.txt b/api/current.txt index e50e57f7b01c..cbed2e78f7cc 100644 --- a/api/current.txt +++ b/api/current.txt @@ -27337,6 +27337,7 @@ package android.view { method public float getScaleFactor(); method public long getTimeDelta(); method public boolean isInProgress(); + method public boolean isQuickScaleEnabled(); method public boolean onTouchEvent(android.view.MotionEvent); method public void setQuickScaleEnabled(boolean); } diff --git a/core/java/android/view/ScaleGestureDetector.java b/core/java/android/view/ScaleGestureDetector.java index a0d39ca9c9ec..f36c78fd4807 100644 --- a/core/java/android/view/ScaleGestureDetector.java +++ b/core/java/android/view/ScaleGestureDetector.java @@ -130,7 +130,7 @@ public class ScaleGestureDetector { private float mFocusX; private float mFocusY; - private boolean mDoubleTapScales; + private boolean mQuickScaleEnabled; private float mCurrSpan; private float mPrevSpan; @@ -307,7 +307,7 @@ public class ScaleGestureDetector { final int action = event.getActionMasked(); // Forward the event to check for double tap gesture - if (mDoubleTapScales) { + if (mQuickScaleEnabled) { mGestureDetector.onTouchEvent(event); } @@ -456,8 +456,8 @@ public class ScaleGestureDetector { * @param scales true to enable quick scaling, false to disable */ public void setQuickScaleEnabled(boolean scales) { - mDoubleTapScales = scales; - if (mDoubleTapScales && mGestureDetector == null) { + mQuickScaleEnabled = scales; + if (mQuickScaleEnabled && mGestureDetector == null) { GestureDetector.SimpleOnGestureListener gestureListener = new GestureDetector.SimpleOnGestureListener() { @Override @@ -472,6 +472,14 @@ public class ScaleGestureDetector { } } + /** + * Return whether the quick scale gesture, in which the user performs a double tap followed by a + * swipe, should perform scaling. {@see #setQuickScaleEnabled(boolean)}. + */ + public boolean isQuickScaleEnabled() { + return mQuickScaleEnabled; + } + /** * Returns {@code true} if a scale gesture is in progress. */ |