Add additional Group Calling features.

This commit is contained in:
Cody Henthorne
2020-11-20 15:42:46 -05:00
committed by GitHub
parent 8c1737e597
commit b90a74d26a
61 changed files with 1193 additions and 134 deletions

View File

@@ -44,15 +44,25 @@ public final class AvatarUtil {
}
public static void loadBlurredIconIntoViewBackground(@NonNull Recipient recipient, @NonNull View target) {
loadBlurredIconIntoViewBackground(recipient, target, false);
}
public static void loadBlurredIconIntoViewBackground(@NonNull Recipient recipient, @NonNull View target, boolean useSelfProfileAvatar) {
Context context = target.getContext();
if (recipient.getContactPhoto() == null) {
ContactPhoto photo;
if (recipient.isSelf() && useSelfProfileAvatar) {
photo = new ProfileContactPhoto(Recipient.self(), Recipient.self().getProfileAvatar());
} else if (recipient.getContactPhoto() == null) {
target.setBackgroundColor(ContextCompat.getColor(target.getContext(), R.color.black));
return;
} else {
photo = recipient.getContactPhoto();
}
GlideApp.with(target)
.load(recipient.getContactPhoto())
.load(photo)
.transform(new CenterCrop(), new BlurTransformation(context, 0.25f, BlurTransformation.MAX_RADIUS))
.into(new CustomViewTarget<View, Drawable>(target) {
@Override