diff options
author | Christian Schneppe <christian@pix-art.de> | 2016-10-26 22:43:04 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2016-10-26 22:43:04 +0200 |
commit | 844d59566c5ee3b84ab240cab14119490e7eec2b (patch) | |
tree | db71961d882eaa197a1512d75d889768db767b3e /src/main/java/de/pixart/messenger/ui/ConversationFragment.java | |
parent | fae5a658b9ea3c637c2158e60a1cd369ef4f912a (diff) |
add error message to failed messages. accessible via context menu
Diffstat (limited to '')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/ConversationFragment.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java index 540a2f952..82702a3c1 100644 --- a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java +++ b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java @@ -558,6 +558,7 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa MenuItem downloadFile = menu.findItem(R.id.download_file); MenuItem cancelTransmission = menu.findItem(R.id.cancel_transmission); MenuItem deleteFile = menu.findItem(R.id.delete_file); + MenuItem showErrorMessage = menu.findItem(R.id.show_error_message); if (!treatAsFile && !GeoHelper.isGeoUri(m.getBody()) && m.treatAsDownloadable() != Message.Decision.MUST) { @@ -602,6 +603,9 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa deleteFile.setTitle(activity.getString(R.string.delete_x_file, UIHelper.getFileDescriptionString(activity, m))); } } + if (m.getStatus() == Message.STATUS_SEND_FAILED && m.getErrorMessage() != null) { + showErrorMessage.setVisible(true); + } } } @@ -638,11 +642,22 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa case R.id.delete_file: deleteFile(selectedMessage); return true; + case R.id.show_error_message: + showErrorMessage(selectedMessage); + return true; default: return super.onContextItemSelected(item); } } + private void showErrorMessage(final Message message) { + AlertDialog.Builder builder = new AlertDialog.Builder(activity); + builder.setTitle(R.string.error_message); + builder.setMessage(message.getErrorMessage()); + builder.setPositiveButton(R.string.ok,null); + builder.create().show(); + } + private void shareWith(Message message) { Intent shareIntent = new Intent(); shareIntent.setAction(Intent.ACTION_SEND); |