diff options
Diffstat (limited to '')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/util/ShareUtil.java | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/util/ShareUtil.java b/src/main/java/de/pixart/messenger/ui/util/ShareUtil.java index ffa352ede..e73109b02 100644 --- a/src/main/java/de/pixart/messenger/ui/util/ShareUtil.java +++ b/src/main/java/de/pixart/messenger/ui/util/ShareUtil.java @@ -43,6 +43,7 @@ import de.pixart.messenger.ui.ConversationsActivity; import de.pixart.messenger.ui.XmppActivity; import de.pixart.messenger.utils.Patterns; import de.pixart.messenger.utils.XmppUri; +import me.drakeet.support.toast.ToastCompat; import rocks.xmpp.addr.Jid; public class ShareUtil { @@ -64,7 +65,7 @@ public class ShareUtil { try { shareIntent.putExtra(Intent.EXTRA_STREAM, FileBackend.getUriForFile(activity, file)); } catch (SecurityException e) { - Toast.makeText(activity, activity.getString(R.string.no_permission_to_access_x, file.getAbsolutePath()), Toast.LENGTH_SHORT).show(); + ToastCompat.makeText(activity, activity.getString(R.string.no_permission_to_access_x, file.getAbsolutePath()), Toast.LENGTH_SHORT).show(); return; } shareIntent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); @@ -79,13 +80,13 @@ public class ShareUtil { activity.overridePendingTransition(R.animator.fade_in, R.animator.fade_out); } catch (ActivityNotFoundException e) { //This should happen only on faulty androids because normally chooser is always available - Toast.makeText(activity, R.string.no_application_found_to_open_file, Toast.LENGTH_SHORT).show(); + ToastCompat.makeText(activity, R.string.no_application_found_to_open_file, Toast.LENGTH_SHORT).show(); } } public static void copyToClipboard(XmppActivity activity, Message message) { if (activity.copyTextToClipboard(message.getMergedBody().toString(), R.string.message)) { - Toast.makeText(activity, R.string.message_copied_to_clipboard, Toast.LENGTH_SHORT).show(); + ToastCompat.makeText(activity, R.string.message_copied_to_clipboard, Toast.LENGTH_SHORT).show(); } } @@ -103,7 +104,7 @@ public class ShareUtil { resId = R.string.file_url; } if (activity.copyTextToClipboard(url, resId)) { - Toast.makeText(activity, R.string.url_copied_to_clipboard, Toast.LENGTH_SHORT).show(); + ToastCompat.makeText(activity, R.string.url_copied_to_clipboard, Toast.LENGTH_SHORT).show(); } } @@ -114,7 +115,7 @@ public class ShareUtil { try { Jid jid = new XmppUri(body.substring(xmppPatternMatcher.start(), xmppPatternMatcher.end())).getJid(); if (activity.copyTextToClipboard(jid.asBareJid().toString(), R.string.account_settings_jabber_id)) { - Toast.makeText(activity, R.string.jabber_id_copied_to_clipboard, Toast.LENGTH_SHORT).show(); + ToastCompat.makeText(activity, R.string.jabber_id_copied_to_clipboard, Toast.LENGTH_SHORT).show(); } return; } catch (Exception e) { @@ -126,7 +127,7 @@ public class ShareUtil { if (webUrlPatternMatcher.find()) { String url = body.substring(webUrlPatternMatcher.start(), webUrlPatternMatcher.end()); if (activity.copyTextToClipboard(url, R.string.web_address)) { - Toast.makeText(activity, R.string.url_copied_to_clipboard, Toast.LENGTH_SHORT).show(); + ToastCompat.makeText(activity, R.string.url_copied_to_clipboard, Toast.LENGTH_SHORT).show(); } } } |