diff options
author | Tom Hennen <TomHennen@users.noreply.github.com> | 2015-02-23 18:46:37 -0500 |
---|---|---|
committer | Tom Hennen <TomHennen@users.noreply.github.com> | 2015-02-23 18:46:37 -0500 |
commit | 2316a260bbe3d80a846e9091e46e8d4e4f91b390 (patch) | |
tree | c938c8ef332bb66164951f8d23af2d6920c0164c /app | |
parent | 44f99e3b2fb531f9d07ca6b2f80cefec2fc07d60 (diff) | |
parent | 2bea83706b37c7fe5d4b687236aaad4ccca6a0c9 (diff) | |
download | AntennaPod-2316a260bbe3d80a846e9091e46e8d4e4f91b390.zip |
Merge pull request #616 from TomHennen/empty_queue_command_593
Empty queue command 593
Diffstat (limited to 'app')
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java | 18 | ||||
-rw-r--r-- | app/src/main/res/menu/queue.xml | 7 |
2 files changed, 24 insertions, 1 deletions
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 ca8543b4c..913b544a5 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java @@ -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; diff --git a/app/src/main/res/menu/queue.xml b/app/src/main/res/menu/queue.xml index b85279e5a..51e47c061 100644 --- a/app/src/main/res/menu/queue.xml +++ b/app/src/main/res/menu/queue.xml @@ -11,6 +11,13 @@ 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"> |