summaryrefslogtreecommitdiff
path: root/android
AgeCommit message (Collapse)Author
2024-10-13tdf#163170 Add support for MS Visio Template format with .vstx extensionBartosz Kosiorek
libvisio is already supporting .vstx template format. With this patch the LibreOffice is recognizing such file types, and successfully opening it. More information about format: https://learn.microsoft.com/en-us/office/client-developer/visio/introduction-to-the-visio-file-formatvsdx Change-Id: Ibee01288cdb2cd6a0ac3f371a22604d7bb5b471c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173997 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl> (cherry picked from commit 529dfc741a4ad6735937adaf10acdd567da4f84c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174012 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2024-08-23android: Handle cursor keysMichael Weghorn
In Android Viewer, forward the left/right/up/down keys as such by adding the corresponding mapping to `LOKitTileProvider#getKeyCode`. This allows navigating through the document using those keys e.g. on a hardware keyboard. This addresses this comment from a Google Play Review: > Editing, the cursor doesn't respond to the cursor keys Change-Id: I688e5d0cc1db4f9315f9c9cb2139c22117a210e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170605 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> (cherry picked from commit 053d9feec432ca4dff4d85593d9cad0d975388b3) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170562 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2024-06-29tdf#157009 android: Add missing subdir for Triple-T/F-Droid iconMichael Weghorn
Even with commit 69189de8fa9a9d4973a4304a82780d32e79fbe6f Author: Michael Weghorn <m.weghorn@posteo.de> Date: Thu May 16 09:26:44 2024 +0200 tdf#157009 android: Add icon symlink for F-Droid (and its 24-2 backport) in place, the icon is not shown for LibreOffice Viewer in the F-Droid app and on the repo website [1]. Revisiting the related specs [2] [3], it turns out that the icon needs to be in an "icon" subdir in the "graphics" directory, so add that missing "icon" subdir and move the symlink there. From [2]: > └── listings > ├── en-US (en-US is the default locale in F-Droid) > │ ├── title.txt (app name) > │ ├── short-description.txt (short description, max 80 chars, mandatory) > │ ├── full-description.txt (full app description, mandatory) > │ ├── video-url.txt (URL to a video introducing the app) > │ ├── whatsnew (alternative changelog location; single file, no .txt) > │ └── graphics > │ ├── icon (app icon; mandatory if your app doesn't include any png icon) > │ │ └── *.(png|jpg) 1 image, usually 512x512 [1] https://f-droid.org/en/packages/org.documentfoundation.libreoffice/ [2] https://f-droid.org/en/docs/All_About_Descriptions_Graphics_and_Screenshots/#triple-t-structure [3] https://github.com/Triple-T/gradle-play-publisher?tab=readme-ov-file#uploading-graphic-based-listings Change-Id: I43c23040bf63a34f8f9648b45fab6c47a8816b8d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169677 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com> Tested-by: Jenkins
2023-12-08android: Bump minSdkVersion to 21 (Android 5.0)Michael Weghorn
NDK 26 dropped support for API levels < 21 [1] [2]. Do the same for our Android build, to ease the maintenance. Adapt configure.ac accordingly and drop the now obsolete code paths in Android Viewer Java code. This in also means that the same minSdkVersion will be used for all architectures now, while API level 21 was already used for the 64-bit variants (for which the minimum supported version was 21 anyway) and API level 19 was used for x86 and 32-bit ARM when building with NDK 24/25, API level 16 when building with NDK 23. According to [1] and [3], more than 99% of Android devices have at least Android version 5, i.e. support API level 21. [1] https://github.com/android/ndk/issues/1751 [2] https://developer.android.com/ndk/downloads/revision_history [3] https://apilevels.com/ Change-Id: I875e784dd4e62993f51059ae6a280d425cb49c0a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160334 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-12-01android: Update Android Gradle Plugin to 8.2.0Michael Weghorn
... and gradle to 8.2, as suggested by Android Studio. Change-Id: I1a1df5f43b7a95d24308873b708d3d21b76aa7f2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160200 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-12-01Fix typoAndrea Gelmini
Change-Id: Ia40016ad2696c8555163074c415ea0e8f9216f3c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160207 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
2023-12-01android: Shown warnings about deprecated API usageMichael Weghorn
Configure the gradle build to show detailed warnings about the use of deprecated API, instead of just > Task :compileStrippedUIEditingDebugJavaWithJavac Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. With this in place, 78 specific warnings about the use of deprecated API are now shown in the build output, which can be addressed at some point. Change-Id: I9f3b484b6dfad1fc57895efa7d3426b625030ee7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160198 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-11-30android: Add make dep to update build ID more reliablyMichael Weghorn
So far, the build ID in liboSettings.gradle, and therefore in the about dialog in Android Viewer was not reliably updated in incremental builds. For example, after a full build, then git commit --allow-empty -m "Dummy" make , the build ID would still refer to the commit from the full build, not the new dummy commit. Since `instdir/program/versionrc` on Linux and `instdir/program/version.ini` on Windows gets updated properly, add an optional make dependency on these files, using a wildcard. Change-Id: If3b1d4d811a5e4316a26bb17f246b66858dcf80f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160157 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-11-30android: Separate build ID and vendor from versionNameMichael Weghorn
So far, the versionName for the LibreOffice APK/app bundle included the build ID and vendor, was e.g. "24.2.0.0.alpha1+/2972af9045a5/The Document Foundation". That versionName would be split again to extract the build ID and vendor to display them in the about dialog. No longer include build ID and vendor in the `versionName`, but use separate build config variables, similar to what is done for the privacy policy. This slightly simplifies the code for the about dialog. But more importantly, the previous `versionName` scheme would make it impossible to automate the F-Droid update of the app, because the scheme is not compatible with the expectations of F-Droid's update mechanism, see the F-Droid merge request to update LibreOffice Viewer to 7.6.3 [1] for more details, in particular the (eventually not merged) commit [2] mentioning what manual steps would still be needed when trying to semi-automate the update at least. [1] https://gitlab.com/fdroid/fdroiddata/-/merge_requests/14080 [2] https://gitlab.com/fdroid/fdroiddata/-/merge_requests/14080/diffs?commit_id=bfc062a358dc574326a29f08e01c0e80cadd80cb Change-Id: Ibede06d13095d8e83dcc88ee09a8a610d6a9de0f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160150 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-11-30android: Drop trailing whitespace in MakefileMichael Weghorn
Change-Id: Ic68471bbbc18e5fa0a66dbf57e3e7156ef824e50 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160149 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-11-30android: Simplify vendor info handling for about dialogMichael Weghorn
Similar to Change-Id: Iaa78f5a6020bea4ed80a1b41d3b23cc8d313813c Author: Michael Weghorn <m.weghorn@posteo.de> Date: Thu Nov 30 12:00:52 2023 +0100 android: Simplify version info handling for about dialog , also simplify the handling of the vendor info text by retrieving the text from the string resource right away. Change-Id: I7d56b1814454be2bc8d13e01265f0a0db6d865be Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160147 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-11-30android: Simplify version info handling for about dialogMichael Weghorn
* Don't set and retrieve the placeholder text in/from the TexView in the about dialog, but use the string resource directly. * Add the HTML code directly in the string resource, rather than having to fiddle with that in the Java code. With this in place, only the version name and the commit hash need to be replaced. Since there is no placeholder text in the text view, it's also no longer necessary to explicitly set an empty string in case of an exception. Change-Id: Iaa78f5a6020bea4ed80a1b41d3b23cc8d313813c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160146 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-11-30android: Remove 'build' dir in 'clean' make targetMichael Weghorn
Add the build dir (`android/source/build`) to the directories to be removed when cleaning. Previously, this was't cleaned, which could be seen e.g. by the fact that a fresh build would result in this warning being shown > Task :compileStrippedUIEditingDebugJavaWithJavac Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. while a make android.clean make android after a full build wouldn't. Change-Id: I00a4f8b1fda9fbefb3b8f806b1997eceded117fa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160145 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-11-30android: Update com.google.android.material:material to 1.10.0Michael Weghorn
Depends on the previous commit Change-Id: I2778d8c181daa92530c769a168a9e186b6ea079c Author: Michael Weghorn <m.weghorn@posteo.de> Date: Wed Nov 29 13:33:33 2023 +0100 android: Update compileSdk/targetSdkVersion to 34 Change-Id: Ibdb7e002d599d42256290febc422cf86b2694d46 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160087 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-11-30android: Update compileSdk/targetSdkVersion to 34Michael Weghorn
API version 33 refers to Android 14. I didn't notice anything requiring changes when going over the release notes for all apps running on Android 14 [1] and apps targeting Android 14 [2]. (Taking a look whether making use of the new possibility to request/grant partial access to photos and videos [3] for the "Insert" -> "Select Photo" feature and testing the app with the newly available 200% text scaling [4] might make sense at some point, but is unrelated to bumping the versions as done in this commit.) [1] https://developer.android.com/about/versions/14/behavior-changes-all [2] https://developer.android.com/about/versions/14/behavior-changes-14 [3] https://developer.android.com/about/versions/14/behavior-changes-all#partial-photo-video-access [4] https://developer.android.com/about/versions/14/behavior-changes-all#non-linear-font-scaling Change-Id: I2778d8c181daa92530c769a168a9e186b6ea079c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160086 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-11-30android: Update Android Gradle Plugin to 8.1.4Michael Weghorn
This is a prerequisite for updating the compile and target SDK versions to API level 34, which requires and AGP minimum version of 8.1.1. Change-Id: I27d12ec3c9bc3dac8a5df18459a57f1a1e990197 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160085 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-11-30android: Use 'compileSdk' instead of deprecated 'compileSdkVersion'Michael Weghorn
See [1] and [2]. From what I can see, they are equivalent for our use. This addresses a "'compileSdkVersion' is deprectaed." warning shown in Android Studio. [1] https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/dsl/CommonExtension#compilesdk [2] https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/dsl/CommonExtension#compilesdkversion Change-Id: I9a7416d8b3750a5f8f8281c6e226fc7bbe665776 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160084 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-11-30android: No longer extract native libsMichael Weghorn
As described in more detail in commit 45fbfbfeae1de12e87d0a3748e22553b69adbc4a Author: Michael Weghorn <m.weghorn@posteo.de> Date: Fri Mar 27 17:04:37 2020 +0100 tdf#131622 android: Extract native libs again , extracting native libraries was necessary for the NSS library to be able to load modules like `libnssckbi.so` at runtime. Without this, opening password-protected files would fail. However, this has in the meanwhile been addressed differently in the following commit (probably in the context of the online-based/Collabora Online app), so extracting libs is no longer needed: commit 16a7f98f99d334ea865b800e0b32d6fed1483942 Author: Mert Tumer <mert.tumer@collabora.com> Date: Wed Sep 30 17:14:59 2020 +0300 Fix libnssckbi not found error on Android This error causes Android App to be unable to open Password-protected documents. Change-Id: Iacbacb1c780025752e2447db325b075c58947818 Signed-off-by: Mert Tumer <mert.tumer@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103658 Tested-by: Jenkins Reviewed-by: Andras Timar <andras.timar@collabora.com> Therefore, no longer extract the libraries, which also addresses addresses this warning shown during the build: > Task :processStrippedUIEditingDebugMainManifest .../android/source/AndroidManifest.xml:16:9-41 Warning: android:extractNativeLibs should not be specified in this source AndroidManifest.xml file. See https://d.android.com/guide/topics/manifest/application-element#extractNativeLibs for more information. The AGP Upgrade Assistant can remove the attribute from the AndroidManifest.xml file and update the build file accordingly. See https://d.android.com/studio/build/agp-upgrade-assistant for more information. Change-Id: I867beea0bce8398806375048e87a152e1348d016 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160079 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-11-30tdf#124480 android: Set bg color for calc formula barMichael Weghorn
For the layout containing the Calc address/formula bar, explicitly set a background color that matches the theme. Otherwise, those text views would be using white font on white background when using dark theme, making the text unreadable. Change-Id: I5fdf9e04f8bb331ca6a57bf3046a7ebb9ccb0d1f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160078 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-11-30tdf#124480 android: Avoid using color attr requiring API 23Michael Weghorn
Using "colorBackgroundFloating" requires API level 23 [1], but our current minimum API level is 16 (when building with NDK 23). Therefore, define an own color `background_floating` instead and use the correspodning color values from the material theme (`background_floating_material_{dark,light}` depending on whether dark/night mode is enabled or not. This makes the app work again in a quick test with an x86 AVD with API level 16 instead of crashing on startup. Change-Id: I7b8378b42e9fc7430ec4ed263d4cb8b42027a930 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160077 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-11-30tdf#124480 android: Use an actual button for "Select file to open"Michael Weghorn
Instead of using a TextView and setting `?attr/colorButtonNormal` for the background color, just use a button right away, which also makes sure that the proper button color is used and avoids using `colorButtonNormal` only available from API level 21 on. [1] Also drop the extra `LinearLayout` parent that was only containing this one TextView. While at it, drop an unused import. [1] https://developer.android.com/reference/android/R.attr#colorButtonNormal Change-Id: Ie2f7e2646d20f4051fb2513fb8fd72572ce19217 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160076 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-11-30tdf#124480 android: Use themed color for icon on start activityMichael Weghorn
Similar to how Change-Id I2061878067d21dcd743ad6ca8d1018db323755d6 Author: Michael Weghorn <m.weghorn@posteo.de> Date: Tue Nov 28 14:22:54 2023 +0100 tdf#124480 android: Use themed color for more icons did for the icons in the toolbars, use the themed color for the directory icon in the start activity as well. While at it, switch to using the same shade of gray that the toolbar icons also use. And rename the icon to drop the "_grey" suffix, since this is now themed and no longer using a hard-coded color. Change-Id: I9fcf51b712a01aab3b9754bcfbd817c89171a64f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160075 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-11-30tdf#124480 android: Rename icons no longer using hard-coded colorMichael Weghorn
As already mentioned in Change-Id I2061878067d21dcd743ad6ca8d1018db323755d6 Author: Michael Weghorn <m.weghorn@posteo.de> Date: Tue Nov 28 14:22:54 2023 +0100 tdf#124480 android: Use themed color for more icons , do this: > Given the icons are no longer hard-coded to be black, > the files with a "_black" suffix will be renamed in > a follow-up commit. (Separate commit to keep the > diff clearer.) Change-Id: Ie2d3433934569dc97530a35d88bda01802af96b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160074 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-11-30tdf#124480 android: Use themed color for more iconsMichael Weghorn
These icons used in the toolbars were previously using a hard-coded fill color. Most of them were using black, but `ic_line` and `ic_rect` used in the "Insert" tab of the bottom toolbar, were previously using a lighter gray than the other items in there for no apparent reason. Switch all of them to use the themed `toolbar_foreground` color that other icons are also using. Together with Change-Id Ic699fd1cecc607bd5e748648113336fe045e72b1 Author: Michael Weghorn <m.weghorn@posteo.de> Date: Tue Nov 28 13:13:12 2023 +0100 tdf#124480 android: Override icon color for dark theme , this makes these icons use a light color when using the dark system theme. Given the icons are no longer hard-coded to be black, the files with a "_black" suffix will be renamed in a follow-up commit. (Separate commit to keep the diff clearer.) Change-Id: I2061878067d21dcd743ad6ca8d1018db323755d6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160073 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-11-30tdf#124480 android: Drop unused iconsMichael Weghorn
Change-Id: I811d9190c0c163db93ec981855f735d47e071cbc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160071 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-11-30tdf#124480 android: Override icon color for dark themeMichael Weghorn
Add a `values-night/colors.xml` that can be used to override the colors specified in `values/colors.xml` specifically for the dark theme. Specify a light color for `toolbar_foreground`, which is the color used for (most) toolbar icons, both for the top-level as well as the bottom toolbar. This makes most icons show up in proper contrast when using dark mode. Others are not making use of the color defined here and will have to be looked into separately. Change-Id: Ic699fd1cecc607bd5e748648113336fe045e72b1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160070 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-11-30tdf#124480 android: Use theme bg color for bottom toolbarsMichael Weghorn
Instead of hard-coding the background color for the 2 toolbars shown at the bottom (`toolbar_bottom` and the color picker), use "colorPrimary" from the theme. Stop overriding "colorPrimary" in `LibreOfficeTheme.Toolbar`, which would otherwise result in a hard-coded white color being used again. This makes those toolbars show up in a darker color when dark theme is enabled. Stop hard-coding the font color of the items in the "Style" tab in the bottom toolbar to black, but use the primary font color instead, so a light color is automatically used when using the dark theme. Change-Id: Ib09ca47e8695903cdfa9f4eb100dc88ecae652a3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160069 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-11-30tdf#124480 android: Support dark themeMichael Weghorn
Support dark theme by inheriting from the corresponding "AppCompat.DayNight" themes rather than forcing the use of a light theme by using the "AppCompat.Light" variants, s.a. [1]. With this in place, the app will automatically use a dark theme for the Android UI controls when that's enabled in the Android system settings. Toolbars and menus mostly look as expected. The bottom toolbar will be handled separately. Icons will also have to be adapted in a follow-up step to provide for better contrast, since they're currently designed for light mode/white background. [1] https://developer.android.com/develop/ui/views/theming/darktheme#themes-styles Change-Id: Ia08edcc9d22b93caa67b146dcf90ee5fd02ee550 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160068 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-11-30tdf#124480 android: Replace hard-coded bg color with themeable oneMichael Weghorn
or drop explicitly setting background color where the one from the parent widget should be used. See also https://developer.android.com/develop/ui/views/theming/darktheme#themes-styles Change-Id: I21dc4b7c45e2cc5add96d603abe5e781d4e09992 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160067 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-11-30tdf#124480 android: Use MaterialToolbar and drop manual bg colorMichael Weghorn
This ensures these 2 toolbars will also use the correct color in dark mode once support for that is added in a subsequent commit. Change-Id: Idcea5096c4e4bdf8ddc6b28df0fc6df05074980b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160066 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-11-27tdf#158398 android: Draw light gray background for Calc headersMichael Weghorn
Similar to the desktop version, use a light gray background color for the Calc header cells. There was already code in place to draw darker gray background to highlight the header cell when a cell in that row/column is selected. (The actually highlighted header cell didn't wasn't always the correct one in a quick test, but that's independent of this change.) Adapt that to always fill the rectangle, but use a lighter gray (lower alpha value) when not selected. Use a separate `Paint` object for the frame (stroke). Set the frame color and text color to black instead of gray, for better contrast to the light gray fill/background. Change-Id: I0490811e928ebd1b3840242fc1aa4682b2786b00 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159989 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-11-27tdf#158398 android: Center Calc header textMichael Weghorn
Center the header text in the Calc header cell, to make better use of the space. This is in line with what the desktop version also does. Setting the text alignment to `Paint.Align.CENTER` is sufficient for centering horizontally. There's no equivalent for centering vertically, so calculate the position based on the text bounds. Change-Id: Ia8d5d8434b703cb7daecd34ae70405883f22f0d5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159988 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-11-27android: Make CalcHeaderCell fields finalMichael Weghorn
Change-Id: I7e14145569428a2803f9376cf719e524aa8963a8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159987 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-11-26android: Suggest file name for PDF exportMichael Weghorn
When using the PDF export feature in Android Viewer, suggest a file name for the PDF file that matches the current display name (which is usually the file name, or "untitled" for a newly created doc that hasn't been saved yet). This can be achieved by setting `Intent.EXTRA_TITLE` for the `ACTION_CREATE_DOCUMENT`. [1] The `DocumentsContract.EXTRA_INITIAL_URI` already set previously already results in the same directory as the doc being preselected in the file chooser: > Callers can set a document URI through > DocumentsContract#EXTRA_INITIAL_URI to indicate the initial location of > documents navigator. System will do its best to launch the navigator in > the specified document if it's a folder, or the folder that contains the > specified document if not. Filling in the current file name was suggested in a Google Play review comment for the app. [1] https://developer.android.com/reference/android/content/Intent#ACTION_CREATE_DOCUMENT Change-Id: Idbd4a89416089f927e0232ce65161b43059ca46d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159959 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-11-23tdf#158331 android: Fix "Save As" for non-experimental modeMichael Weghorn
While "Save" (i.e. saving back to the original location) doesn't make sense when editing is disabled (because the doc cannot be changed) and the menu entry is therefore not available when the experimental editing mode is disabled, "Save As" does make sense, e.g. in order to save a copy of a file opened from another app. The menu entry was there, but not working as expected, a 0-byte file was created. This is because `LibreOfficeMainActivity#saveFileToOriginalSource` would return early if experimental mode is disabled. No longer do that, but save the file as requested. Change-Id: I5785b6060c4ba9cdf3e9c3591b9f941ab987bf4f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159857 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-11-22android: Set autofill hints in Calc toolbarMichael Weghorn
Set autofill hints for the address and formula text edits in the Android Viewer Calc toolbar as described at [1] to address warnings that Android Studio shows about these not being specified. [1] https://developer.android.com/reference/androidx/autofill/HintConstants Change-Id: I1ac7a5babddf3c328145b9f2194d10bb701aa4f1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159810 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-11-22tdf#158307 android a11y: Auto-detect toolbar heightMichael Weghorn
Instead of hard-coding a toolbar height for the cell address and formula bar in Calc, use `android:layout_height="wrap_content"`, so the height is determined based on the font size. This avoids the text getting cut off when a large font size has been selected in Android's accessibility settings. Change-Id: I9bfbe2b7a1db39ac11d9ed0ab15290f974782489 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159809 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-11-17android: Update app-specific/MIME type iconsMichael Weghorn
Just as commit 2105f638fa178f49210116bd914889599930b62a Author: Michael Weghorn <m.weghorn@posteo.de> Date: Fri Nov 17 09:11:42 2023 +0100 android: Update app icon to new startcenter icon updated the main icon for the Android app, also update the MIME type icons that are shown in the "Recent files" section in LibreOfficeUIActivity to the new ones meant to be used for Calc/Draw/Impress/Writer since 7.5. Change-Id: I1d969a290caa3c23589e78151cd5bf70144c3099 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159568 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-11-17android: Update app icon to new startcenter iconMichael Weghorn
Update the icon used for LibreOffice Viewer with the new icon used since LibreOffice 7.5 [1]. Use the startcenter icon from `sysui/desktop/icons/hicolor/` and export for the required resolutions where it doesn't exist yet. [1] https://wiki.documentfoundation.org/ReleaseNotes/7.5#Design Change-Id: Ie9f59d42bbc9375e7ca433c6452223b7ba3033a8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159554 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-11-17android: Reuse launcher icon in activitiesMichael Weghorn
Instead of duplicating the icon as drawable, just use the one from the mipmap folder that's used for the app launcher. Change-Id: Idd6691c4639fb570357280cec63636d07fe06b20 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159553 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-11-16android: Add missing make dependencyMichael Weghorn
After commit f9b9e702465b4de29153b49e077c70a0ad78c89d Author: Michael Weghorn <m.weghorn@posteo.de> Date: Wed Nov 15 13:26:38 2023 +0100 android: Add button to open privacy URL , Android Jenkins builds started to fail intermittently (e.g. [1]) like this: > Task :stripStrippedUIEditingDebugDebugSymbols > Task :compileStrippedUIEditingDebugJavaWithJavac FAILED /home/tdf/lode/jenkins/workspace/android_x86/android/source/src/java/org/libreoffice/AboutDialogFragment.java:93: error: cannot find symbol final String privacyUrl = BuildConfig.PRIVACY_POLICY_URL; ^ symbol: variable PRIVACY_POLICY_URL location: class BuildConfig Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. 1 error FAILURE: Build failed with an exception. This seems due to the pre-existing issue of a missing dependency of the `liboSettings.gradle` target on `android/Bootstrap/Makefile.shared`, so a change to the latter would not have caused the former to be regenerated and any old one still around that didn't set the new build config variable would get used, resulting in the above error. Issue reproducible locally: * do a local Android master build * `git revert f9b9e702465b4de29153b49e077c70a0ad78c89d` * `rm android/source/liboSettings.gradle` * `make` * `git cherry-pick f9b9e702465b4de29153b49e077c70a0ad78c89d` * `make` [1] https://ci.libreoffice.org/job/gerrit_android_x86/33773/console Change-Id: I87275fc71d93f460dfad4d75fc197b8ed8cd9922 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159497 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-11-15android: Add button to open privacy URLMichael Weghorn
In the About dialog, add a "Privacy Policy" button when a privacy URL is set, i.e. the `--with-privacy-policy-url=<URL>` autogen option is used. Clicking the button will fire an Intent to open that URL. Use a custom build config field as described at [1] to make the privacy policy URL available to the Java code. [1] https://developer.android.com/build/gradle-tips#share-custom-fields-and-resource-values-with-your-app-code Change-Id: I6e1a9aff885e4ce132284f49e722b3343fc51b79 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159445 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-11-15android: Drop "More Info" item in "About" dialogMichael Weghorn
Drop the "More Info" button from the dialog, which opened a sample document with more information about LibreOffice. There's already a link to the website, and the "neutral" button in that dialog will be reintroduced to show the privacy policy instead, if set. (An `AlertDialog` has at most 3 buttons.) Change-Id: Ib760daba1ed6f8cfc26eefc7412553bf97c77d70 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159444 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-11-09android: Drop unused LayerView#mFullScreenMichael Weghorn
... and the getters and setters. Change-Id: I14e69e2543d92dc63954bc3faf5a7456d2343fff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159200 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-11-09android: Drop Robocop commentMichael Weghorn
Robocop is a tool for UI-testing fore Firefox on Android [1], but not used for LibreOffice Viewer, so drop the misleading comment. [1] https://wiki.mozilla.org/Auto-tools/Projects/Robocop Change-Id: I270735b2258f18691f60865c683856d58a94bb04 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159199 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-11-09android: Drop never-assigned to LayerRenderer#mPixelBufferMichael Weghorn
That member was never assigned a value but only read from by code claiming to be "used by robocop for testing purposes". [1] describes Robocop as a UI-level testing framework for Firefox for Android, which we don't use, so drop the class member and related test code. [1] https://wiki.mozilla.org/Auto-tools/Projects/Robocop Change-Id: I467296874d4295060cc9670d1f1c8b0dfeb77523 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159198 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-11-09tdf#158125 android: Don't insist on RGB 565 EGL configMichael Weghorn
As the `eglChooseConfig` doc [1] says: > eglChooseConfig returns in configs a list of all EGL frame buffer > configurations that match the attributes specified > [...] > Attributes are matched in an attribute-specific manner. Some of the > attributes, such as EGL_LEVEL, must match the specified value exactly. > Others, such as, EGL_RED_SIZE must meet or exceed the specified minimum > values. The config/attribute list used for Android Viewer specifies EGL_RED_SIZE=5, EGL_GREEN_SIZE=6, and EGL_BLUE_SIZE=5 and so far, only configs using exactly those bit sizes were accepted, causing 1 of the 11 devices used in automated tests in Google Play CI crashing with this stack trace: Exception org.mozilla.gecko.gfx.GLController$GLControllerException: No suitable EGL configuration found at org.mozilla.gecko.gfx.GLController.chooseConfig (GLController.java:219) at org.mozilla.gecko.gfx.GLController.initEGL (GLController.java:172) at org.mozilla.gecko.gfx.GLController.initEGLContext (GLController.java:176) at org.mozilla.gecko.gfx.GLController.initGLContext (GLController.java:57) at org.mozilla.gecko.gfx.RenderControllerThread.doSurfaceCreated (RenderControllerThread.java:132) at org.mozilla.gecko.gfx.RenderControllerThread.execute (RenderControllerThread.java:52) at org.mozilla.gecko.gfx.RenderControllerThread.run (RenderControllerThread.java:30) Since only configs fulfilling the minimium specification have been returned, I don't see a reason to insist on having one that uses exactly the specified amount of bits for the individual color components. I also didn't see any rendering issues in a quick test (also using the colorful Calc sheet attachment 188343 from tdf#156182) forcing the use of a configuration using EGL_RED_SIZE=8, EGL_GREEN_SIZE=8, and EGL_BLUE_SIZE=8 with an x86_64 AVD and on a Fairphone 3+ (arm64) using this temporary local change: diff --git a/android/source/src/java/org/mozilla/gecko/gfx/GLController.java b/android/source/src/java/org/mozilla/gecko/gfx/GLController.java index 45600e9f1e7c..9e7f348e9e72 100644 --- a/android/source/src/java/org/mozilla/gecko/gfx/GLController.java +++ b/android/source/src/java/org/mozilla/gecko/gfx/GLController.java @@ -171,7 +171,7 @@ public class GLController { mEGL.eglGetConfigAttrib(mEGLDisplay, config, EGL10.EGL_RED_SIZE, red); mEGL.eglGetConfigAttrib(mEGLDisplay, config, EGL10.EGL_GREEN_SIZE, green); mEGL.eglGetConfigAttrib(mEGLDisplay, config, EGL10.EGL_BLUE_SIZE, blue); - if (red[0] == 5 && green[0] == 6 && blue[0] == 5) { + if (red[0] == 8 && green[0] == 8 && blue[0] == 8) { return config; } } Therefore, fall back to using another config that fulfils the specification. (Leave the previously required config as preferred one for now, maybe it still has advantages, e.g. might be more efficient due to not wasting extra bits for the color components that are not needed for the rendering in LibreOffice Viewer. (?)) [1] https://registry.khronos.org/EGL/sdk/docs/man/html/eglChooseConfig.xhtml Change-Id: I953d292248004bc6f7e9384ceef78c8a88c21e9e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159204 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-11-09android a11y: Add content labelsMichael Weghorn
Add a few content labels, so screen readers can present these UI elements in a more meaningful way. Reported by Google Play CI: > This item may not have a label readable by screen readers. > Learn more [1] [1] https://support.google.com/accessibility/android/answer/7158690 Change-Id: Ic8e8885ed132367426207fad652e324ea4eb0790 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159206 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-11-09android: Drop obsolete TODO commentMichael Weghorn
This comment was originally for the code underneath, that has already been separated into a separate method in gecko-dev commit [1] commit 60ed20fee4095523ee498579c71fc17032d1004b Author: Patrick Walton <pwalton@mozilla.com> Date: Mon Feb 13 12:27:09 2012 -0800 Split out Java compositor shader program activation and deactivation into separate functions , but the comment was left behind. [1] https://github.com/mozilla/gecko-dev/commit/60ed20fee4095523ee498579c71fc17032d1004b Change-Id: Ied0a4aaec4d8228665748b834026b54c8e9615bc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159184 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-11-09android: Drop unused GLController#checkForLostContextMichael Weghorn
Change-Id: Ia9f313a1937d4d491b76e9e5d6e4689eeb20431b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159183 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>