aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2017-11-21 12:40:42 +0100
committerDaniel Gultsch <daniel@gultsch.de>2017-11-21 12:40:42 +0100
commit9548a4f6af8dcdfc68feb3907ede5d3316e5038e (patch)
treec807fe0f5f0312e178ead4a7e7f3ec7199c3ed30
parent28e005f926294bbb3f8c7621fb1484fa06b1ce9a (diff)
ConversationAdapter: do not show file icon when file has been deleted
-rw-r--r--src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java b/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java
index 6cc5727..ab32e78 100644
--- a/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java
+++ b/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java
@@ -79,9 +79,8 @@ public class ConversationAdapter extends ArrayAdapter<Conversation> {
convName.setTypeface(null, Typeface.NORMAL);
}
- if (message.getFileParams().width > 0
- && (message.getTransferable() == null
- || message.getTransferable().getStatus() != Transferable.STATUS_DELETED)) {
+ final boolean fileAvailable = message.getTransferable() == null || message.getTransferable().getStatus() != Transferable.STATUS_DELETED;
+ if (message.getFileParams().width > 0 && fileAvailable) {
mSenderName.setVisibility(View.GONE);
mLastMessage.setVisibility(View.GONE);
mLastMessageImage.setVisibility(View.GONE);
@@ -89,7 +88,7 @@ public class ConversationAdapter extends ArrayAdapter<Conversation> {
activity.loadBitmap(message, imagePreview);
} else {
final boolean showPreviewText;
- if (message.getType() == Message.TYPE_FILE) {
+ if (message.getType() == Message.TYPE_FILE && fileAvailable) {
if (message.getFileParams().runtime > 0) {
showPreviewText = false;
mLastMessageImage.setImageResource(activity.getThemeResource(R.attr.ic_attach_record, R.drawable.ic_attach_record));