diff options
author | ueen <ueli.sarnighausen@online.de> | 2021-06-20 09:04:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-20 09:04:57 +0200 |
commit | d059406025d152f68180527c249c4de279c1b5c1 (patch) | |
tree | 0f549ea5086f32b1d582e57d3d26a70656022ea6 /app/src/main/java/de/danoeh/antennapod/adapter | |
parent | d4e1ebfa08ebcf716b7c4abf7d9ad8805e9287dd (diff) | |
download | AntennaPod-d059406025d152f68180527c249c4de279c1b5c1.zip |
Removed AddToQueueActionButton (#5189)
Diffstat (limited to 'app/src/main/java/de/danoeh/antennapod/adapter')
3 files changed, 5 insertions, 40 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/actionbutton/AddToQueueActionButton.java b/app/src/main/java/de/danoeh/antennapod/adapter/actionbutton/AddToQueueActionButton.java deleted file mode 100644 index b362a5a1d..000000000 --- a/app/src/main/java/de/danoeh/antennapod/adapter/actionbutton/AddToQueueActionButton.java +++ /dev/null @@ -1,32 +0,0 @@ -package de.danoeh.antennapod.adapter.actionbutton; - -import android.content.Context; -import androidx.annotation.DrawableRes; -import androidx.annotation.StringRes; - -import de.danoeh.antennapod.R; -import de.danoeh.antennapod.model.feed.FeedItem; - -class AddToQueueActionButton extends ItemActionButton { - - AddToQueueActionButton(FeedItem item) { - super(item); - } - - @Override - @StringRes - public int getLabel() { - return R.string.add_to_queue_label; - } - - @Override - @DrawableRes - public int getDrawable() { - return R.drawable.ic_add; - } - - @Override - public void onClick(Context context) { - MobileDownloadHelper.confirmMobileDownload(context, item); - } -} diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/actionbutton/DownloadActionButton.java b/app/src/main/java/de/danoeh/antennapod/adapter/actionbutton/DownloadActionButton.java index c3e979dd8..7b922154e 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/actionbutton/DownloadActionButton.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/actionbutton/DownloadActionButton.java @@ -21,9 +21,9 @@ import de.danoeh.antennapod.core.util.NetworkUtils; public class DownloadActionButton extends ItemActionButton { private boolean isInQueue; - public DownloadActionButton(FeedItem item, boolean isInQueue) { + public DownloadActionButton(FeedItem item) { super(item); - this.isInQueue = isInQueue; + this.isInQueue = item.isTagged(FeedItem.TAG_QUEUE);; } @Override diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/actionbutton/ItemActionButton.java b/app/src/main/java/de/danoeh/antennapod/adapter/actionbutton/ItemActionButton.java index 12150293f..ad4f35786 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/actionbutton/ItemActionButton.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/actionbutton/ItemActionButton.java @@ -33,7 +33,7 @@ public abstract class ItemActionButton { } @NonNull - public static ItemActionButton forItem(@NonNull FeedItem item, boolean isInQueue, boolean allowStream) { + public static ItemActionButton forItem(@NonNull FeedItem item) { final FeedMedia media = item.getMedia(); if (media == null) { return new MarkAsPlayedActionButton(item); @@ -48,13 +48,10 @@ public abstract class ItemActionButton { return new PlayActionButton(item); } else if (isDownloadingMedia) { return new CancelDownloadActionButton(item); - } else if (UserPreferences.isStreamOverDownload() && allowStream) { + } else if (UserPreferences.isStreamOverDownload()) { return new StreamActionButton(item); - } else if (MobileDownloadHelper.userAllowedMobileDownloads() - || !MobileDownloadHelper.userChoseAddToQueue() || isInQueue) { - return new DownloadActionButton(item, isInQueue); } else { - return new AddToQueueActionButton(item); + return new DownloadActionButton(item); } } |