From 692e0b3455635b9a97a98890b9a2484c019c7c26 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Wed, 8 Feb 2017 21:24:46 +0100 Subject: show number of failed uploads in chat list in red bubbles --- .../java/de/pixart/messenger/ui/adapter/ConversationAdapter.java | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/main/java/de/pixart/messenger/ui') diff --git a/src/main/java/de/pixart/messenger/ui/adapter/ConversationAdapter.java b/src/main/java/de/pixart/messenger/ui/adapter/ConversationAdapter.java index 600ac47eb..3fe3cceae 100644 --- a/src/main/java/de/pixart/messenger/ui/adapter/ConversationAdapter.java +++ b/src/main/java/de/pixart/messenger/ui/adapter/ConversationAdapter.java @@ -86,8 +86,10 @@ public class ConversationAdapter extends ArrayAdapter { ImageView imagePreview = (ImageView) view.findViewById(R.id.conversation_lastimage); ImageView notificationStatus = (ImageView) view.findViewById(R.id.notification_status); TextView mUnread = (TextView) view.findViewById(R.id.conversation_unread); + TextView mFailed = (TextView) view.findViewById(R.id.conversation_failed); Message message = conversation.getLatestMessage(); int unreadcount = conversation.unreadCount(); + int failedcount = conversation.failedCount(); String mimeType = message.getMimeType(); if (!conversation.isRead()) { @@ -137,6 +139,12 @@ public class ConversationAdapter extends ArrayAdapter { } else { mUnread.setVisibility(View.GONE); } + if (failedcount > 0) { + mFailed.setVisibility(View.VISIBLE); + mFailed.setText(String.valueOf(failedcount)); + } else { + mFailed.setVisibility(View.GONE); + } if (preview.second) { if (conversation.isRead()) { mLastMessage.setTypeface(null, Typeface.ITALIC); -- cgit v1.2.3