fix: pfp broken closed groups why
This commit is contained in:
parent
c988573952
commit
77e948feec
|
@ -52,12 +52,19 @@ class ProfilePictureView @JvmOverloads constructor(
|
|||
.sorted()
|
||||
.take(2)
|
||||
.toMutableList()
|
||||
val pk = members.getOrNull(0)?.serialize() ?: ""
|
||||
publicKey = pk
|
||||
displayName = getUserDisplayName(pk)
|
||||
val apk = members.getOrNull(1)?.serialize() ?: ""
|
||||
additionalPublicKey = apk
|
||||
additionalDisplayName = getUserDisplayName(apk)
|
||||
if (members.size <= 1) {
|
||||
publicKey = ""
|
||||
displayName = ""
|
||||
additionalPublicKey = ""
|
||||
additionalDisplayName = ""
|
||||
} else {
|
||||
val pk = members.getOrNull(0)?.serialize() ?: ""
|
||||
publicKey = pk
|
||||
displayName = getUserDisplayName(pk)
|
||||
val apk = members.getOrNull(1)?.serialize() ?: ""
|
||||
additionalPublicKey = apk
|
||||
additionalDisplayName = getUserDisplayName(apk)
|
||||
}
|
||||
} else if(recipient.isOpenGroupInboxRecipient) {
|
||||
val publicKey = GroupUtil.getDecodedOpenGroupInbox(recipient.address.serialize())
|
||||
this.publicKey = publicKey
|
||||
|
@ -113,7 +120,7 @@ class ProfilePictureView @JvmOverloads constructor(
|
|||
if (signalProfilePicture != null && avatar != "0" && avatar != "") {
|
||||
glide.clear(imageView)
|
||||
glide.load(signalProfilePicture)
|
||||
.placeholder(unknownRecipientDrawable)
|
||||
.placeholder(R.drawable.ic_profile_default)
|
||||
.centerCrop()
|
||||
.error(glide.load(placeholder))
|
||||
.diskCacheStrategy(DiskCacheStrategy.NONE)
|
||||
|
@ -121,17 +128,21 @@ class ProfilePictureView @JvmOverloads constructor(
|
|||
.into(imageView)
|
||||
} else if (recipient.isOpenGroupRecipient && recipient.groupAvatarId == null) {
|
||||
glide.clear(imageView)
|
||||
imageView.setImageDrawable(unknownOpenGroupDrawable)
|
||||
glide.load(R.drawable.ic_notification)
|
||||
.centerCrop()
|
||||
.into(imageView)
|
||||
} else {
|
||||
glide.clear(imageView)
|
||||
glide.load(placeholder)
|
||||
.placeholder(unknownRecipientDrawable)
|
||||
.placeholder(R.drawable.ic_profile_default)
|
||||
.centerCrop()
|
||||
.diskCacheStrategy(DiskCacheStrategy.NONE).circleCrop().into(imageView)
|
||||
}
|
||||
profilePicturesCache[publicKey] = recipient.profileAvatar
|
||||
} else {
|
||||
imageView.setImageDrawable(null)
|
||||
glide.load(R.drawable.ic_profile_default)
|
||||
.centerInside()
|
||||
.into(imageView)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
android:layout_height="@dimen/small_profile_picture_size"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:background="@drawable/profile_picture_view_small_background" />
|
||||
|
||||
<ImageView
|
||||
|
@ -24,6 +25,7 @@
|
|||
android:layout_height="@dimen/small_profile_picture_size"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:background="@drawable/profile_picture_view_small_background" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
|
|
@ -33,7 +33,7 @@ public class ResourceContactPhoto implements FallbackContactPhoto {
|
|||
Drawable background = TextDrawable.builder().buildRound(" ", inverted ? Color.WHITE : color);
|
||||
RoundedDrawable foreground = (RoundedDrawable) RoundedDrawable.fromDrawable(context.getResources().getDrawable(resourceId));
|
||||
|
||||
foreground.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
|
||||
foreground.setScaleType(ImageView.ScaleType.CENTER_CROP);
|
||||
|
||||
if (inverted) {
|
||||
foreground.setColorFilter(color, PorterDuff.Mode.SRC_ATOP);
|
||||
|
|
Loading…
Reference in New Issue