added confirmation when clearing the queue. for issue #593
This commit is contained in:
parent
85778b4aaa
commit
2bea83706b
|
@ -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;
|
||||
|
@ -176,7 +177,19 @@ public class QueueFragment extends Fragment {
|
|||
}
|
||||
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);
|
||||
|
|
|
@ -165,6 +165,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