From 024de5b3119ad8694e8fa2f523c13aba148127e9 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Mon, 6 Feb 2017 22:19:53 +0100 Subject: show resend button only if file exists fixes #100 --- src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/main/java/de/pixart/messenger') 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 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() { -- cgit v1.2.3