diff options
author | ByteHamster <info@bytehamster.com> | 2020-05-03 17:18:10 +0200 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2020-05-03 17:18:10 +0200 |
commit | 20bcb8a781fc9c7289b1437a5c11dac1fd673128 (patch) | |
tree | fddd7f00b4a00f0666def9bf59a1abdb0b8866b2 /app/src/main/java/de/danoeh/antennapod/adapter | |
parent | bf216cbfac0c9b10de618ce485f5d56f76696619 (diff) | |
download | AntennaPod-20bcb8a781fc9c7289b1437a5c11dac1fd673128.zip |
Replaced some Toasts with Snackbars
Diffstat (limited to 'app/src/main/java/de/danoeh/antennapod/adapter')
3 files changed, 6 insertions, 8 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/DownloadLogAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/DownloadLogAdapter.java index 90ac6ea1b..153f4abc3 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/DownloadLogAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/DownloadLogAdapter.java @@ -1,5 +1,6 @@ package de.danoeh.antennapod.adapter; +import android.app.Activity; import android.content.Context; import android.os.Build; import android.text.Layout; @@ -18,6 +19,7 @@ import com.joanzapata.iconify.widget.IconButton; import com.joanzapata.iconify.widget.IconTextView; import de.danoeh.antennapod.R; +import de.danoeh.antennapod.activity.MainActivity; import de.danoeh.antennapod.core.dialog.DownloadRequestErrorDialogCreator; import de.danoeh.antennapod.core.feed.Feed; import de.danoeh.antennapod.core.feed.FeedMedia; @@ -35,10 +37,10 @@ import de.danoeh.antennapod.view.viewholder.DownloadItemViewHolder; public class DownloadLogAdapter extends BaseAdapter { private static final String TAG = "DownloadLogAdapter"; - private final Context context; + private final Activity context; private final ItemAccess itemAccess; - public DownloadLogAdapter(Context context, ItemAccess itemAccess) { + public DownloadLogAdapter(Activity context, ItemAccess itemAccess) { super(); this.itemAccess = itemAccess; this.context = context; @@ -116,7 +118,8 @@ public class DownloadLogAdapter extends BaseAdapter { } try { DownloadRequester.getInstance().downloadMedia(context, true, media.getItem()); - Toast.makeText(context, R.string.status_downloading_label, Toast.LENGTH_SHORT).show(); + ((MainActivity) context).showSnackbarAbovePlayer( + R.string.status_downloading_label, Toast.LENGTH_SHORT); } catch (DownloadRequestException e) { e.printStackTrace(); DownloadRequestErrorDialogCreator.newRequestErrorDialog(context, e.getMessage()); diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/actionbutton/CancelDownloadActionButton.java b/app/src/main/java/de/danoeh/antennapod/adapter/actionbutton/CancelDownloadActionButton.java index 3b5baadef..a31d2fdc0 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/actionbutton/CancelDownloadActionButton.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/actionbutton/CancelDownloadActionButton.java @@ -37,8 +37,6 @@ public class CancelDownloadActionButton extends ItemActionButton { if (UserPreferences.isEnableAutodownload()) { DBWriter.setFeedItemAutoDownload(media.getItem(), false); Toast.makeText(context, R.string.download_canceled_autodownload_enabled_msg, Toast.LENGTH_LONG).show(); - } else { - Toast.makeText(context, R.string.download_canceled_msg, Toast.LENGTH_LONG).show(); } } } diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/actionbutton/MobileDownloadHelper.java b/app/src/main/java/de/danoeh/antennapod/adapter/actionbutton/MobileDownloadHelper.java index 80ecd4994..49b785056 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/actionbutton/MobileDownloadHelper.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/actionbutton/MobileDownloadHelper.java @@ -1,7 +1,6 @@ package de.danoeh.antennapod.adapter.actionbutton; import android.content.Context; -import android.widget.Toast; import androidx.appcompat.app.AlertDialog; import de.danoeh.antennapod.R; @@ -42,14 +41,12 @@ class MobileDownloadHelper { private static void addToQueue(Context context, FeedItem item) { addToQueueTimestamp = System.currentTimeMillis(); DBWriter.addQueueItem(context, item); - Toast.makeText(context, R.string.added_to_queue_label, Toast.LENGTH_SHORT).show(); } private static void downloadFeedItems(Context context, FeedItem item) { allowMobileDownloadTimestamp = System.currentTimeMillis(); try { DownloadRequester.getInstance().downloadMedia(context, true, item); - Toast.makeText(context, R.string.status_downloading_label, Toast.LENGTH_SHORT).show(); } catch (DownloadRequestException e) { e.printStackTrace(); DownloadRequestErrorDialogCreator.newRequestErrorDialog(context, e.getMessage()); |