diff options
author | Christian Schneppe <christian@pix-art.de> | 2017-02-06 22:19:53 +0100 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2017-02-06 22:19:53 +0100 |
commit | 024de5b3119ad8694e8fa2f523c13aba148127e9 (patch) | |
tree | 122f6ec1f5b89593fb1b8bc4ad0ded988bc6a1c4 | |
parent | c8c3a38db08d2fb158beea7b09052dc248275463 (diff) |
show resend button only if file exists
fixes #100
Diffstat (limited to '')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java b/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java index 460d3337c..b125a9f0b 100644 --- a/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java +++ b/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java @@ -244,7 +244,10 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie } if (error && type == SENT) { viewHolder.time.setTextColor(activity.getWarningTextColor()); - viewHolder.resend_button.setVisibility(View.VISIBLE); + DownloadableFile file = activity.xmppConnectionService.getFileBackend().getFile(message); + if (file.exists()) { + viewHolder.resend_button.setVisibility(View.VISIBLE); + } viewHolder.resend_button.setText(R.string.send_again); viewHolder.resend_button.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_resend_grey600_48dp, 0, 0, 0); viewHolder.resend_button.setOnClickListener(new OnClickListener() { |