Merge pull request #3789 from ByteHamster/fix-download-button
Fix download button when 'prefer streaming' is active
This commit is contained in:
commit
f41a133f2d
@ -187,7 +187,7 @@ public class AllEpisodesRecycleAdapter extends RecyclerView.Adapter<AllEpisodesR
|
|||||||
holder.queueStatus.setVisibility(View.INVISIBLE);
|
holder.queueStatus.setVisibility(View.INVISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
ItemActionButton actionButton = ItemActionButton.forItem(item, isInQueue);
|
ItemActionButton actionButton = ItemActionButton.forItem(item, isInQueue, true);
|
||||||
actionButton.configure(holder.butSecondary, mainActivityRef.get());
|
actionButton.configure(holder.butSecondary, mainActivityRef.get());
|
||||||
|
|
||||||
holder.butSecondary.setFocusable(false);
|
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);
|
actionButton.configure(holder.butAction, context);
|
||||||
|
|
||||||
holder.butAction.setFocusable(false);
|
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());
|
actionButton.configure(butSecondary, mainActivity.get());
|
||||||
|
|
||||||
butSecondary.setFocusable(false);
|
butSecondary.setFocusable(false);
|
||||||
|
@ -33,7 +33,7 @@ public abstract class ItemActionButton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@NonNull
|
@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();
|
final FeedMedia media = item.getMedia();
|
||||||
if (media == null) {
|
if (media == null) {
|
||||||
return new MarkAsPlayedActionButton(item);
|
return new MarkAsPlayedActionButton(item);
|
||||||
@ -44,9 +44,10 @@ public abstract class ItemActionButton {
|
|||||||
return new PlayActionButton(item);
|
return new PlayActionButton(item);
|
||||||
} else if (isDownloadingMedia) {
|
} else if (isDownloadingMedia) {
|
||||||
return new CancelDownloadActionButton(item);
|
return new CancelDownloadActionButton(item);
|
||||||
} else if (UserPreferences.streamOverDownload()) {
|
} else if (UserPreferences.streamOverDownload() && allowStream) {
|
||||||
return new StreamActionButton(item);
|
return new StreamActionButton(item);
|
||||||
} else if (MobileDownloadHelper.userAllowedMobileDownloads() || !MobileDownloadHelper.userChoseAddToQueue() || isInQueue) {
|
} else if (MobileDownloadHelper.userAllowedMobileDownloads()
|
||||||
|
|| !MobileDownloadHelper.userChoseAddToQueue() || isInQueue) {
|
||||||
return new DownloadActionButton(item, isInQueue);
|
return new DownloadActionButton(item, isInQueue);
|
||||||
} else {
|
} else {
|
||||||
return new AddToQueueActionButton(item);
|
return new AddToQueueActionButton(item);
|
||||||
|
@ -183,7 +183,7 @@ public class ItemFragment extends Fragment {
|
|||||||
if (item == null) {
|
if (item == null) {
|
||||||
return;
|
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());
|
actionButton.onClick(getActivity());
|
||||||
|
|
||||||
FeedMedia media = item.getMedia();
|
FeedMedia media = item.getMedia();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user