Commit Graph
2196 Commits
Author SHA1 Message Date
Ivan Vladimirovich Kuznetsov 26173fcdad Android. Turn to standard android project structure.
There is no reason to use a custom project structure. The usual Android
project structure makes the development of new features easier using a
modular approach. Therefore, the logic of gradle files was divided into
different levels, gradle scripts was migrated to kotlin,
dependency definitions was moved into toml file.
No one java or kotlin file has been changed.

These changes based on:
1) Android build structure:
https://developer.android.com/build/android-build-structure
2) Migrate your build to version catalogs:
https://developer.android.com/build/migrate-to-catalogs
3) Migrate your build configuration from Groovy to Kotlin
https://developer.android.com/build/migrate-to-kotlin-dsl

Note: The source module has not been renamed to app (this is the usual
name for a top-level application subproject), because I currently do not
know what other changes will need to be made besides gradle scripts
(maybe in the Makefiles or in other) for a correct build. Additional
analysis required.

Change-Id: Ic11efdb51524e795b8c6e2605b6501d9699c525c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195939
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-02-17 10:10:45 +01:00
WeblateandAdam Rak 5d59ef153f android-viewer translated using Weblate
Polish currently translated at 100.0% (116 of 116 strings)

Change-Id: I14a4ad1e6f081d112d814078420fe10f430e901e
Co-authored-by: Adam Rak <kitynska@gmail.com>
Co-authored-by: Weblate <noreply@documentfoundation.org>
Translate-URL: https://translations.documentfoundation.org/projects/android-viewer/android-strings/pl/
Translation: android-viewer/android-strings
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199094
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Michael Weghorn <m.weghorn@posteo.de>
2026-02-11 07:34:36 +01:00
WeblateandChristian Kühl 0d958d64f0 android-viewer translated using Weblate
German currently translated at 100.0% (116 of 116 strings)

Change-Id: I321452dea328ced437ca6b599e8715aa4a11538b
Co-authored-by: Christian Kühl <kuehl.christian@googlemail.com>
Co-authored-by: Weblate <noreply@documentfoundation.org>
Translate-URL: https://translations.documentfoundation.org/projects/android-viewer/android-strings/de/
Translation: android-viewer/android-strings
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198931
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Michael Weghorn <m.weghorn@posteo.de>
2026-02-10 10:06:12 +01:00
WeblateandAdolfo Jayme Barrientos 2370f5675a android-viewer translated using Weblate
Aragonese currently translated at 18.9% (22 of 116 strings)

Change-Id: I8a852956d16e97c4db696c81343994e40e2d7661
Co-authored-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Co-authored-by: Weblate <noreply@documentfoundation.org>
Translate-URL: https://translations.documentfoundation.org/projects/android-viewer/android-strings/an/
Translation: android-viewer/android-strings
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198681
Tested-by: Michael Weghorn <m.weghorn@posteo.de>
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-02-04 21:46:05 +01:00
WeblateandBaurzhan Muftakhidinov 2846c2ac34 android-viewer translated using Weblate
Kazakh currently translated at 100.0% (116 of 116 strings)

Change-Id: Idf3625a3db9bcb6b8d3df0808ef01a8206a52e63
Co-authored-by: Baurzhan Muftakhidinov <baurthefirst@gmail.com>
Co-authored-by: Weblate <noreply@documentfoundation.org>
Translate-URL: https://translations.documentfoundation.org/projects/android-viewer/android-strings/kk/
Translation: android-viewer/android-strings
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197203
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Tested-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2026-01-13 19:21:58 +01:00
aa1f495481 android-viewer translated using Weblate
Aragonese currently translated at 18.1% (21 of 116 strings)

Change-Id: I8b208ee3ca8661c1fc8e1e66dece7161b2c07210

android-viewer translated using Weblate

Aragonese currently translated at 15.5% (18 of 116 strings)

Change-Id: Ie203b67a347628d8242bd9dd1bf41e589ea4df65

android-viewer translated using Weblate

Kazakh currently translated at 29.3% (34 of 116 strings)

Change-Id: Iab1d7ff35baa1bde2af46b69c5172342e9eb6d23

android-viewer translated using Weblate

Kazakh currently translated at 18.9% (22 of 116 strings)

Change-Id: I33ca66d0fcadc46a8909d6c861d9fd8377c50317

android-viewer translated using Weblate

Aragonese currently translated at 3.4% (4 of 116 strings)

Change-Id: I69d66db7d7988181bc464563254222566d3efab2

Added translation for android-viewer using Weblate (Aragonese)

Change-Id: I6e8a4c7916e19b0d8645d34c14a8ff27eaaa371d

android-viewer translated using Weblate

Kazakh currently translated at 12.9% (15 of 116 strings)

Change-Id: I1667da5548709f920b8333a476a0216282385fb0
Co-authored-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Co-authored-by: Baurzhan Muftakhidinov <baurthefirst@gmail.com>
Co-authored-by: Ildar Mustafin <anmitali198@gmail.com>
Co-authored-by: Weblate <noreply@documentfoundation.org>
Translate-URL: https://translations.documentfoundation.org/projects/android-viewer/android-strings/an/
Translate-URL: https://translations.documentfoundation.org/projects/android-viewer/android-strings/kk/
Translation: android-viewer/android-strings
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196339
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-01-12 15:32:40 +01:00
48b61a5d6d android-viewer translated using Weblate
Tagalog currently translated at 100.0% (116 of 116 strings)

Change-Id: Ib0283a9d33b00b7668b2fe5f22d26b50fac2895f

android-viewer translated using Weblate

Asturian currently translated at 100.0% (116 of 116 strings)

Change-Id: I07b113bb9f20ad6ba26cd4db52359815a1dbad6b
Co-authored-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Co-authored-by: Andy Flagg <libreoffice.tagalog@gmail.com>
Co-authored-by: Weblate <noreply@documentfoundation.org>
Translate-URL: https://translations.documentfoundation.org/projects/android-viewer/android-strings/ast/
Translate-URL: https://translations.documentfoundation.org/projects/android-viewer/android-strings/tl/
Translation: android-viewer/android-strings
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194497
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Code-Style: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Michael Weghorn <m.weghorn@posteo.de>
2025-11-26 09:10:22 +01:00
Michael Weghorn 5bd9b087c2 android: Hide settings menu entry if there are no settings
All settings displayed in the SettingsActivity
are related to editing, and only displayed
if the build includes the editing feature.

Therefore, don't show the settings menu item when
using a build config that doesn't include that feature,
i.e. only show the item for the strippedUIEditing
product flavor, but not the strippedUI or quest
ones. For the latter two, an activity only displaying the
"General" heading would be shown, but nothing
else could be done, which was rather confusing.

Change-Id: I2a1a616c1faee18583320ccb16e717dc933d6565
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194534
Code-Style: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-11-26 06:27:55 +01:00
Michael Weghorn 8d015346d0 android: Have a single method for menu item (de)activation
Instead of having one method that enables/disables a menu
item and one that shows/hides it, let
ToolbarController.setItemVisible take care of both.
Use that method also where ToolbarController.enableMenuItem
was used before and drop that now unused method.

The way that hiding/disabling menu items was and is used
is to do that when they are not applicable, in which case
it seems reasonable to consistently both hide and disable
them at the same time.

Quoting from the MenuItem.setVisible doc [1]:

> Sets the visibility of the menu item. Even if a menu item is not
> visible, it may still be invoked via its shortcut (to completely disable
> an item, set it to invisible and disabled).

[1] https://developer.android.com/reference/android/view/MenuItem#setVisible(boolean)

Change-Id: I5d05f5324a1fb5c69e38302b59b2ad56a45342ff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194533
Tested-by: Jenkins
Code-Style: Michael Weghorn <m.weghorn@posteo.de>
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-11-26 06:27:04 +01:00
Michael Weghorn b39da4be6f android: Set activity size for Meta Quest in new product flavor
For Meta Quest devices running Horizon OS, it is required
that the default activity size is set to 1024x640,
see also [1].

Add a new product flavor "quest" with an additional
AndroidManifest_quest.xml that sets the corresponding
attributes for the 2 main activities.

Due to the manifest merge logic as described at [2],
it is sufficient to only specify those extra
attributes. The rest is taken from the main
AndroidManifest.xml used for all build flavors.

This makes the LibreOffice Viewer app on a Meta Quest 3
VR headset open in the specified size in landscape mode,
while it was previously opening in a smaller window in
portrait mode.

Also, disable the experimental editing mode for that product
flavor, as it seems to be even more experimental when tested
on a Meta Quest than on another Android device.
(Document UI doesn't update while typing.)

The build flavor can either manually be selected in
Android Studio ("Build" -> "Select Build Variant")
or specified for the gradle target, e.g.

    ./gradlew assembleQuestRelease

[1] https://developers.meta.com/horizon/documentation/android-apps/panel-sizing
[2] https://developer.android.com/build/manage-manifests#merge-manifests

Change-Id: Ia2b234f50694553d2b3458e4c57e8bb1b1a5baa8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194532
Code-Style: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-11-26 06:26:21 +01:00
Michael Weghorn 72f7e3e5c5 android: Deduplicate assets specification in build.gradle
It's the same for both product flavors, so
define it once for the main one that is the base
for both of them, and all upcoming flavors, too.

Change-Id: I0532332c0780bac5099a2d98601664b3cf709777
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194531
Tested-by: Jenkins
Code-Style: Michael Weghorn <m.weghorn@posteo.de>
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-11-26 06:25:40 +01:00
Michael Weghorn 4555bbfe37 android: Regenerate lint-baseline.xml
One issue was addressed in previous commit

    Change-Id: Iafb7a32668718afc638b8273a05a9d0618f85550
    Author: Michael Weghorn <m.weghorn@posteo.de>
    Date:   Wed Nov 19 16:36:25 2025 +0100

        tdf#164082 android: Drop storage permission and support for file:// URIs

Change-Id: I1bd43717e9bd19719cb197d15c431670741d584b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194217
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2025-11-20 00:09:17 +01:00
Michael Weghorn 269480e5f5 tdf#164082 android: Drop storage permission and support for file:// URIs
In the past, LibreOffice Viewer for Android was directly
accessing storage in order to open/save files and when
exporting to PDF.
However, that was switched to using Android's Storage
Access Framework [1], available since Android 4.4
(API level 19), i.e. it is available in all Android
versions supported by the app.

In the past, in order to directly access storage, permission
android.permission.WRITE_EXTERNAL_STORAGE was needed.

That permission no longer has any effect in
Android 11 (API level 30) or higher, quoting from [2]:

> More recent versions of Android rely more on a file's purpose than its
> location for determining an app's ability to access, and write to, a
> given file. In particular, if your app targets Android 11 (API level 30)
> or higher, the WRITE_EXTERNAL_STORAGE permission doesn't have any
> effect on your app's access to storage. This purpose-based storage
> model improves user privacy because apps are given access only to
> the areas of the device's file system that they actually use.
>
> Android 11 introduces the MANAGE_EXTERNAL_STORAGE permission, which
> provides write access to files outside the app-specific directory and
> MediaStore. To learn more about this permission, and why most apps don't
> need to declare it to fulfill their use cases, see the guide on how to
> manage all files [3] on a storage device.

Since PDF export was also switched to use the
Android Storage Framework mechanism in

    commit 9ebcb80e2e
    Author: Michael Weghorn
    Date:   Thu Apr 15 11:22:46 2021 +0200

        android: Ask where to save PDF file on export

, eventually drop the permission now.

As mentioned in

    commit 7d9db806d6
    Author: Michael Weghorn <m.weghorn@posteo.de>
    Date:   Fri Apr 9 11:24:16 2021 +0200

        android: Request PERMISSION_WRITE_EXTERNAL_STORAGE again

which re-requested the permission before PDF export was
ported to use the Android Storage Framework, the case of
applications passing documents via a file:// URI would also
require storage permission in order to access the file.

However, apps that properly pass the file should pass a
content:// URL instead.

Quoting from the Android 7.0 Behavior changes
documentation [4]:

> Passing file:// URIs outside the package domain may leave the receiver
> with an unaccessible path. Therefore, attempts to pass a file:// URI
> trigger a FileUriExposedException. The recommended way to share the
> content of a private file is using the FileProvider.

(Using content:// URIs has been possible long before Android 7.0,
however.)

Therefore, drop support for file:// URIs as well, which
will prevent apps that would otherwise try to pass file://
URIs from trying to do that for Android Viewer.

If this results in any app no longer being able to
open documents in LibreOffice Viewer, that app most
likely needs to be adjusted to pass a content:// URI instead,
which will also make it work for newer Android versions.

(Total Commander is one case that apparently doesn't do
that yet, previously resulting in a crash when storage
permissions were not granted, see tdf#164082. That is
reproducible in an Android 7.0 AVD, while opening
the file fromm other apps, e.g. from Material Files [5],
works perfectly fine, using content:// URIs.)

Eventually dropping the permission makes clear that
the app does not need direct storage access, which is
also relevant for security reviews, and addresses this
lint issue from android/source/lint-baseline.xml:

    <issue
        id="ScopedStorage"
        message="WRITE_EXTERNAL_STORAGE is deprecated (and is not granted) when targeting Android 13+. If you need to write to shared storage, use the `MediaStore.createWriteRequest` intent."
        errorLine1="    &lt;uses-permission android:name=&quot;android.permission.WRITE_EXTERNAL_STORAGE&quot;/>"
        errorLine2="                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
        <location
            file="AndroidManifest.xml"
            line="9"
            column="36"/>
    </issue>

That file will be updated/regenerated in a separate
commit.

[1] https://developer.android.com/training/data-storage/shared/documents-files
[2] https://developer.android.com/training/data-storage#permissions
[3] https://developer.android.com/training/data-storage/manage-all-files
[4] https://developer.android.com/about/versions/nougat/android-7.0-changes
[5] https://f-droid.org/en/packages/me.zhanghai.android.files/

Change-Id: Iafb7a32668718afc638b8273a05a9d0618f85550
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194215
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2025-11-20 00:09:11 +01:00
Michael Weghorn 531babd18f android: Drop USB feature from Android manifest
This android.hardware.usb.host feature element was added in

    commit 5ada20b358
    Author: brainbreaker <gautamprajapati06@gmail.com>
    Date:   Sun Feb 26 02:27:43 2017 +0530

        Improve the Document Provider UX

, when it was still used for the file/document access
logic implemented in the app that was also explicitly
handling USB device support.

That one was dropped in

    commit a23bd42e9b
    Author: Michael Weghorn
    Date:   Tue Apr 6 14:26:06 2021 +0200

        android: Drop custom file abstraction + UI

, so also drop this from the Android manifest.

Change-Id: Icbd8fa86d1a9a4d8dfb8fccd90846a432a329b90
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194214
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-11-20 00:09:01 +01:00
Michael Weghorn cdb605f85a android: Drop LayerView.mContext
It's only assigned in the ctor, but never used later.

Change-Id: Ie7876c8eb4f22cd03f1e3743950e402b51c67db1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194198
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2025-11-20 00:08:44 +01:00
Michael Weghorn 72bd91e174 android: Make a constant static
... and use uppercase letters for its name.

Change-Id: Ib10b792d55928223d7484b7fb339ca252532bc28
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194197
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-11-20 00:08:33 +01:00
Michael Weghorn 4ec5e2e420 android: Make member final
Change-Id: I61e6b512120df15c81c8c22ed2a97c38ca0813f7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194196
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-11-20 00:08:24 +01:00
Michael Weghorn 3d89b7aad0 android: Drop DisplayPortCalculator.mMainActivity
No need to have a member for this, just pass the
param directly to the VelocityBiasStrategy ctor.

Change-Id: If8fa006afbbb082a0885cef371c89721c64eb3c6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194195
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2025-11-20 00:08:16 +01:00
Michael Weghorn a01e82013c android: Drop unused LayerView.Listener.compositorCreated
The method is unused and doesn't do anything. Drop it.

Change-Id: I4076b9d0ca9c58311e67ae40e1b3ba6f5a9c6f30
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194192
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-11-20 00:08:08 +01:00
WeblateandKfir Pshititsky 83988469f5 android-viewer translated using Weblate
Hebrew currently translated at 100.0% (116 of 116 strings)

Change-Id: I6020764413d6956e8ba37ec7114f3a790fc73ae1
Co-authored-by: Kfir Pshititsky <Kfir4321@gmail.com>
Co-authored-by: Weblate <noreply@documentfoundation.org>
Translate-URL: https://translations.documentfoundation.org/projects/android-viewer/android-strings/he/
Translation: android-viewer/android-strings
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194162
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2025-11-18 16:02:25 +01:00
Michael Weghorn 3415170e29 android: Regenerate lint-baseline.xml
Regenerate the file (by removing the old one and
running a build).

This addresses the

    > Task :lintReportStrippedUIEditingDebug
    Lint found 1 hint (and 199 errors and 2 hints filtered by baseline lint-baseline.xml)

    2 errors/warnings were listed in the baseline file (/home/michi/development/git/libreoffice-WORKTREE-android/android/source/lint-baseline.xml) but not found in the project; perhaps they have been fixed?

notice seen without this commit in place.

Change-Id: I000dc86dbf6ee5ce622f6c26fc05ad4f511ec0bd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194106
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-11-17 20:52:36 +01:00
Michael Weghorn 26f7f488af android: Update com.google.android.material:material to 1.13.0
Change-Id: Id22a2130379fb11372d210049b4f02df29ec52d8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194104
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2025-11-17 20:52:29 +01:00
Michael Weghorn 83b7e5325c android: Stop calling RecyclerView.setHasFixedSize
Stop calling the method RecyclerView.setHasFixedSize
meant to allow optimiziations (see doc at [1]), because
that is not compatible with the size used in the layout
file.

This prepares for upcoming commit

    Change-Id: Id22a2130379fb11372d210049b4f02df29ec52d8
    Author: Michael Weghorn <m.weghorn@posteo.de>
    Date:   Mon Nov 17 12:56:47 2025 +0100

        android: Update com.google.android.material:material to 1.13.0

which would otherwise trigger errors like this one:

    > Task :lintReportStrippedUIEditingDebug
    Wrote HTML report to file:///home/michi/development/git/libreoffice-WORKTREE-android/android/source/build/reports/lint-results-strippedUIEditingDebug.html
    Lint found 4 errors, 1 hint (and 199 errors and 2 hints filtered by baseline lint-baseline.xml)

    2 errors/warnings were listed in the baseline file (/home/michi/development/git/libreoffice-WORKTREE-android/android/source/lint-baseline.xml) but not found in the project; perhaps they have been fixed?
    Lint found 4 errors and 1 hint. First failure:
    /home/michi/development/git/libreoffice-WORKTREE-android/android/source/src/java/org/libreoffice/FontController.java:257: Error: When using `setHasFixedSize() in an RecyclerView, wrap_content cannot be used as a value for size in the scrolling direction. [InvalidSetHasFixedSize from androidx.recyclerview.lint.recyclerview]
            recyclerView.setHasFixedSize(true);
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    > Task :lintStrippedUIEditingDebug FAILED

[1] https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView#setHasFixedSize(boolean)

Change-Id: I34b7b88506d549aa38d06e292ce8a6e96057e619
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194105
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-11-17 20:52:24 +01:00
Michael Weghorn 262f52c9d8 android: Update Android Gradle Plugin to 8.13.1
Change-Id: I895eadc9d273efbee5bcf94db03c47dfea6cb871
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194102
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2025-11-17 20:52:16 +01:00
Michael Weghorn 6a094de27b android: Stop using deprecated Gradle "space assignment" syntax
See [1]:

> Currently, there are multiple ways to set a property with Groovy DSL syntax:
>
> ---
> propertyName = value
> setPropertyName(value)
> setPropertyName value
> propertyName(value)
> propertyName value
> ---
>
> The latter one, "space-assignment", is a Gradle-specific feature that is
> not part of the Groovy language. In regular Groovy, this is just a
> method call: propertyName(value), and Gradle generates propertyName
> method in the runtime if this method hasn’t been present already. This
> feature may be a source of confusion (especially for new users) and adds
> an extra layer of complexity for users and the Gradle codebase without
> providing any significant value. Sometimes, classes declare methods with
> the same name, and these may even have semantics that are different from
> a plain assignment.
>
> These generated methods are now deprecated and will be removed in Gradle
> 10.0, and both propertyName value and propertyName(value) will stop
> working unless the explicit method propertyName is defined. Use explicit
> assignment propertyName = value instead.

This addresses warnings seen during the Android Viewer build like:

    > Configure project :
    Build file '/home/michi/development/git/libreoffice-WORKTREE-android/android/source/build.gradle': line 19
    Properties should be assigned using the 'propName = value' syntax. Setting a property via the Gradle-generated 'propName value' or 'propName(value)' syntax in Groovy DSL has been deprecated. This is scheduled to be removed in Gradle 10.0. Use assignment ('url = <value>') instead. Consult the upgrading guide for further information: https://docs.gradle.org/8.13/userguide/upgrading_version_8.html#groovy_space_assignment_syntax
            at build_7nyveb4ly8p00ms61u72dhwli$_run_closure1$_closure2$_closure4.doCall$original(/home/michi/development/git/libreoffice-WORKTREE-android/android/source/build.gradle:19)
            (Run with --stacktrace to get the full stack trace of this deprecation warning.)
            at build_7nyveb4ly8p00ms61u72dhwli$_run_closure1$_closure2.doCall$original(/home/michi/development/git/libreoffice-WORKTREE-android/android/source/build.gradle:18)
            (Run with --stacktrace to get the full stack trace of this deprecation warning.)

[1] https://docs.gradle.org/8.13/userguide/upgrading_version_8.html#groovy_space_assignment_syntax

Change-Id: I963b3a1b38912d134619293cd9197f8545ed5515
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194103
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-11-17 20:52:10 +01:00
Michael Weghorn 95e6108c20 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 <m.weghorn@posteo.de>
2025-11-14 11:58:13 +01:00
Michael Weghorn 614ee3c785 android: Drop unused LOKitShell.sendSizeChangedEvent params
Change-Id: Icd9515f95a00721ab2c82d720fc3fefab21a90b0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193964
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2025-11-14 11:58:04 +01:00
Michael Weghorn d92f51f338 android: Assign constant values right away
Simplify this further after

    Change-Id: Icae6258fa4516348dc2c8978f42024d9884216f7
    Author: Michael Weghorn <m.weghorn@posteo.de>
    Date:   Thu Nov 13 12:40:50 2025 +0100

        android: Skip (not) reading from null map

Change-Id: I1c44456bc6e5a17e2dae0c03d1dfaf54dcbbea09
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193963
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-11-14 11:57:54 +01:00
Michael Weghorn 77a4a8efc3 android: Skip (not) reading from null map
The only caller of setPrefs passes a null param.
Therefore, drop the param and the logic that would
only have been relevant for a non-null param.

Change-Id: Icae6258fa4516348dc2c8978f42024d9884216f7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193962
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2025-11-14 11:57:45 +01:00
Michael Weghorn c6167305a8 android: Drop JavaPanZoomController.mMainThread
Instead call the logic to get the main thread directly
in JavaPanZoomController.checkMainThread.

Change-Id: I5fe02ba038b0e4ea954012e2a7296f59113e1eb6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193960
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-11-14 11:57:34 +01:00
Michael Weghorn d1c3fe050a android: Drop PanZoomController iface
JavaPanZoomController is the only implementation.
Use that one directly instead, which also removes
the need for some casting in GeckoLayerClient.

Change-Id: Id9c4a8ed154b66ac81274eb1648477163eb546a0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193959
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2025-11-14 11:57:24 +01:00
Michael Weghorn 359ea4d690 android: Drop unused PanZoomController.{g,s}etOverScrollMode
Also drop the now unused Axis.setOverScrollMode.

Change-Id: Ica0acd21a1450316225f3c96b5464d29bf2c6449
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193957
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-11-14 11:57:12 +01:00
Michael Weghorn f3e0df4d52 android: Use local var instead of GeckoLayerClient.mLayerRenderer
It's only used in this one place.

Change-Id: Ifc64c6d4e06374db884d6aae4b911c0b2f2f6c39
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193955
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2025-11-14 11:57:00 +01:00
Michael Weghorn 1183c8dc27 android: Drop GeckoLayerClient.mIsReady
Now with

    Change-Id: If1ebe5da94d8193794cce41e052bd401e0c8adbc
    Author: Michael Weghorn <m.weghorn@posteo.de>
    Date:   Thu Nov 13 10:59:12 2025 +0100

        android: Move GeckoLayerClient.notifyReady logic to ctor

in place, the member is already set to true in the ctor,
so there's no need to check for that anymore.

Change-Id: Idb762da74ed334e9ffb56e709ec92c960bc82113
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193954
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-11-14 11:56:47 +01:00
Michael Weghorn e0a2dcc0bb android: Move GeckoLayerClient.notifyReady logic to ctor
Instead of calling the method after creating the
object, move the logic into the ctor itself.

This also allows to make a few more members final.

Change-Id: If1ebe5da94d8193794cce41e052bd401e0c8adbc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193953
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-11-14 11:56:35 +01:00
Michael Weghorn 3f6b4cf48d android: Drop GeckoLayerClient.destroy
It doesn't do anything by now.

Change-Id: I498eaff6921c1dabd30889d623d67ec5207a9f95
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193952
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-11-14 11:56:25 +01:00
Michael Weghorn cec548ce3c android: Drop PanZoomController.destroy
It doesn't do anything anyway.

Change-Id: Ie9deab61c206a07f84d079e8c58b7d4bb0bf5c14
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193951
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2025-11-14 11:56:10 +01:00
Michael Weghorn 113a30ca09 android: Do more GeckoLayerClient initialization in ctor
Pass the LayerView as a param to the ctor, instead
of calling GeckoLayerView.setView separately afterwards.

This also allows to make two more members final.

Change-Id: Ic3ffcde590a84fec4413ef6225aa8417e3960f84
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193950
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-11-14 11:56:00 +01:00
Michael Weghorn c88830d86c android: Make more class members final
... as suggested by Android Studio.

Change-Id: I35ba756a684ed20c124b3e5805b58494a5905119
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193932
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-11-14 11:55:50 +01:00
Michael Weghorn d20aa052dd android: Drop 2 unused local vars
Change-Id: I7ac6aa5c796e85e18a1726bbb41f2d910f242454
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193931
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-11-14 11:55:40 +01:00
Michael Weghorn 986885b493 android: Make 2 JavaPanZoomController members final
Change-Id: Icb958cd97a5652292d8001fc41c41b10c6266b47
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193930
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-11-14 11:55:28 +01:00
Michael Weghorn 0b847f4c63 android: Drop unused imports
Change-Id: I0ce03d8c639e5cf71021f8877ab1e195f6a99919
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193929
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-11-14 11:55:15 +01:00
Michael Weghorn c0acdac2d3 android: Drop unused PanZoomState.WAITING_LISTENERS enum value
It's never set, so drop logic only relevant if
it were ever used.

See also previous commit

    Change-Id: Ie83eb651500e5beb892492b681e03ce715800069
    Author: Michael Weghorn <m.weghorn@posteo.de>
    Date:   Wed Nov 12 23:09:59 2025 +0100

        android: Drop JavaPanZoomController.startingNewEventBlock

that dropped dead code that would have set the state if
it had ever been reached.

Somewhat related to this, also drop the mention of
"default-prevented" events from the TouchEventHandler doc, as this
is no longer a thing.

Change-Id: I79e918b659099129f733d4fcc7b92d5d35bb6085
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193928
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-11-14 11:55:03 +01:00
Michael Weghorn c4e9f5385d android: Drop TouchEventhandler.destroy
The method doesn't do anything anyway.

Change-Id: Iec7853cfab9ae95907096947e8f01d9ff8b6c2a5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193927
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-11-14 11:54:53 +01:00
Michael Weghorn 26a504e5f1 android: Drop JavaPanZoomController.startingNewEventBlock
... and related logic.

The only (remaining) caller of the method calls it with
a value of false for the `waitingforTouchListeners` param,
in which case the method doesn't do anything.

Also drop documentation related to processing events in
blocks, as that is no longer the case.

TouchEventHandler.isDownEvent is now unused, so
drop it, too.

Change-Id: Ie83eb651500e5beb892492b681e03ce715800069
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193926
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-11-14 11:54:41 +01:00
Michael Weghorn 2b275622f0 android: Drop unused TouchEventHandler.touchFinished
Change-Id: Id7e57df58c575c0c8811de052afcde0ff885616e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193925
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-11-14 11:54:32 +01:00
Michael Weghorn 6f042b398b android: Drop now unused TouchEventHandler.mView
Change-Id: I78084ffee1caa7d55c1d02941f099b5e8919a5cd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193924
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2025-11-14 11:54:22 +01:00
Michael Weghorn 5bf1d4905d android: Drop ListenerTimeoutProcessor
As has become clear with

    Change-Id: Iae8392bc6e8edd7cafae0602b94c270c23f1f7bd
    Author: Michael Weghorn <m.weghorn@posteo.de>
    Date:   Wed Nov 12 16:41:57 2025 +0100

        android: Drop queue logic in TouchEventHandler

, that class doesn't actually do anything useful
anymore at this point in time, so drop and correspoinding
logic altogether.

Change-Id: I4ed7816f3dc1c63a2b6a7974544878c02fa9acfe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193923
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2025-11-14 11:54:12 +01:00
Michael Weghorn 5d1efdfa5d android: Drop queue logic in TouchEventHandler
Earlier commit

    Change-Id: I145531e23f9d076f79bdb6c0d886f33e05d818f9
    Author: Michael Weghorn <m.weghorn@posteo.de>
    Date:   Wed Nov 12 16:08:56 2025 +0100

        android: Drop two TouchEventHandler members that are always false

dropped the last `mEventQueue.add` call adding something
other than null to the event queue.

Therefore, the queue can by now either be empty or
contain only null values, both of which results in
the processEventBlock() logic not doing anything
relevant.

Therefore, drop the event queue and the
processEventBlock() logic altogether.

Further simplification/cleanup can happen in upcoming commits.

Change-Id: Iae8392bc6e8edd7cafae0602b94c270c23f1f7bd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193922
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-11-14 11:53:59 +01:00
Michael Weghorn c560719747 android: Drop always true TouchEventHandler.mDispatchEvents
It gets set to true in the ctor, and since previous
commit

    Change-Id: Iaad65954df69b11e1463a54097116001e7048cfa
    Author: Michael Weghorn <m.weghorn@posteo.de>
    Date:   Wed Nov 12 16:15:51 2025 +0100

        android: Drop always true TouchEventHandler.processEventBlock param

it is also obvious that it never gets set to any
other value.

Therefore, drop that member and all (dead) code that
would only be relevant if it ever had a value of false.

Change-Id: Iaad65954df69b11e1463a54097116001e7048cfa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193900
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-11-14 11:53:49 +01:00