add grey avatar with first letter of email-guest in call view

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
Marcel Hibbe 2024-11-21 15:07:57 +01:00
parent c75cf2fe20
commit 199ba4be34
No known key found for this signature in database
GPG key ID: C793F8B59F43CE7B
2 changed files with 14 additions and 1 deletions

View file

@ -172,6 +172,10 @@ public class ParticipantDisplayItem {
return raisedHand;
}
public Participant.ActorType getActorType() {
return actorType;
}
public void addObserver(Observer observer) {
participantDisplayItemNotifier.addObserver(observer);
}

View file

@ -22,6 +22,7 @@ import android.widget.TextView;
import com.nextcloud.talk.R;
import com.nextcloud.talk.activities.CallActivity;
import com.nextcloud.talk.extensions.ImageViewExtensionsKt;
import com.nextcloud.talk.models.json.participants.Participant;
import org.webrtc.MediaStream;
import org.webrtc.MediaStreamTrack;
@ -143,7 +144,15 @@ public class ParticipantsAdapter extends BaseAdapter {
nickTextView.setVisibility(View.VISIBLE);
nickTextView.setText(participantDisplayItem.getNick());
}
ImageViewExtensionsKt.loadAvatarWithUrl(imageView,null, participantDisplayItem.getUrlForAvatar());
if (participantDisplayItem.getActorType() == Participant.ActorType.GUESTS ||
participantDisplayItem.getActorType() == Participant.ActorType.EMAILS) {
ImageViewExtensionsKt.loadFirstLetterAvatar(
imageView,
String.valueOf(participantDisplayItem.getNick().charAt(0))
);
} else {
ImageViewExtensionsKt.loadAvatarWithUrl(imageView,null, participantDisplayItem.getUrlForAvatar());
}
}
ImageView audioOffView = convertView.findViewById(R.id.remote_audio_off);