diff options
author | GitStart <1501599+gitstart@users.noreply.github.com> | 2023-04-07 13:21:52 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-07 14:21:52 +0200 |
commit | a828660b446fcc1a8a518c7a30622b905c7bf358 (patch) | |
tree | d6d82d1d3075f90c82ec75c6775f7115d22270e9 /app/src/main/java/de/danoeh/antennapod/dialog | |
parent | 7ed78887c4411762f1fff67d3ca2330deaec2cac (diff) | |
download | AntennaPod-a828660b446fcc1a8a518c7a30622b905c7bf358.zip |
Do not switch screens when clicking "Remove podcast" (#6259)
Diffstat (limited to 'app/src/main/java/de/danoeh/antennapod/dialog')
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/dialog/RemoveFeedDialog.java | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/RemoveFeedDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/RemoveFeedDialog.java index 23c032248..363b87ca6 100644 --- a/app/src/main/java/de/danoeh/antennapod/dialog/RemoveFeedDialog.java +++ b/app/src/main/java/de/danoeh/antennapod/dialog/RemoveFeedDialog.java @@ -5,6 +5,8 @@ import android.content.Context; import android.content.DialogInterface; import android.util.Log; +import androidx.annotation.Nullable; + import java.util.Collections; import java.util.List; @@ -19,21 +21,26 @@ import io.reactivex.schedulers.Schedulers; public class RemoveFeedDialog { private static final String TAG = "RemoveFeedDialog"; - public static void show(Context context, Feed feed) { + public static void show(Context context, Feed feed, @Nullable Runnable callback) { List<Feed> feeds = Collections.singletonList(feed); String message = getMessageId(context, feeds); - showDialog(context, feeds, message); + showDialog(context, feeds, message, callback); } public static void show(Context context, List<Feed> feeds) { String message = getMessageId(context, feeds); - showDialog(context, feeds, message); + showDialog(context, feeds, message, null); } - private static void showDialog(Context context, List<Feed> feeds, String message) { + private static void showDialog(Context context, List<Feed> feeds, String message, @Nullable Runnable callback) { ConfirmationDialog dialog = new ConfirmationDialog(context, R.string.remove_feed_label, message) { @Override public void onConfirmButtonPressed(DialogInterface clickedDialog) { + + if (callback != null) { + callback.run(); + } + clickedDialog.dismiss(); ProgressDialog progressDialog = new ProgressDialog(context); |