refactor: profile pictures kinda broken

This commit is contained in:
0x330a 2023-07-12 15:40:14 +10:00
parent c7afe68bec
commit f650467105
No known key found for this signature in database
GPG Key ID: 267811D6E6A2698C
2 changed files with 5 additions and 1 deletions

View File

@ -129,19 +129,21 @@ class ProfilePictureView @JvmOverloads constructor(
} else if (recipient.isOpenGroupRecipient && recipient.groupAvatarId == null) { } else if (recipient.isOpenGroupRecipient && recipient.groupAvatarId == null) {
glide.clear(imageView) glide.clear(imageView)
glide.load(unknownOpenGroupDrawable) glide.load(unknownOpenGroupDrawable)
.centerCrop()
.circleCrop() .circleCrop()
.into(imageView) .into(imageView)
} else { } else {
glide.clear(imageView) glide.clear(imageView)
glide.load(placeholder) glide.load(placeholder)
.placeholder(unknownRecipientDrawable) .placeholder(unknownRecipientDrawable)
.centerCrop()
.circleCrop() .circleCrop()
.diskCacheStrategy(DiskCacheStrategy.NONE).circleCrop().into(imageView) .diskCacheStrategy(DiskCacheStrategy.NONE).circleCrop().into(imageView)
} }
profilePicturesCache[publicKey] = recipient.profileAvatar profilePicturesCache[publicKey] = recipient.profileAvatar
} else { } else {
glide.load(unknownRecipientDrawable) glide.load(unknownRecipientDrawable)
.circleCrop() .centerCrop()
.into(imageView) .into(imageView)
} }
} }

View File

@ -31,6 +31,7 @@
</RelativeLayout> </RelativeLayout>
<ImageView <ImageView
android:scaleType="centerCrop"
android:id="@+id/singleModeImageView" android:id="@+id/singleModeImageView"
android:layout_width="@dimen/medium_profile_picture_size" android:layout_width="@dimen/medium_profile_picture_size"
android:layout_height="@dimen/medium_profile_picture_size" android:layout_height="@dimen/medium_profile_picture_size"
@ -38,6 +39,7 @@
<ImageView <ImageView
android:id="@+id/largeSingleModeImageView" android:id="@+id/largeSingleModeImageView"
android:scaleType="centerCrop"
android:layout_width="@dimen/large_profile_picture_size" android:layout_width="@dimen/large_profile_picture_size"
android:layout_height="@dimen/large_profile_picture_size" android:layout_height="@dimen/large_profile_picture_size"
android:background="@drawable/profile_picture_view_large_background" /> android:background="@drawable/profile_picture_view_large_background" />