Skip to content

Commit 31d7d86

Browse files
fix(avatar): Fix avatar sizing for non-user avatars
Signed-off-by: Andy Scherzinger <[email protected]>
1 parent c4d080e commit 31d7d86

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

app/src/main/java/com/owncloud/android/ui/AvatarGroupLayout.kt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
/*
22
* Nextcloud Android client application
33
*
4-
* @author Andy Scherzinger
5-
* @author Stefan Niedermann
6-
* Copyright (C) 2021 Andy Scherzinger
7-
* Copyright (C) 2021 Stefan Niedermann
8-
*
4+
* SPDX-FileCopyrightText: 2021-2026 Nextcloud GmbH and Nextcloud contributors
95
* SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
106
*/
117
package com.owncloud.android.ui
@@ -76,6 +72,7 @@ class AvatarGroupLayout @JvmOverloads constructor(
7672
val avatar = ImageView(context).apply {
7773
layoutParams = avatarLayoutParams
7874
setPadding(avatarBorderSize, avatarBorderSize, avatarBorderSize, avatarBorderSize)
75+
scaleType = ImageView.ScaleType.CENTER_INSIDE
7976
background = borderDrawable
8077
}
8178

app/src/main/java/com/owncloud/android/utils/theme/FilesSpecificViewThemeUtils.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/*
22
* Nextcloud - Android Client
33
*
4+
* SPDX-FileCopyrightText: 2022-2026 Nextcloud GmbH and Nextcloud contributors
45
* SPDX-FileCopyrightText: 2022 Álvaro Brey <[email protected]>
5-
* SPDX-FileCopyrightText: 2022 Nextcloud GmbH
66
* SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
77
*/
88
package com.owncloud.android.utils.theme
@@ -70,6 +70,7 @@ class FilesSpecificViewThemeUtils @Inject constructor(
7070
null
7171
)
7272
avatar.cropToPadding = true
73+
avatar.scaleType = ImageView.ScaleType.CENTER_INSIDE
7374
avatar.setPadding(padding, padding, padding, padding)
7475
}
7576

@@ -83,7 +84,7 @@ class FilesSpecificViewThemeUtils @Inject constructor(
8384
androidViewThemeUtils.colorImageViewBackgroundAndIcon(avatar)
8485
}
8586
ShareType.ROOM -> {
86-
createAvatarBase(R.drawable.first_run_talk, AvatarPadding.LARGE)
87+
createAvatarBase(R.drawable.ic_talk, AvatarPadding.LARGE)
8788
androidViewThemeUtils.colorImageViewBackgroundAndIcon(avatar)
8889
}
8990
ShareType.CIRCLE -> {

app/src/main/res/drawable/ic_talk.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
~ SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
77
-->
88
<vector xmlns:android="http://schemas.android.com/apk/res/android"
9-
android:width="16dp"
10-
android:height="16dp"
9+
android:width="24dp"
10+
android:height="24dp"
1111
android:autoMirrored="true"
1212
android:viewportWidth="16"
1313
android:viewportHeight="16">

0 commit comments

Comments
 (0)