Merge pull request #3286 from ByteHamster/batch-edit-queue

Added batch edit to queue
This commit is contained in:
H. Lehmann 2019-07-23 23:01:49 +02:00 committed by GitHub
commit 60866a1c79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 8 deletions

View File

@ -47,7 +47,7 @@ public class EpisodesApplyActionFragment extends Fragment {
public static final String TAG = "EpisodeActionFragment"; public static final String TAG = "EpisodeActionFragment";
public static final int ACTION_ADD_TO_QUEUE = 1; 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_PLAYED = 4;
private static final int ACTION_MARK_UNPLAYED = 8; private static final int ACTION_MARK_UNPLAYED = 8;
private static final int ACTION_DOWNLOAD = 16; private static final int ACTION_DOWNLOAD = 16;

View File

@ -49,6 +49,7 @@ import de.danoeh.antennapod.core.util.Converter;
import de.danoeh.antennapod.core.util.FeedItemUtil; import de.danoeh.antennapod.core.util.FeedItemUtil;
import de.danoeh.antennapod.core.util.LongList; import de.danoeh.antennapod.core.util.LongList;
import de.danoeh.antennapod.core.util.QueueSorter; import de.danoeh.antennapod.core.util.QueueSorter;
import de.danoeh.antennapod.dialog.EpisodesApplyActionFragment;
import de.danoeh.antennapod.menuhandler.FeedItemMenuHandler; import de.danoeh.antennapod.menuhandler.FeedItemMenuHandler;
import de.danoeh.antennapod.menuhandler.MenuItemUtils; import de.danoeh.antennapod.menuhandler.MenuItemUtils;
@ -61,6 +62,9 @@ import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode; 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 * Shows all items in the queue
*/ */
@ -316,6 +320,10 @@ public class QueueFragment extends Fragment {
}; };
conDialog.createNewDialog().show(); conDialog.createNewDialog().show();
return true; 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: case R.id.queue_sort_episode_title_asc:
QueueSorter.sort(getActivity(), QueueSorter.Rule.EPISODE_TITLE_ASC, true); QueueSorter.sort(getActivity(), QueueSorter.Rule.EPISODE_TITLE_ASC, true);
return true; return true;

View File

@ -23,13 +23,6 @@
custom:actionViewClass="android.support.v7.widget.SearchView" custom:actionViewClass="android.support.v7.widget.SearchView"
android:title="@string/search_label"/> android:title="@string/search_label"/>
<item
android:id="@+id/clear_queue"
android:title="@string/clear_queue_label"
android:menuCategory="container"
custom:showAsAction="collapseActionView"
android:icon="?attr/navigation_accept"/>
<item <item
android:id="@+id/queue_sort" android:id="@+id/queue_sort"
android:title="@string/sort"> android:title="@string/sort">
@ -112,4 +105,15 @@
</menu> </menu>
</item> </item>
<item
android:id="@+id/clear_queue"
android:title="@string/clear_queue_label"
custom:showAsAction="collapseActionView"
android:icon="?attr/navigation_accept"/>
<item
android:id="@+id/episode_actions"
custom:showAsAction="collapseActionView"
android:title="@string/batch_edit" />
</menu> </menu>