set avatar invisible when message is null

This commit is contained in:
Daniel Gultsch 2023-03-28 23:14:05 +02:00
parent 4d5445d123
commit 03cf48f4c1
No known key found for this signature in database
GPG key ID: F43D18AD2A0982C2
2 changed files with 1 additions and 1 deletions

View file

@ -93,7 +93,6 @@ public class MessageAdapter
if (holder instanceof MessageReceivedViewHolder messageReceivedViewHolder) { if (holder instanceof MessageReceivedViewHolder messageReceivedViewHolder) {
final var addressWithName = message.getAddressWithName(); final var addressWithName = message.getAddressWithName();
final var avatar = message.getAvatar(); final var avatar = message.getAvatar();
messageReceivedViewHolder.binding.avatar.setVisibility(View.VISIBLE);
if (avatar != null) { if (avatar != null) {
AvatarFetcher.fetchInto(messageReceivedViewHolder.binding.avatar, avatar); AvatarFetcher.fetchInto(messageReceivedViewHolder.binding.avatar, avatar);
} else { } else {

View file

@ -9,6 +9,7 @@
android:paddingVertical="6dp"> android:paddingVertical="6dp">
<ImageView <ImageView
android:visibility="@{message == null ? View.INVISIBLE : View.VISIBLE}"
android:id="@+id/avatar" android:id="@+id/avatar"
android:layout_width="@dimen/avatar_chat_overview_size" android:layout_width="@dimen/avatar_chat_overview_size"
android:layout_height="@dimen/avatar_chat_overview_size" android:layout_height="@dimen/avatar_chat_overview_size"