diff options
author | ByteHamster <info@bytehamster.com> | 2020-01-26 17:18:51 +0100 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2020-01-26 17:18:51 +0100 |
commit | 90c5f0bfdda24cbc29c3caab6ed0a4dfb378f441 (patch) | |
tree | 8e92172067f72c366166f2fce6fb1a39f58bcfd3 /app | |
parent | 04dd39021cbfbdf76886e454497363e1d633c53b (diff) | |
download | AntennaPod-90c5f0bfdda24cbc29c3caab6ed0a4dfb378f441.zip |
Fix download button when 'prefer streaming' is active
Diffstat (limited to 'app')
5 files changed, 8 insertions, 7 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/AllEpisodesRecycleAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/AllEpisodesRecycleAdapter.java index eafc4b0a6..0f475bbc5 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/AllEpisodesRecycleAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/AllEpisodesRecycleAdapter.java @@ -187,7 +187,7 @@ public class AllEpisodesRecycleAdapter extends RecyclerView.Adapter<AllEpisodesR holder.queueStatus.setVisibility(View.INVISIBLE); } - ItemActionButton actionButton = ItemActionButton.forItem(item, isInQueue); + ItemActionButton actionButton = ItemActionButton.forItem(item, isInQueue, true); actionButton.configure(holder.butSecondary, mainActivityRef.get()); holder.butSecondary.setFocusable(false); diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/FeedItemlistAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/FeedItemlistAdapter.java index aec0f0c91..6a88a39ce 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/FeedItemlistAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/FeedItemlistAdapter.java @@ -189,7 +189,7 @@ public class FeedItemlistAdapter extends BaseAdapter { } } - ItemActionButton actionButton = ItemActionButton.forItem(item, isInQueue); + ItemActionButton actionButton = ItemActionButton.forItem(item, isInQueue, true); actionButton.configure(holder.butAction, context); holder.butAction.setFocusable(false); diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/QueueRecyclerAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/QueueRecyclerAdapter.java index 5ccec0ade..c3e93ae79 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/QueueRecyclerAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/QueueRecyclerAdapter.java @@ -296,7 +296,7 @@ public class QueueRecyclerAdapter extends RecyclerView.Adapter<QueueRecyclerAdap } } - ItemActionButton actionButton = ItemActionButton.forItem(item, true); + ItemActionButton actionButton = ItemActionButton.forItem(item, true, true); actionButton.configure(butSecondary, mainActivity.get()); butSecondary.setFocusable(false); 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 861c6a4be..ffc73c5fb 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) { + public static ItemActionButton forItem(@NonNull FeedItem item, boolean isInQueue, boolean allowStream) { final FeedMedia media = item.getMedia(); if (media == null) { return new MarkAsPlayedActionButton(item); @@ -44,9 +44,10 @@ public abstract class ItemActionButton { return new PlayActionButton(item); } else if (isDownloadingMedia) { return new CancelDownloadActionButton(item); - } else if (UserPreferences.streamOverDownload()) { + } else if (UserPreferences.streamOverDownload() && allowStream) { return new StreamActionButton(item); - } else if (MobileDownloadHelper.userAllowedMobileDownloads() || !MobileDownloadHelper.userChoseAddToQueue() || isInQueue) { + } else if (MobileDownloadHelper.userAllowedMobileDownloads() + || !MobileDownloadHelper.userChoseAddToQueue() || isInQueue) { return new DownloadActionButton(item, isInQueue); } else { return new AddToQueueActionButton(item); diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java index 2806f48ba..a8a518157 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java @@ -183,7 +183,7 @@ public class ItemFragment extends Fragment { if (item == null) { return; } - ItemActionButton actionButton = ItemActionButton.forItem(item, item.isTagged(FeedItem.TAG_QUEUE)); + ItemActionButton actionButton = ItemActionButton.forItem(item, item.isTagged(FeedItem.TAG_QUEUE), false); actionButton.onClick(getActivity()); FeedMedia media = item.getMedia(); |