Merge pull request #616 from TomHennen/empty_queue_command_593
Empty queue command 593
This commit is contained in:
commit
2316a260bb
|
@ -2,8 +2,8 @@ package de.danoeh.antennapod.fragment;
|
|||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.support.v4.app.Fragment;
|
||||
|
@ -30,6 +30,7 @@ import de.danoeh.antennapod.activity.MainActivity;
|
|||
import de.danoeh.antennapod.adapter.DefaultActionButtonCallback;
|
||||
import de.danoeh.antennapod.adapter.QueueListAdapter;
|
||||
import de.danoeh.antennapod.core.asynctask.DownloadObserver;
|
||||
import de.danoeh.antennapod.core.dialog.ConfirmationDialog;
|
||||
import de.danoeh.antennapod.core.feed.EventDistributor;
|
||||
import de.danoeh.antennapod.core.feed.Feed;
|
||||
import de.danoeh.antennapod.core.feed.FeedItem;
|
||||
|
@ -175,6 +176,21 @@ public class QueueFragment extends Fragment {
|
|||
DBTasks.refreshAllFeeds(getActivity(), feeds);
|
||||
}
|
||||
return true;
|
||||
case R.id.clear_queue:
|
||||
// make sure the user really wants to clear the queue
|
||||
ConfirmationDialog conDialog = new ConfirmationDialog(getActivity(),
|
||||
R.string.clear_queue_label,
|
||||
R.string.clear_queue_confirmation_msg) {
|
||||
|
||||
@Override
|
||||
public void onConfirmButtonPressed(
|
||||
DialogInterface dialog) {
|
||||
dialog.dismiss();
|
||||
DBWriter.clearQueue(getActivity());
|
||||
}
|
||||
};
|
||||
conDialog.createNewDialog().show();
|
||||
return true;
|
||||
case R.id.queue_sort_alpha_asc:
|
||||
QueueSorter.sort(getActivity(), QueueSorter.Rule.ALPHA_ASC, true);
|
||||
return true;
|
||||
|
|
|
@ -10,6 +10,13 @@
|
|||
custom:showAsAction="ifRoom"
|
||||
android:icon="?attr/navigation_refresh"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/clear_queue"
|
||||
android:title="Clear Queue"
|
||||
android:menuCategory="container"
|
||||
custom:showAsAction="collapseActionView"
|
||||
android:icon="?attr/navigation_accept"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/queue_sort"
|
||||
android:title="@string/sort">
|
||||
|
|
|
@ -167,6 +167,7 @@
|
|||
<string name="duration">Duration</string>
|
||||
<string name="ascending">Ascending</string>
|
||||
<string name="descending">Descending</string>
|
||||
<string name="clear_queue_confirmation_msg">Please confirm that you want to clear the queue of ALL of the episodes in it</string>
|
||||
|
||||
<!-- Flattr -->
|
||||
<string name="flattr_auth_label">Flattr sign-in</string>
|
||||
|
|
Loading…
Reference in New Issue