show online status AND emoji in conversations info

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
Marcel Hibbe 2022-02-21 11:05:51 +01:00
parent d453773a1d
commit 176568b628
No known key found for this signature in database
GPG key ID: C793F8B59F43CE7B

View file

@ -129,18 +129,19 @@ public class UserItem extends AbstractFlexibleItem<UserItem.UserItemViewHolder>
} }
} }
if (participant.statusIcon != null && !participant.statusIcon.isEmpty()) {
holder.participantEmoji.setText(participant.statusIcon);
} else {
holder.participantEmoji.setVisibility(View.GONE);
}
if (participant.status != null && participant.status.equals(StatusType.DND.getString())) { if (participant.status != null && participant.status.equals(StatusType.DND.getString())) {
setOnlineStateIcon(holder, R.drawable.ic_user_status_dnd_with_border); setOnlineStateIcon(holder, R.drawable.ic_user_status_dnd_with_border);
} else if (participant.statusIcon != null && !participant.statusIcon.isEmpty()) {
holder.participantOnlineStateImage.setVisibility(View.GONE);
holder.participantEmoji.setVisibility(View.VISIBLE);
holder.participantEmoji.setText(participant.statusIcon);
} else if (participant.status != null && participant.status.equals(StatusType.AWAY.getString())) { } else if (participant.status != null && participant.status.equals(StatusType.AWAY.getString())) {
setOnlineStateIcon(holder, R.drawable.ic_user_status_away_with_border); setOnlineStateIcon(holder, R.drawable.ic_user_status_away_with_border);
} else if (participant.status != null && participant.status.equals(StatusType.ONLINE.getString())) { } else if (participant.status != null && participant.status.equals(StatusType.ONLINE.getString())) {
setOnlineStateIcon(holder, R.drawable.online_status_with_border); setOnlineStateIcon(holder, R.drawable.online_status_with_border);
} else { } else {
holder.participantEmoji.setVisibility(View.GONE);
holder.participantOnlineStateImage.setVisibility(View.GONE); holder.participantOnlineStateImage.setVisibility(View.GONE);
} }
@ -277,8 +278,6 @@ public class UserItem extends AbstractFlexibleItem<UserItem.UserItemViewHolder>
} }
private void setOnlineStateIcon(UserItem.UserItemViewHolder holder, int icon) { private void setOnlineStateIcon(UserItem.UserItemViewHolder holder, int icon) {
holder.participantEmoji.setVisibility(View.GONE);
holder.participantOnlineStateImage.setVisibility(View.VISIBLE);
holder.participantOnlineStateImage.setImageDrawable(ContextCompat.getDrawable(context, icon)); holder.participantOnlineStateImage.setImageDrawable(ContextCompat.getDrawable(context, icon));
} }