Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9f1221f8 authored by Mindy Pereira's avatar Mindy Pereira
Browse files

Add isQuickScaleEnabled to ScaleGestureDetector

Change-Id: I23dabb8bec69573ca833e06a4fd36435c75d7d04
parent 6b2b8459
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -27246,6 +27246,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);
  }
+12 −4
Original line number Diff line number Diff line
@@ -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.
     */