mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 17:29:32 +01:00
Add badge to Recipient row of reactions sheet.
This commit is contained in:
@@ -9,6 +9,7 @@ import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import org.thoughtcrime.securesms.R;
|
||||
import org.thoughtcrime.securesms.badges.BadgeImageView;
|
||||
import org.thoughtcrime.securesms.components.AvatarImageView;
|
||||
import org.thoughtcrime.securesms.mms.GlideApp;
|
||||
import org.thoughtcrime.securesms.util.AvatarUtil;
|
||||
@@ -46,6 +47,7 @@ final class ReactionRecipientsAdapter extends RecyclerView.Adapter<ReactionRecip
|
||||
static final class ViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
private final AvatarImageView avatar;
|
||||
private final BadgeImageView badge;
|
||||
private final TextView recipient;
|
||||
private final TextView emoji;
|
||||
|
||||
@@ -53,6 +55,7 @@ final class ReactionRecipientsAdapter extends RecyclerView.Adapter<ReactionRecip
|
||||
super(itemView);
|
||||
|
||||
avatar = itemView.findViewById(R.id.reactions_bottom_view_recipient_avatar);
|
||||
badge = itemView.findViewById(R.id.reactions_bottom_view_recipient_badge);
|
||||
recipient = itemView.findViewById(R.id.reactions_bottom_view_recipient_name);
|
||||
emoji = itemView.findViewById(R.id.reactions_bottom_view_recipient_emoji);
|
||||
}
|
||||
@@ -63,10 +66,12 @@ final class ReactionRecipientsAdapter extends RecyclerView.Adapter<ReactionRecip
|
||||
if (reaction.getSender().isSelf()) {
|
||||
this.recipient.setText(R.string.ReactionsRecipientAdapter_you);
|
||||
this.avatar.setAvatar(GlideApp.with(avatar), null, false);
|
||||
this.badge.setBadge(null);
|
||||
AvatarUtil.loadIconIntoImageView(reaction.getSender(), avatar);
|
||||
} else {
|
||||
this.recipient.setText(reaction.getSender().getDisplayName(itemView.getContext()));
|
||||
this.avatar.setAvatar(GlideApp.with(avatar), reaction.getSender(), false);
|
||||
this.badge.setBadgeFromRecipient(reaction.getSender());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user