Skip to content

Commit

Permalink
Clear last message if null in dialog list (Fix issue stfalcon-studio#189
Browse files Browse the repository at this point in the history
)
  • Loading branch information
mathroule committed Aug 28, 2018
1 parent f6e3ee3 commit b22214a
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,8 @@ public void onBind(final DIALOG dialog) {
tvDate.setText(formattedDate == null
? getDateString(lastMessageDate)
: formattedDate);
} else {
tvDate.setText(null);
}

//Set Dialog avatar
Expand All @@ -643,11 +645,14 @@ public void onBind(final DIALOG dialog) {
imageLoader.loadImage(ivLastMessageUser, dialog.getLastMessage().getUser().getAvatar());
}
ivLastMessageUser.setVisibility(dialogStyle.isDialogMessageAvatarEnabled()
&& dialog.getUsers().size() > 1 ? VISIBLE : GONE);
&& dialog.getUsers().size() > 1
&& dialog.getLastMessage() != null ? VISIBLE : GONE);

//Set Last message text
if (dialog.getLastMessage() != null) {
tvLastMessage.setText(dialog.getLastMessage().getText());
} else {
tvLastMessage.setText(null);
}

//Set Unread message count bubble
Expand Down

0 comments on commit b22214a

Please sign in to comment.