From 9bd35e3a18e355430b7663443c88563a53e6e47e Mon Sep 17 00:00:00 2001 From: Vladimir Daskalov Date: Sat, 18 Apr 2026 17:45:30 -0400 Subject: [PATCH] Fix UCrop screen overlapping the system bars on Android 15+ (#9084) Since the app targets SDK 35, Android 15 forces edge-to-edge layout for every window. UCrop 2.2.8 - the third-party library backing the avatar and image cropping screen - does not consume WindowInsets, so its toolbar (containing the save checkmark) is drawn under the status bar and its bottom rotate / scale controls are drawn under the 3-button navigation bar. On many devices the save button cannot even be tapped because the gesture is captured by the status bar. Apply a dedicated Theme.Vector.UCrop to UCropActivity that, on API 35, sets android:windowOptOutEdgeToEdgeEnforcement="true" - the official escape hatch documented for legacy screens that have not yet migrated to insets-aware layouts. The base theme keeps uCrop's expected AppCompat.Light.NoActionBar parent, so behaviour on API < 35 is unchanged. Signed-off-by: Vladimir Daskalov --- changelog.d/9084.bugfix | 1 + .../src/main/res/values-v35/theme_ucrop.xml | 21 +++++++++++++++++++ .../src/main/res/values/theme_ucrop.xml | 21 +++++++++++++++++++ vector/src/main/AndroidManifest.xml | 3 ++- 4 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 changelog.d/9084.bugfix create mode 100644 library/ui-styles/src/main/res/values-v35/theme_ucrop.xml create mode 100644 library/ui-styles/src/main/res/values/theme_ucrop.xml diff --git a/changelog.d/9084.bugfix b/changelog.d/9084.bugfix new file mode 100644 index 00000000000..b54bc4cd004 --- /dev/null +++ b/changelog.d/9084.bugfix @@ -0,0 +1 @@ +Fix the avatar / image cropping screen on Android 15+: the toolbar save button and the bottom rotate / scale controls are no longer hidden behind the system status bar and 3-button navigation bar. ([#9084](https://github.com/element-hq/element-android/issues/9084)) diff --git a/library/ui-styles/src/main/res/values-v35/theme_ucrop.xml b/library/ui-styles/src/main/res/values-v35/theme_ucrop.xml new file mode 100644 index 00000000000..6b4616d4cbd --- /dev/null +++ b/library/ui-styles/src/main/res/values-v35/theme_ucrop.xml @@ -0,0 +1,21 @@ + + + + + + + diff --git a/library/ui-styles/src/main/res/values/theme_ucrop.xml b/library/ui-styles/src/main/res/values/theme_ucrop.xml new file mode 100644 index 00000000000..f37c621b237 --- /dev/null +++ b/library/ui-styles/src/main/res/values/theme_ucrop.xml @@ -0,0 +1,21 @@ + + + + +