Fix download button when 'prefer streaming' is active
This commit is contained in:
parent
04dd39021c
commit
90c5f0bfdd
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue