diff options
author | Tom Hennen <tom.hennen@gmail.com> | 2015-01-30 13:43:16 -0500 |
---|---|---|
committer | Tom Hennen <tom.hennen@gmail.com> | 2015-01-30 13:43:16 -0500 |
commit | 4b8a3c00caef6b1f9aa21a8a5dacac7bccb6e9f8 (patch) | |
tree | d55eccba2fe67725edc15e104178b5881ed7fe8b /app/src/main/java/de/danoeh/antennapod/menuhandler | |
parent | 49c714a5a5720eb2abb42f178088475084b41031 (diff) | |
download | AntennaPod-4b8a3c00caef6b1f9aa21a8a5dacac7bccb6e9f8.zip |
added feed specific mark_all_read confirmation dialog. #596
Diffstat (limited to 'app/src/main/java/de/danoeh/antennapod/menuhandler')
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/menuhandler/FeedMenuHandler.java | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/menuhandler/FeedMenuHandler.java b/app/src/main/java/de/danoeh/antennapod/menuhandler/FeedMenuHandler.java index b62fd22b2..efb4adb01 100644 --- a/app/src/main/java/de/danoeh/antennapod/menuhandler/FeedMenuHandler.java +++ b/app/src/main/java/de/danoeh/antennapod/menuhandler/FeedMenuHandler.java @@ -1,6 +1,7 @@ package de.danoeh.antennapod.menuhandler; import android.content.Context; +import android.content.DialogInterface; import android.content.Intent; import android.net.Uri; import android.util.Log; @@ -10,6 +11,7 @@ import android.view.MenuItem; import de.danoeh.antennapod.R; import de.danoeh.antennapod.core.BuildConfig; +import de.danoeh.antennapod.core.dialog.ConfirmationDialog; import de.danoeh.antennapod.core.feed.Feed; import de.danoeh.antennapod.core.storage.DBTasks; import de.danoeh.antennapod.core.storage.DBWriter; @@ -51,8 +53,8 @@ public class FeedMenuHandler { * * @throws DownloadRequestException */ - public static boolean onOptionsItemClicked(Context context, MenuItem item, - Feed selectedFeed) throws DownloadRequestException { + public static boolean onOptionsItemClicked(final Context context, final MenuItem item, + final Feed selectedFeed) throws DownloadRequestException { switch (item.getItemId()) { case R.id.refresh_item: DBTasks.refreshFeed(context, selectedFeed); @@ -61,7 +63,18 @@ public class FeedMenuHandler { DBTasks.refreshCompleteFeed(context, selectedFeed); break; case R.id.mark_all_read_item: - DBWriter.markFeedRead(context, selectedFeed.getId()); + ConfirmationDialog conDialog = new ConfirmationDialog(context, + R.string.mark_all_read_label, + R.string.mark_all_read_feed_confirmation_msg) { + + @Override + public void onConfirmButtonPressed( + DialogInterface dialog) { + dialog.dismiss(); + DBWriter.markFeedRead(context, selectedFeed.getId()); + } + }; + conDialog.createNewDialog().show(); break; case R.id.visit_website_item: Uri uri = Uri.parse(selectedFeed.getLink()); |