summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorVishnu Sanal T <50027064+VishnuSanal@users.noreply.github.com>2022-11-06 15:26:01 +0530
committerGitHub <noreply@github.com>2022-11-06 10:56:01 +0100
commite4d4c69519c7854f1852d80a3b47eebe30e6a3d5 (patch)
tree020de38d751e759ff6691dc8e75fac830e93b843 /app
parentbe8c8cef4d974f7ecaee858591182065651dca93 (diff)
downloadAntennaPod-e4d4c69519c7854f1852d80a3b47eebe30e6a3d5.zip
Add confirmation dialog for clearing history (#6175)
Diffstat (limited to 'app')
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/PlaybackHistoryFragment.java17
1 files changed, 16 insertions, 1 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/PlaybackHistoryFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/PlaybackHistoryFragment.java
index 3e9b2b5c7..db36a504a 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/PlaybackHistoryFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/PlaybackHistoryFragment.java
@@ -1,5 +1,6 @@
package de.danoeh.antennapod.fragment;
+import android.content.DialogInterface;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.MenuItem;
@@ -7,6 +8,7 @@ import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import de.danoeh.antennapod.R;
+import de.danoeh.antennapod.core.dialog.ConfirmationDialog;
import de.danoeh.antennapod.core.storage.DBReader;
import de.danoeh.antennapod.core.storage.DBWriter;
import de.danoeh.antennapod.event.playback.PlaybackHistoryEvent;
@@ -55,7 +57,20 @@ public class PlaybackHistoryFragment extends EpisodesListFragment {
return true;
}
if (item.getItemId() == R.id.clear_history_item) {
- DBWriter.clearPlaybackHistory();
+
+ ConfirmationDialog conDialog = new ConfirmationDialog(
+ getActivity(),
+ R.string.clear_history_label,
+ R.string.clear_playback_history_msg) {
+
+ @Override
+ public void onConfirmButtonPressed(DialogInterface dialog) {
+ dialog.dismiss();
+ DBWriter.clearPlaybackHistory();
+ }
+ };
+ conDialog.createNewDialog().show();
+
return true;
}
return false;