summaryrefslogtreecommitdiffstats
path: root/android
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2019-12-04 17:18:20 +0100
committerMichael Weghorn <m.weghorn@posteo.de>2019-12-04 22:19:41 +0100
commit9ab43aebad67383057d2cc3f754ce2193fa78b4e (patch)
tree7c171cebed526957367fabe60e71c93119a1a23d /android
parentfix manual insert into a size group (diff)
downloadcore-9ab43aebad67383057d2cc3f754ce2193fa78b4e.tar.gz
core-9ab43aebad67383057d2cc3f754ce2193fa78b4e.zip
android: Allow zooming for Calc as well
The comment mentioning "Calc has a fixed zoom at 1x and doesn't allow zooming for now" was there since support for the Calc UI was added in commit 02f3c4848ab52358bfee56c570a19a3a071574f2 ("Calc UI on Android Viewer") in 2017. That seems no longer to be the case however, probably since commit 498dceb43f870bf9e380f1f87e99c6ccadf1963c ("sc lok: Implement hi-dpi and zoom for spreadsheets."). Zooming in and out was working just fine when I tested this with Android Viewer using a spreadsheet containing some text and numbers, as well as a chart and an image. Therefore, allow zooming for Calc as well. Don't allow to set min zoom below the page width for Calc as somewhat suggested by the existing comment ("applies to all types of document; in the future spreadsheets may be singled out"). I don't see a particular reason for this and using 0f for minZoom would break double-tap zoom. Change-Id: Ib08439edbbac59a00005213b533df5792da965ee Reviewed-on: https://gerrit.libreoffice.org/84421 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'android')
-rw-r--r--android/source/src/java/org/libreoffice/LOKitThread.java12
1 files changed, 3 insertions, 9 deletions
diff --git a/android/source/src/java/org/libreoffice/LOKitThread.java b/android/source/src/java/org/libreoffice/LOKitThread.java
index 846e6658d7cd..c9d1fa0508bd 100644
--- a/android/source/src/java/org/libreoffice/LOKitThread.java
+++ b/android/source/src/java/org/libreoffice/LOKitThread.java
@@ -183,15 +183,9 @@ class LOKitThread extends Thread {
private void updateZoomConstraints() {
if (mTileProvider == null) return;
mLayerClient = mContext.getLayerClient();
- if (mTileProvider.isSpreadsheet()) {
- // Calc has a fixed zoom at 1x and doesn't allow zooming for now
- mLayerClient.setZoomConstraints(new ZoomConstraints(false, 1f, 0f, 0f));
- } else {
- // Set min zoom to the page width so that you cannot zoom below page width
- // applies to all types of document; in the future spreadsheets may be singled out
- float minZoom = mLayerClient.getViewportMetrics().getWidth()/mTileProvider.getPageWidth();
- mLayerClient.setZoomConstraints(new ZoomConstraints(true, 1f, minZoom, 0f));
- }
+ // 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));
}