mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-23 21:45:42 +03:00
Merge pull request #2267 from nextcloud/fixStatusVisibility
Fix status visibility in conversation list
This commit is contained in:
commit
23e3f323f7
1 changed files with 8 additions and 2 deletions
|
@ -97,7 +97,7 @@ public class ConversationItem extends AbstractFlexibleItem<ConversationItem.Conv
|
|||
public boolean equals(Object o) {
|
||||
if (o instanceof ConversationItem) {
|
||||
ConversationItem inItem = (ConversationItem) o;
|
||||
return conversation.equals(inItem.getModel());
|
||||
return conversation.equals(inItem.getModel()) && status.equals(inItem.status);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -108,7 +108,9 @@ public class ConversationItem extends AbstractFlexibleItem<ConversationItem.Conv
|
|||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return conversation.hashCode();
|
||||
int result = conversation.hashCode();
|
||||
result = 31 * result + (status != null ? status.hashCode() : 0);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -211,12 +213,16 @@ public class ConversationItem extends AbstractFlexibleItem<ConversationItem.Conv
|
|||
|
||||
if (status != null && Conversation.ConversationType.ROOM_SYSTEM != conversation.getType()) {
|
||||
float size = DisplayUtils.convertDpToPixel(STATUS_SIZE_IN_DP, appContext);
|
||||
|
||||
holder.binding.userStatusImage.setVisibility(View.VISIBLE);
|
||||
holder.binding.userStatusImage.setImageDrawable(new StatusDrawable(
|
||||
status.getStatus(),
|
||||
status.getIcon(),
|
||||
size,
|
||||
context.getResources().getColor(R.color.bg_default),
|
||||
appContext));
|
||||
} else {
|
||||
holder.binding.userStatusImage.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
if (conversation.getLastMessage() != null) {
|
||||
|
|
Loading…
Reference in a new issue