Bug 169422 - Android Viewer: Better handle app/window size changes
Summary: Android Viewer: Better handle app/window size changes
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Android Viewer (show other bugs)
Version:
(earliest affected)
26.2.0.0 alpha0+ master
Hardware: All Android
: medium enhancement
Assignee: Michael Weghorn
URL:
Whiteboard: target:26.2.0 target:25.8.3.2
Keywords:
Depends on:
Blocks:
 
Reported: 2025-11-13 13:57 UTC by Michael Weghorn
Modified: 2025-11-24 10:33 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Screencast showing current behavior when resizing the app window (6.19 MB, video/x-matroska)
2025-11-13 13:57 UTC, Michael Weghorn
Details
Screencast with pending change https://gerrit.libreoffice.org/c/core/+/193967 (v1) in place (7.37 MB, video/x-matroska)
2025-11-13 14:18 UTC, Michael Weghorn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Weghorn 2025-11-13 13:57:02 UTC
Created attachment 203954 [details]
Screencast showing current behavior when resizing the app window

While traditionally, apps on Android devices may have been using a fixed size (the whole screen size) in most cases, that's not so much true any more these days.

As originally reported to me by someone else, this results in a non-optimal view of the document when the app window gets resized.

# Sample steps to reproduce:

(s.a. attached screencast)

1) set up a desktop AVD (Android Virtual Device)
2) run Android Viewer
3) open the license document by opening the menu -> "About" -> "License"
   (or alternatively, use any other Writer document)
4) reduce the window width a bit
5) increase the window width

# Actual result

in step 4): not the full width of the document is visible any more
in step 5): unused space: there is extra "gray background" instead of zooming into the document

# Expected result

When the app window size changes, the view should automatically be adjusted to better position the document and apply a "proper" scale factor to make use of the space.

# More information

For a device that doesn't support resizing the app window, a similar scenario to the above is rotating the device. The behavior is similar to the one described above.

Double-tapping on the document canvas can be used to manually adjust the view, but something reasonable should be done "automatically".

Relevant: https://developer.android.com/develop/ui/compose/layouts/adaptive/support-multi-window-mode#resizeableActivity

# Version:

Version: 26.2.0.0.alpha0+
Build ID: 69aeb20d07a5
Comment 1 Michael Weghorn 2025-11-13 14:18:26 UTC
Created attachment 203956 [details]
Screencast with pending change https://gerrit.libreoffice.org/c/core/+/193967 (v1) in place
Comment 2 Commit Notification 2025-11-14 10:58:44 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/95e6108c20f8035ec837ea852fc2285b9677d5f1

tdf#169422 android: Adjust doc pos + zoom on window size change

It will be available in 26.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 3 Commit Notification 2025-11-18 15:46:05 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "libreoffice-25-8":

https://git.libreoffice.org/core/commit/22ca75e90b87c1b9c77e09b5d96a2b58424aff4b

tdf#169422 android: Adjust doc pos + zoom on window size change

It will be available in 25.8.4.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 4 Commit Notification 2025-11-19 12:03:54 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "libreoffice-25-8-3":

https://git.libreoffice.org/core/commit/b7c4b3bde2f73171e9d87d898a8443ef27afb5ea

tdf#169422 android: Adjust doc pos + zoom on window size change

It will be available in 25.8.3.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.