android/source/AndroidManifest_quest.xml | 18 ++++++++++++++++++ android/source/build.gradle | 8 ++++++++ 2 files changed, 26 insertions(+)
New commits: commit a413d89ecf90b6d19c6e270727de5736e6095c20 Author: Michael Weghorn <[email protected]> AuthorDate: Tue Nov 25 20:53:40 2025 +0100 Commit: Xisco Fauli <[email protected]> CommitDate: Fri Nov 28 10:43:31 2025 +0100 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 <[email protected]> Tested-by: Jenkins Reviewed-by: Michael Weghorn <[email protected]> (cherry picked from commit b39da4be6fef36090f94ad5a6b19f602f65bfa9f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194539 Code-Style: Xisco Fauli <[email protected]> Reviewed-by: Xisco Fauli <[email protected]> Signed-off-by: Xisco Fauli <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194630 diff --git a/android/source/AndroidManifest_quest.xml b/android/source/AndroidManifest_quest.xml new file mode 100644 index 000000000000..f96b6494a1ab --- /dev/null +++ b/android/source/AndroidManifest_quest.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<manifest xmlns:android="http://schemas.android.com/apk/res/android"> + <application> + <!-- set a default activity size of 1024x640, + see https://developers.meta.com/horizon/documentation/android-apps/panel-sizing --> + <activity + android:name=".LibreOfficeMainActivity"> + <layout + android:defaultHeight="640dp" + android:defaultWidth="1024dp" /> + </activity> + <activity android:name="org.libreoffice.ui.LibreOfficeUIActivity"> + <layout + android:defaultHeight="640dp" + android:defaultWidth="1024dp" /> + </activity> + </application> +</manifest> diff --git a/android/source/build.gradle b/android/source/build.gradle index 85b76eeee62f..8a1666ff0df9 100644 --- a/android/source/build.gradle +++ b/android/source/build.gradle @@ -56,6 +56,7 @@ android { main.java.srcDirs = ['../Bootstrap/src', 'src/java'] main.jniLibs.srcDirs = ["${liboJniLibsdir}"] main.assets.srcDirs 'assets_strippedUI' + quest.manifest.srcFile 'AndroidManifest_quest.xml' } defaultConfig { // minSdkVersion is set in liboSettings.gradle @@ -84,6 +85,13 @@ android { dimension "default" buildConfigField 'boolean', 'ALLOW_EDITING', 'true' } + + // product flavor for Meta Quest devices (Horizon OS) + quest { + dimension "default" + buildConfigField 'boolean', 'ALLOW_EDITING', 'false' + } + } lint { warningsAsErrors true
