Skip to content

Commit d927065

Browse files
Merge pull request #5942 from nextcloud/bugfix/5940/changeUserAvatar
fix - unable to change user avatar
2 parents c4d6ea0 + 99eadda commit d927065

5 files changed

Lines changed: 49 additions & 0 deletions

File tree

app/build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,11 @@ dependencies {
304304
implementation "io.noties.markwon:ext-tasklist:$markwonVersion"
305305
implementation "io.noties.markwon:ext-tables:$markwonVersion"
306306

307+
// Avatar picker
307308
implementation 'com.github.nextcloud-deps:ImagePicker:2.1.0.2'
309+
// Override avatar picker's internal crop lib for better dge-to-edge support
310+
implementation 'com.github.yalantis:ucrop:2.2.11'
311+
308312
implementation 'io.github.elye:loaderviewlibrary:3.0.0'
309313
implementation 'org.osmdroid:osmdroid-android:6.1.20'
310314
implementation ('fr.dudie:nominatim-api:3.4', {

app/src/main/AndroidManifest.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,16 @@
253253
android:name=".conversationinfo.ConversationInfoActivity"
254254
android:theme="@style/AppTheme" />
255255

256+
<activity
257+
android:name="com.github.dhaval2404.imagepicker.ImagePickerActivity"
258+
android:theme="@style/ImagePickerTheme.NonFullScreen"
259+
tools:replace="android:theme" />
260+
261+
<activity
262+
android:name="com.yalantis.ucrop.UCropActivity"
263+
android:theme="@style/Theme.UCrop"
264+
tools:replace="android:theme" />
265+
256266
<activity
257267
android:name=".conversationinfoedit.ConversationInfoEditActivity"
258268
android:theme="@style/AppTheme" />

app/src/main/res/values-v27/styles.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,9 @@
3030
<item name="alertDialogTheme">@style/Theme.AppCompat.DayNight.Dialog</item>
3131
<item name="android:alertDialogTheme">?alertDialogTheme</item>
3232
</style>
33+
34+
<style name="ImagePickerTheme.NonFullScreen" parent="Theme.Material3.DayNight.NoActionBar">
35+
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
36+
<item name="android:fitsSystemWindows">true</item>
37+
</style>
3338
</resources>

app/src/main/res/values/styles.xml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,28 @@
4444
<item name="iconTint">@color/fontAppbar</item>
4545
</style>
4646

47+
<style name="ImagePickerTheme.NonFullScreen" parent="Theme.Material3.DayNight.NoActionBar">
48+
<item name="android:fitsSystemWindows">true</item>
49+
</style>
50+
51+
<style name="Theme.UCrop" parent="Theme.MaterialComponents.DayNight.NoActionBar">
52+
<!-- Status bar: dark background, white (light) icons -->
53+
<item name="android:windowLightStatusBar">false</item>
54+
<item name="android:statusBarColor">@android:color/transparent</item>
55+
56+
<!-- Navigation bar: dark to match -->
57+
<item name="android:navigationBarColor">@android:color/transparent</item>
58+
59+
<!-- Force a light (white) toolbar surface even in dark mode -->
60+
<item name="colorSurface">#FFFFFF</item>
61+
<item name="colorOnSurface">#000000</item>
62+
63+
<!-- Primary used as toolbar tint fallback -->
64+
<item name="colorPrimary">#FFFFFF</item>
65+
<item name="colorOnPrimary">#000000</item>
66+
</style>
67+
68+
4769
<style name="ChatSendButtonMenu" parent="@style/Widget.Material3.PopupMenu">
4870
<item name="android:dropDownVerticalOffset">-90dp</item>
4971
<item name="android:colorPrimary">@color/fg_inverse</item>

gradle/verification-metadata.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18135,6 +18135,14 @@
1813518135
<sha256 value="2e65fbabc8876cb388abf006b399ed5241e963940e0798d0e2310e339aaf738b" origin="Generated by Gradle" reason="Artifact is not signed"/>
1813618136
</artifact>
1813718137
</component>
18138+
<component group="com.github.yalantis" name="ucrop" version="2.2.11">
18139+
<artifact name="ucrop-2.2.11.aar">
18140+
<sha256 value="c12db23784aaa954d8998106cf5c1cfee2993c62f7601c790da8e21d4c51a0a9" origin="Generated by Gradle" reason="Artifact is not signed"/>
18141+
</artifact>
18142+
<artifact name="ucrop-2.2.11.pom">
18143+
<sha256 value="1e070fcc04b929e8b0f847463240550a1639e4bc2e7110b0a57f4f1366247580" origin="Generated by Gradle" reason="Artifact is not signed"/>
18144+
</artifact>
18145+
</component>
1813818146
<component group="com.github.yalantis" name="ucrop" version="2.2.6">
1813918147
<artifact name="ucrop-2.2.6.aar">
1814018148
<sha256 value="aa2a5929b6916d05d347a24ddb1319e0330f109f683b9080897d73fdb8638e6b" origin="Generated by Gradle" reason="Artifact is not signed"/>

0 commit comments

Comments
 (0)