From cfe05e30388f4c6faecb3095131be02b3d0cf01c Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Tue, 23 Jul 2019 22:43:18 +0200 Subject: [PATCH] Added batch edit to queue --- .../dialog/EpisodesApplyActionFragment.java | 2 +- .../antennapod/fragment/QueueFragment.java | 8 ++++++++ app/src/main/res/menu/queue.xml | 18 +++++++++++------- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java b/app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java index 7fa9a8bbc..7697aaa69 100644 --- a/app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java @@ -47,7 +47,7 @@ public class EpisodesApplyActionFragment extends Fragment { public static final String TAG = "EpisodeActionFragment"; public static final int ACTION_ADD_TO_QUEUE = 1; - private static final int ACTION_REMOVE_FROM_QUEUE = 2; + public static final int ACTION_REMOVE_FROM_QUEUE = 2; private static final int ACTION_MARK_PLAYED = 4; private static final int ACTION_MARK_UNPLAYED = 8; private static final int ACTION_DOWNLOAD = 16; diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java index b61484715..b4aca3be0 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java @@ -49,6 +49,7 @@ import de.danoeh.antennapod.core.util.Converter; import de.danoeh.antennapod.core.util.FeedItemUtil; import de.danoeh.antennapod.core.util.LongList; import de.danoeh.antennapod.core.util.QueueSorter; +import de.danoeh.antennapod.dialog.EpisodesApplyActionFragment; import de.danoeh.antennapod.menuhandler.FeedItemMenuHandler; import de.danoeh.antennapod.menuhandler.MenuItemUtils; @@ -61,6 +62,9 @@ import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; +import static de.danoeh.antennapod.dialog.EpisodesApplyActionFragment.ACTION_DELETE; +import static de.danoeh.antennapod.dialog.EpisodesApplyActionFragment.ACTION_REMOVE_FROM_QUEUE; + /** * Shows all items in the queue */ @@ -316,6 +320,10 @@ public class QueueFragment extends Fragment { }; conDialog.createNewDialog().show(); return true; + case R.id.episode_actions: + ((MainActivity) requireActivity()) .loadChildFragment( + EpisodesApplyActionFragment.newInstance(queue, ACTION_DELETE | ACTION_REMOVE_FROM_QUEUE)); + return true; case R.id.queue_sort_episode_title_asc: QueueSorter.sort(getActivity(), QueueSorter.Rule.EPISODE_TITLE_ASC, true); return true; diff --git a/app/src/main/res/menu/queue.xml b/app/src/main/res/menu/queue.xml index 5844c9ff5..0f7729be1 100644 --- a/app/src/main/res/menu/queue.xml +++ b/app/src/main/res/menu/queue.xml @@ -23,13 +23,6 @@ custom:actionViewClass="android.support.v7.widget.SearchView" android:title="@string/search_label"/> - - @@ -112,4 +105,15 @@ + + + +