diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2023-01-17 08:31:54 +0100 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2023-01-17 11:08:21 +0000 |
commit | 7c399767053b1cc6f68beccfbbb084c2891fe05e (patch) | |
tree | bdf865f6b87992b91a5b369df59151d6f4faef7d /android | |
parent | a1f16b4603bffddb2f6380874d63f928289de85a (diff) |
android: Drop superfluous ZoomConstraints#mAllow{,DoubleTap}Zoom
Both members are always set to true since
commit 9ab43aebad67383057d2cc3f754ce2193fa78b4e
Date: Wed Dec 4 17:18:20 2019 +0100
android: Allow zooming for Calc as well
, so drop the two now superfluous members and
getters.
Change-Id: I702874f1d9161e5cef660bb4c4a0b7864d6e3c09
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145657
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'android')
3 files changed, 5 insertions, 25 deletions
diff --git a/android/source/src/java/org/libreoffice/LOKitThread.java b/android/source/src/java/org/libreoffice/LOKitThread.java index c29f98461fb9..27568ace5599 100644 --- a/android/source/src/java/org/libreoffice/LOKitThread.java +++ b/android/source/src/java/org/libreoffice/LOKitThread.java @@ -186,7 +186,7 @@ class LOKitThread extends Thread { mLayerClient = mContext.getLayerClient(); // Set min zoom to the page width so that you cannot zoom below page width final float minZoom = mLayerClient.getViewportMetrics().getWidth()/mTileProvider.getPageWidth(); - mLayerClient.setZoomConstraints(new ZoomConstraints(true, 1f, minZoom, 0f)); + mLayerClient.setZoomConstraints(new ZoomConstraints(1f, minZoom, 0f)); } /** diff --git a/android/source/src/java/org/mozilla/gecko/ZoomConstraints.java b/android/source/src/java/org/mozilla/gecko/ZoomConstraints.java index f1672ba3dd76..dbe278827279 100644 --- a/android/source/src/java/org/mozilla/gecko/ZoomConstraints.java +++ b/android/source/src/java/org/mozilla/gecko/ZoomConstraints.java @@ -6,28 +6,16 @@ package org.mozilla.gecko; public final class ZoomConstraints { - private final boolean mAllowZoom; - private final boolean mAllowDoubleTapZoom; private final float mDefaultZoom; private final float mMinZoom; private final float mMaxZoom; - public ZoomConstraints(boolean allowZoom, float defaultZoom, float minZoom, float maxZoom) { - mAllowZoom = allowZoom; - mAllowDoubleTapZoom = allowZoom; + public ZoomConstraints(float defaultZoom, float minZoom, float maxZoom) { mDefaultZoom = defaultZoom; mMinZoom = minZoom; mMaxZoom = maxZoom; } - public final boolean getAllowZoom() { - return mAllowZoom; - } - - public final boolean getAllowDoubleTapZoom() { - return mAllowDoubleTapZoom; - } - public final float getDefaultZoom() { return mDefaultZoom; } diff --git a/android/source/src/java/org/mozilla/gecko/gfx/JavaPanZoomController.java b/android/source/src/java/org/mozilla/gecko/gfx/JavaPanZoomController.java index 697980af397d..ef3d28e8ebb3 100644 --- a/android/source/src/java/org/mozilla/gecko/gfx/JavaPanZoomController.java +++ b/android/source/src/java/org/mozilla/gecko/gfx/JavaPanZoomController.java @@ -744,11 +744,6 @@ class JavaPanZoomController if (constraints.getMaxZoom() > 0) maxZoomFactor = constraints.getMaxZoom(); - if (!constraints.getAllowZoom()) { - // If allowZoom is false, clamp to the default zoom level. - maxZoomFactor = minZoomFactor = constraints.getDefaultZoom(); - } - maxZoomFactor = Math.max(maxZoomFactor, minZoomFactor); if (zoomFactor < minZoomFactor) { @@ -821,7 +816,7 @@ class JavaPanZoomController if (mState == PanZoomState.ANIMATED_ZOOM) return false; - if (null == mTarget.getZoomConstraints() || !mTarget.getZoomConstraints().getAllowZoom()) + if (null == mTarget.getZoomConstraints()) return false; setState(PanZoomState.PINCHING); @@ -927,10 +922,7 @@ class JavaPanZoomController @Override public boolean onDown(MotionEvent motionEvent) { - if (mTarget.getZoomConstraints() != null) - mWaitForDoubleTap = mTarget.getZoomConstraints().getAllowDoubleTapZoom(); - else - mWaitForDoubleTap = false; + mWaitForDoubleTap = mTarget.getZoomConstraints() != null; return false; } @@ -984,7 +976,7 @@ class JavaPanZoomController @Override public boolean onDoubleTap(MotionEvent motionEvent) { - if (null == mTarget.getZoomConstraints() || !mTarget.getZoomConstraints().getAllowDoubleTapZoom()) { + if (null == mTarget.getZoomConstraints()) { return true; } // Double tap zooms in or out depending on the current zoom factor |