diff options
author | Christian Schneppe <christian.schneppe@pix-art.de> | 2020-01-31 15:02:33 +0100 |
---|---|---|
committer | Christian Schneppe <christian.schneppe@pix-art.de> | 2020-01-31 15:02:33 +0100 |
commit | 851f7b073db781281a85fd369ea92ff0bc31ce7e (patch) | |
tree | addd2abe9cdee8eaa72c26ce9df487f6ac529fe0 /src/main/java/de/pixart/messenger/ui/util/ViewUtil.java | |
parent | b0d89ba6adced09cb7a6839024c1590fc68217c5 (diff) |
use ToastCompat instead of Toast
Diffstat (limited to '')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/util/ViewUtil.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/util/ViewUtil.java b/src/main/java/de/pixart/messenger/ui/util/ViewUtil.java index 931477425..4a9251832 100644 --- a/src/main/java/de/pixart/messenger/ui/util/ViewUtil.java +++ b/src/main/java/de/pixart/messenger/ui/util/ViewUtil.java @@ -17,6 +17,7 @@ import de.pixart.messenger.R; import de.pixart.messenger.entities.DownloadableFile; import de.pixart.messenger.persistance.FileBackend; import de.pixart.messenger.ui.MediaViewerActivity; +import me.drakeet.support.toast.ToastCompat; public class ViewUtil { @@ -28,7 +29,7 @@ public class ViewUtil { public static void view(Context context, DownloadableFile file) { if (!file.exists()) { - Toast.makeText(context, R.string.file_deleted, Toast.LENGTH_SHORT).show(); + ToastCompat.makeText(context, R.string.file_deleted, Toast.LENGTH_SHORT).show(); return; } String mime = file.getMimeType(); @@ -44,7 +45,7 @@ public class ViewUtil { uri = FileBackend.getUriForFile(context, file); } catch (SecurityException e) { Log.d(Config.LOGTAG, "No permission to access " + file.getAbsolutePath(), e); - Toast.makeText(context, context.getString(R.string.no_permission_to_access_x, file.getAbsolutePath()), Toast.LENGTH_SHORT).show(); + ToastCompat.makeText(context, context.getString(R.string.no_permission_to_access_x, file.getAbsolutePath()), Toast.LENGTH_SHORT).show(); return; } // use internal viewer for images and videos @@ -78,7 +79,7 @@ public class ViewUtil { try { context.startActivity(openIntent); } catch (ActivityNotFoundException e) { - Toast.makeText(context, R.string.no_application_found_to_open_file, Toast.LENGTH_SHORT).show(); + ToastCompat.makeText(context, R.string.no_application_found_to_open_file, Toast.LENGTH_SHORT).show(); } } } |