android/source/src/java/org/libreoffice/LOKitShell.java | 2 +- android/source/src/java/org/libreoffice/LOKitThread.java | 2 +- android/source/src/java/org/mozilla/gecko/gfx/GeckoLayerClient.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
New commits: commit 95e6108c20f8035ec837ea852fc2285b9677d5f1 Author: Michael Weghorn <[email protected]> AuthorDate: Thu Nov 13 15:08:56 2025 +0100 Commit: Michael Weghorn <[email protected]> CommitDate: Fri Nov 14 11:58:13 2025 +0100 tdf#169422 android: Adjust doc pos + zoom on window size change When the size of the app window for LibreOffice Viewer changes (e.g. because a user manually resized the window on a desktop device or when rotating a device), recalculate the document position and zoom factor to make proper use of the newly available space. On app window resize/rotation, GeckoLayerClient sends a LOEvent.SIZE_CHANGED event (see e.g. GeckoLayerClient.setViewportSize). In order to achieve the desired result, adjust the corresponding event handler to call LOKitThread.redraw with a `resetZoomAndPosition` param of true instead of false. Change-Id: I2a088975e6083ce72641c8e2ea9d111015fb50bf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193967 Tested-by: Jenkins Reviewed-by: Michael Weghorn <[email protected]> diff --git a/android/source/src/java/org/libreoffice/LOKitThread.java b/android/source/src/java/org/libreoffice/LOKitThread.java index fd40c3089102..05e748582ba6 100644 --- a/android/source/src/java/org/libreoffice/LOKitThread.java +++ b/android/source/src/java/org/libreoffice/LOKitThread.java @@ -280,7 +280,7 @@ class LOKitThread extends Thread { closeDocument(); break; case LOEvent.SIZE_CHANGED: - redraw(false); + redraw(true); break; case LOEvent.CHANGE_PART: changePart(event.mPartIndex); commit 614ee3c7856980d0015648d949b025ce62a4075f Author: Michael Weghorn <[email protected]> AuthorDate: Thu Nov 13 13:26:07 2025 +0100 Commit: Michael Weghorn <[email protected]> CommitDate: Fri Nov 14 11:58:04 2025 +0100 android: Drop unused LOKitShell.sendSizeChangedEvent params Change-Id: Icd9515f95a00721ab2c82d720fc3fefab21a90b0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193964 Reviewed-by: Michael Weghorn <[email protected]> Tested-by: Jenkins diff --git a/android/source/src/java/org/libreoffice/LOKitShell.java b/android/source/src/java/org/libreoffice/LOKitShell.java index f6a76228e008..46c5e6307a2b 100644 --- a/android/source/src/java/org/libreoffice/LOKitShell.java +++ b/android/source/src/java/org/libreoffice/LOKitShell.java @@ -91,7 +91,7 @@ public class LOKitShell { LOKitShell.sendEvent(new LOEvent(LOEvent.KEY_EVENT, event)); } - public static void sendSizeChangedEvent(int width, int height) { + public static void sendSizeChangedEvent() { LOKitShell.sendEvent(new LOEvent(LOEvent.SIZE_CHANGED)); } diff --git a/android/source/src/java/org/mozilla/gecko/gfx/GeckoLayerClient.java b/android/source/src/java/org/mozilla/gecko/gfx/GeckoLayerClient.java index 268874e6e5f1..71755d218d30 100644 --- a/android/source/src/java/org/mozilla/gecko/gfx/GeckoLayerClient.java +++ b/android/source/src/java/org/mozilla/gecko/gfx/GeckoLayerClient.java @@ -131,7 +131,7 @@ public class GeckoLayerClient implements PanZoomTarget { mScreenSize = newScreenSize; - LOKitShell.sendSizeChangedEvent(mScreenSize.width, mScreenSize.height); + LOKitShell.sendSizeChangedEvent(); } /**
