Added batch edit to queue

This commit is contained in:
ByteHamster 2019-07-23 22:43:18 +02:00
parent 0e1cac9098
commit cfe05e3038
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 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;

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.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;

View File

@ -23,13 +23,6 @@
custom:actionViewClass="android.support.v7.widget.SearchView"
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
android:id="@+id/queue_sort"
android:title="@string/sort">
@ -112,4 +105,15 @@
</menu>
</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>