android: Update compile/targetSdkVersion to 35, disable edge-to-edge

Update compileSdk and targetSdkVersion to 35 (Android 15).

In a quick test, running the app seems fine in an API 36 (Android 16)
AVD configured to use 16 KB Page Size, for which support was added
in Android 15 [1].

Changing the targetSdkVersion to 35 implies that edge-to-edge
would now enabled by default [2]. That would result in the
app par overlapping with the system bar and interaction would
be broken. For now, avoid that by explicitly opting out of
edge-to-edge support by setting
android:windowOptOutEdgeToEdgeEnforcement for API versions >= 35
in the LibreOfficeTheme used by all activities by now.

Helpful article: [3]

That won't work for targetSdkVersion 36 any more (see [4]),
but at least helps to comply with the upcoming required
targetSdkVersion of 35 in Google Play and gives some time
to implement proper support for edge-to-edge
for Android 16+ devices before increasing the targetSdkVersion
further.

Android Viewer works as expected in a quick test
with an API 36 (Android 16) x86_64 AVD
and an API 24 (Android 7) x86 AVD (with an additional
local revert of commit 9d1e76f7da
to prevent a deadlock when opening documents that is unrelated
to this change here).

[1] https://developer.android.com/about/versions/15/behavior-changes-all
[2] https://developer.android.com/about/versions/15/behavior-changes-15#window-insets
[3] https://medium.com/androiddevelopers/insets-handling-tips-for-android-15s-edge-to-edge-enforcement-872774e8839b
[4] https://developer.android.com/about/versions/16/behavior-changes-16#edge-to-edge

Change-Id: Id6d33bfbb7ca49c65e3875efb87c3c575be5f5ce
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187627
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
This commit is contained in:
Michael Weghorn
2025-07-10 12:32:02 +02:00
parent 42ee4ef3a3
commit 2b77994d45
2 changed files with 10 additions and 2 deletions

View File

@ -43,7 +43,7 @@ base {
android {
namespace 'org.libreoffice'
compileSdk 34
compileSdk 35
buildFeatures {
buildConfig = true
}
@ -60,7 +60,7 @@ android {
}
defaultConfig {
// minSdkVersion is set in liboSettings.gradle
targetSdkVersion 34
targetSdkVersion 35
vectorDrawables.useSupportLibrary = true
}
buildTypes {

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="LibreOfficeTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
<item name="android:windowOptOutEdgeToEdgeEnforcement">
true
</item>
</style>
</resources>