Removed AddToQueueActionButton (#5189)
This commit is contained in:
parent
d4e1ebfa08
commit
d059406025
@ -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);
|
||||
}
|
||||
}
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -349,7 +349,7 @@ public class ItemFragment extends Fragment {
|
||||
if (DownloadRequester.getInstance().isDownloadingFile(media)) {
|
||||
actionButton2 = new CancelDownloadActionButton(item);
|
||||
} else if (!media.isDownloaded()) {
|
||||
actionButton2 = new DownloadActionButton(item, false);
|
||||
actionButton2 = new DownloadActionButton(item);
|
||||
} else {
|
||||
actionButton2 = new DeleteActionButton(item);
|
||||
}
|
||||
|
@ -105,7 +105,7 @@ public class EpisodeItemViewHolder extends RecyclerView.ViewHolder {
|
||||
isInQueue.setVisibility(item.isTagged(FeedItem.TAG_QUEUE) ? View.VISIBLE : View.GONE);
|
||||
container.setAlpha(item.isPlayed() ? 0.5f : 1.0f);
|
||||
|
||||
ItemActionButton actionButton = ItemActionButton.forItem(item, true, true);
|
||||
ItemActionButton actionButton = ItemActionButton.forItem(item);
|
||||
actionButton.configure(secondaryActionButton, secondaryActionIcon, activity);
|
||||
secondaryActionButton.setFocusable(false);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user