Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/9084.bugfix
Original file line number Diff line number Diff line change
@@ -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))
21 changes: 21 additions & 0 deletions library/ui-styles/src/main/res/values-v35/theme_ucrop.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">

<!--
Android 15 (API 35) forces every window to be edge-to-edge when the app
targets SDK 35+. UCrop 2.2.8 does not handle WindowInsets, which causes
its title bar (close / save) to be hidden behind the status bar and the
rotate / scale controls to be hidden behind 3-button navigation.

windowOptOutEdgeToEdgeEnforcement is the official escape hatch documented
for legacy screens that have not yet been migrated to insets-aware layout.
It is honoured on API 35 only; on API 36+ we will need to either upgrade
UCrop or override its layouts to consume insets directly.

Tracks https://github.com/element-hq/element-android/issues/9084
-->
<style name="Theme.Vector.UCrop" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowOptOutEdgeToEdgeEnforcement" tools:targetApi="35">true</item>
</style>

</resources>
21 changes: 21 additions & 0 deletions library/ui-styles/src/main/res/values/theme_ucrop.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<!--
Theme applied to com.yalantis.ucrop.UCropActivity.

UCrop 2.2.8 (the version pinned in :vector) does not consume window insets,
so its toolbar and bottom controls are drawn under the system bars when the
platform enforces edge-to-edge layout (Android 15 / API 35+).

On older API levels there is nothing to do here: the system bars are opaque
and the activity already lays out within them. The v35 override of this
theme opts the activity out of edge-to-edge enforcement so the toolbar's
save button and the bottom rotate / scale controls remain reachable.

AppCompat.Light.NoActionBar matches the parent declared by uCrop's own
manifest entry, so the activity continues to render its custom toolbar.
-->
<style name="Theme.Vector.UCrop" parent="Theme.AppCompat.Light.NoActionBar" />

</resources>
3 changes: 2 additions & 1 deletion vector/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,8 @@
<activity android:name=".features.crypto.quads.SharedSecureStorageActivity" />
<activity
android:name="com.yalantis.ucrop.UCropActivity"
android:screenOrientation="portrait" />
android:screenOrientation="portrait"
android:theme="@style/Theme.Vector.UCrop" />
<activity
android:name=".features.attachments.preview.AttachmentsPreviewActivity"
android:theme="@style/Theme.Vector.Black.AttachmentsPreview" />
Expand Down