summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorByteHamster <info@bytehamster.com>2022-08-06 15:52:04 +0200
committerByteHamster <info@bytehamster.com>2022-09-18 19:12:38 +0200
commitcbfa0181f48e601a18d87f9f699f48460dd61acd (patch)
tree10b54895243ff8f4d9fb19872502850731356fc7
parentac8114342c4beb90745cfc5bd9235ca219a36b29 (diff)
downloadAntennaPod-cbfa0181f48e601a18d87f9f699f48460dd61acd.zip
Migrate dialogs to Material3
-rw-r--r--app/src/free/java/de/danoeh/antennapod/dialog/RatingDialog.java3
-rw-r--r--app/src/main/java/de/danoeh/antennapod/activity/BugReportActivity.java4
-rw-r--r--app/src/main/java/de/danoeh/antennapod/activity/OnlineFeedViewActivity.java8
-rw-r--r--app/src/main/java/de/danoeh/antennapod/activity/OpmlImportActivity.java8
-rw-r--r--app/src/main/java/de/danoeh/antennapod/activity/PreferenceActivity.java4
-rw-r--r--app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java4
-rw-r--r--app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java4
-rw-r--r--app/src/main/java/de/danoeh/antennapod/adapter/actionbutton/MobileDownloadHelper.java4
-rw-r--r--app/src/main/java/de/danoeh/antennapod/dialog/AuthenticationDialog.java4
-rw-r--r--app/src/main/java/de/danoeh/antennapod/dialog/ChooseDataFolderDialog.java3
-rw-r--r--app/src/main/java/de/danoeh/antennapod/dialog/DownloadLogDetailsDialog.java3
-rw-r--r--app/src/main/java/de/danoeh/antennapod/dialog/EpisodeFilterDialog.java4
-rw-r--r--app/src/main/java/de/danoeh/antennapod/dialog/FeedPreferenceSkipDialog.java4
-rw-r--r--app/src/main/java/de/danoeh/antennapod/dialog/FeedRefreshIntervalDialog.java4
-rw-r--r--app/src/main/java/de/danoeh/antennapod/dialog/FeedSortDialog.java4
-rw-r--r--app/src/main/java/de/danoeh/antennapod/dialog/IntraFeedSortDialog.java6
-rw-r--r--app/src/main/java/de/danoeh/antennapod/dialog/PlaybackControlsDialog.java3
-rw-r--r--app/src/main/java/de/danoeh/antennapod/dialog/ProxyDialog.java3
-rw-r--r--app/src/main/java/de/danoeh/antennapod/dialog/RenameItemDialog.java3
-rw-r--r--app/src/main/java/de/danoeh/antennapod/dialog/SkipPreferenceDialog.java3
-rw-r--r--app/src/main/java/de/danoeh/antennapod/dialog/SleepTimerDialog.java4
-rw-r--r--app/src/main/java/de/danoeh/antennapod/dialog/StreamingConfirmationDialog.java4
-rw-r--r--app/src/main/java/de/danoeh/antennapod/dialog/SubscriptionsFilterDialog.java4
-rw-r--r--app/src/main/java/de/danoeh/antennapod/dialog/SwipeActionsDialog.java5
-rw-r--r--app/src/main/java/de/danoeh/antennapod/dialog/TagSettingsDialog.java4
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/AddFeedFragment.java4
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/AudioPlayerFragment.java4
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/ChaptersFragment.java4
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/FeedInfoFragment.java4
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/FeedSettingsFragment.java4
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java4
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/actions/FeedMultiSelectActionHandler.java4
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/preferences/ImportExportPreferencesFragment.java10
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/preferences/MainPreferencesFragment.java4
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/preferences/UserInterfacePreferencesFragment.java5
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/preferences/about/LicensesFragment.java6
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/preferences/dialog/PreferenceListDialog.java4
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/preferences/dialog/PreferenceSwitchDialog.java4
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/preferences/synchronization/GpodderAuthenticationFragment.java4
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/preferences/synchronization/NextcloudAuthenticationFragment.java4
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/preferences/synchronization/SynchronizationPreferencesFragment.java7
-rw-r--r--app/src/main/java/de/danoeh/antennapod/preferences/NumberPickerPreference.java3
-rw-r--r--app/src/main/res/layout/swipeactions_row.xml1
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/dialog/ConfirmationDialog.java3
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/util/download/AutoUpdateManager.java4
-rw-r--r--ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/feed/FeedStatisticsDialogFragment.java4
-rw-r--r--ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/subscriptions/StatisticsFilterDialog.java4
47 files changed, 105 insertions, 94 deletions
diff --git a/app/src/free/java/de/danoeh/antennapod/dialog/RatingDialog.java b/app/src/free/java/de/danoeh/antennapod/dialog/RatingDialog.java
index 255da6eaf..3973a538d 100644
--- a/app/src/free/java/de/danoeh/antennapod/dialog/RatingDialog.java
+++ b/app/src/free/java/de/danoeh/antennapod/dialog/RatingDialog.java
@@ -11,6 +11,7 @@ import java.lang.ref.WeakReference;
import java.util.concurrent.TimeUnit;
import androidx.appcompat.app.AlertDialog;
+import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import de.danoeh.antennapod.R;
import de.danoeh.antennapod.core.util.IntentUtils;
@@ -101,7 +102,7 @@ public class RatingDialog {
if (context == null) {
return null;
}
- return new AlertDialog.Builder(context)
+ return new MaterialAlertDialogBuilder(context)
.setTitle(R.string.rating_title)
.setMessage(R.string.rating_message)
.setPositiveButton(R.string.rating_now_label, (dialog, which) -> rateNow())
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/BugReportActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/BugReportActivity.java
index 64e5a109c..96f7e9aa2 100644
--- a/app/src/main/java/de/danoeh/antennapod/activity/BugReportActivity.java
+++ b/app/src/main/java/de/danoeh/antennapod/activity/BugReportActivity.java
@@ -9,7 +9,7 @@ import android.util.Log;
import com.google.android.material.snackbar.Snackbar;
import androidx.annotation.NonNull;
-import androidx.appcompat.app.AlertDialog;
+import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ShareCompat;
import androidx.core.content.FileProvider;
@@ -79,7 +79,7 @@ public class BugReportActivity extends AppCompatActivity {
@Override
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
if (item.getItemId() == R.id.export_logcat) {
- AlertDialog.Builder alertBuilder = new AlertDialog.Builder(this);
+ MaterialAlertDialogBuilder alertBuilder = new MaterialAlertDialogBuilder(this);
alertBuilder.setMessage(R.string.confirm_export_log_dialog_message);
alertBuilder.setPositiveButton(R.string.confirm_label, (dialog, which) -> {
exportLog();
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/OnlineFeedViewActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/OnlineFeedViewActivity.java
index 67647b999..67394018f 100644
--- a/app/src/main/java/de/danoeh/antennapod/activity/OnlineFeedViewActivity.java
+++ b/app/src/main/java/de/danoeh/antennapod/activity/OnlineFeedViewActivity.java
@@ -22,7 +22,7 @@ import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.UiThread;
-import androidx.appcompat.app.AlertDialog;
+import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.NavUtils;
import com.bumptech.glide.Glide;
@@ -156,7 +156,7 @@ public class OnlineFeedViewActivity extends AppCompatActivity {
}
private void showNoPodcastFoundError() {
- runOnUiThread(() -> new AlertDialog.Builder(OnlineFeedViewActivity.this)
+ runOnUiThread(() -> new MaterialAlertDialogBuilder(OnlineFeedViewActivity.this)
.setNeutralButton(android.R.string.ok, (dialog, which) -> finish())
.setTitle(R.string.error_label)
.setMessage(R.string.null_value_podcast_error)
@@ -588,7 +588,7 @@ public class OnlineFeedViewActivity extends AppCompatActivity {
@UiThread
private void showErrorDialog(String errorMsg, String details) {
if (!isFinishing() && !isPaused) {
- AlertDialog.Builder builder = new AlertDialog.Builder(this);
+ MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(this);
builder.setTitle(R.string.error_label);
if (errorMsg != null) {
String total = errorMsg + "\n\n" + details;
@@ -662,7 +662,7 @@ public class OnlineFeedViewActivity extends AppCompatActivity {
startFeedDownload(selectedUrl);
};
- AlertDialog.Builder ab = new AlertDialog.Builder(OnlineFeedViewActivity.this)
+ MaterialAlertDialogBuilder ab = new MaterialAlertDialogBuilder(OnlineFeedViewActivity.this)
.setTitle(R.string.feeds_label)
.setCancelable(true)
.setOnCancelListener(dialog -> finish())
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/OpmlImportActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/OpmlImportActivity.java
index c10956ab3..f92d422d0 100644
--- a/app/src/main/java/de/danoeh/antennapod/activity/OpmlImportActivity.java
+++ b/app/src/main/java/de/danoeh/antennapod/activity/OpmlImportActivity.java
@@ -20,7 +20,7 @@ import android.widget.Toast;
import androidx.activity.result.ActivityResultLauncher;
import androidx.activity.result.contract.ActivityResultContracts.RequestPermission;
import androidx.annotation.Nullable;
-import androidx.appcompat.app.AlertDialog;
+import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import de.danoeh.antennapod.R;
@@ -128,7 +128,7 @@ public class OpmlImportActivity extends AppCompatActivity {
void importUri(@Nullable Uri uri) {
if (uri == null) {
- new AlertDialog.Builder(this)
+ new MaterialAlertDialogBuilder(this)
.setMessage(R.string.opml_import_error_no_file)
.setPositiveButton(android.R.string.ok, null)
.show();
@@ -202,7 +202,7 @@ public class OpmlImportActivity extends AppCompatActivity {
if (isGranted) {
startImport();
} else {
- new AlertDialog.Builder(this)
+ new MaterialAlertDialogBuilder(this)
.setMessage(R.string.opml_import_ask_read_permission)
.setPositiveButton(android.R.string.ok, (dialog, which) ->
requestPermission())
@@ -240,7 +240,7 @@ public class OpmlImportActivity extends AppCompatActivity {
viewBinding.feedlist.setAdapter(listAdapter);
}, e -> {
viewBinding.progressBar.setVisibility(View.GONE);
- AlertDialog.Builder alert = new AlertDialog.Builder(this);
+ MaterialAlertDialogBuilder alert = new MaterialAlertDialogBuilder(this);
alert.setTitle(R.string.error_label);
alert.setMessage(getString(R.string.opml_reader_error) + e.getMessage());
alert.setNeutralButton(android.R.string.ok, (dialog, which) -> dialog.dismiss());
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/PreferenceActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/PreferenceActivity.java
index 200154bc2..8a36b3068 100644
--- a/app/src/main/java/de/danoeh/antennapod/activity/PreferenceActivity.java
+++ b/app/src/main/java/de/danoeh/antennapod/activity/PreferenceActivity.java
@@ -10,7 +10,7 @@ import android.view.View;
import android.view.inputmethod.InputMethodManager;
import androidx.appcompat.app.ActionBar;
-import androidx.appcompat.app.AlertDialog;
+import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import androidx.appcompat.app.AppCompatActivity;
import androidx.preference.PreferenceFragmentCompat;
@@ -155,7 +155,7 @@ public class PreferenceActivity extends AppCompatActivity implements SearchPrefe
public void onSearchResultClicked(SearchPreferenceResult result) {
int screen = result.getResourceFile();
if (screen == R.xml.feed_settings) {
- AlertDialog.Builder builder = new AlertDialog.Builder(this);
+ MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(this);
builder.setTitle(R.string.feed_settings_label);
builder.setMessage(R.string.pref_feed_settings_dialog_msg);
builder.setPositiveButton(android.R.string.ok, null);
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java
index 048d04939..65a5bf507 100644
--- a/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java
+++ b/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java
@@ -31,7 +31,7 @@ import android.widget.EditText;
import android.widget.FrameLayout;
import android.widget.SeekBar;
import androidx.annotation.Nullable;
-import androidx.appcompat.app.AlertDialog;
+import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import androidx.core.view.WindowCompat;
import androidx.interpolator.view.animation.FastOutSlowInInterpolator;
import com.bumptech.glide.Glide;
@@ -543,7 +543,7 @@ public class VideoplayerActivity extends CastEnabledActivity implements SeekBar.
@Subscribe(threadMode = ThreadMode.MAIN)
public void onMediaPlayerError(PlayerErrorEvent event) {
- final AlertDialog.Builder errorDialog = new AlertDialog.Builder(VideoplayerActivity.this);
+ final MaterialAlertDialogBuilder errorDialog = new MaterialAlertDialogBuilder(VideoplayerActivity.this);
errorDialog.setTitle(R.string.error_label);
errorDialog.setMessage(event.getMessage());
errorDialog.setNeutralButton(android.R.string.ok, (dialog, which) -> finish());
diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java
index c1df44da3..5b3562997 100644
--- a/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java
+++ b/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java
@@ -17,7 +17,7 @@ import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
-import androidx.appcompat.app.AlertDialog;
+import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
@@ -271,7 +271,7 @@ public class NavListAdapter extends RecyclerView.Adapter<NavListAdapter.Holder>
Iconify.addIcons(holder.count);
holder.count.setVisibility(View.VISIBLE);
holder.count.setOnClickListener(v ->
- new AlertDialog.Builder(context)
+ new MaterialAlertDialogBuilder(context)
.setTitle(R.string.episode_cache_full_title)
.setMessage(R.string.episode_cache_full_message)
.setPositiveButton(android.R.string.ok, null)
diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/actionbutton/MobileDownloadHelper.java b/app/src/main/java/de/danoeh/antennapod/adapter/actionbutton/MobileDownloadHelper.java
index 6d8af23c0..4c68a559d 100644
--- a/app/src/main/java/de/danoeh/antennapod/adapter/actionbutton/MobileDownloadHelper.java
+++ b/app/src/main/java/de/danoeh/antennapod/adapter/actionbutton/MobileDownloadHelper.java
@@ -2,7 +2,7 @@ package de.danoeh.antennapod.adapter.actionbutton;
import android.content.Context;
-import androidx.appcompat.app.AlertDialog;
+import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import de.danoeh.antennapod.R;
import de.danoeh.antennapod.core.service.download.DownloadRequestCreator;
import de.danoeh.antennapod.core.service.download.DownloadService;
@@ -24,7 +24,7 @@ class MobileDownloadHelper {
}
static void confirmMobileDownload(final Context context, final FeedItem item) {
- AlertDialog.Builder builder = new AlertDialog.Builder(context)
+ MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(context)
.setTitle(R.string.confirm_mobile_download_dialog_title)
.setMessage(R.string.confirm_mobile_download_dialog_message)
.setPositiveButton(context.getText(R.string.confirm_mobile_download_dialog_enable_temporarily),
diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/AuthenticationDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/AuthenticationDialog.java
index 160afcf86..38ee82155 100644
--- a/app/src/main/java/de/danoeh/antennapod/dialog/AuthenticationDialog.java
+++ b/app/src/main/java/de/danoeh/antennapod/dialog/AuthenticationDialog.java
@@ -4,14 +4,14 @@ import android.content.Context;
import android.text.method.HideReturnsTransformationMethod;
import android.text.method.PasswordTransformationMethod;
import android.view.LayoutInflater;
-import androidx.appcompat.app.AlertDialog;
+import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import de.danoeh.antennapod.R;
import de.danoeh.antennapod.databinding.AuthenticationDialogBinding;
/**
* Displays a dialog with a username and password text field and an optional checkbox to save username and preferences.
*/
-public abstract class AuthenticationDialog extends AlertDialog.Builder {
+public abstract class AuthenticationDialog extends MaterialAlertDialogBuilder {
boolean passwordHidden = true;
public AuthenticationDialog(Context context, int titleRes, boolean enableUsernameField,
diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/ChooseDataFolderDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/ChooseDataFolderDialog.java
index fc34292cf..47cc60205 100644
--- a/app/src/main/java/de/danoeh/antennapod/dialog/ChooseDataFolderDialog.java
+++ b/app/src/main/java/de/danoeh/antennapod/dialog/ChooseDataFolderDialog.java
@@ -4,6 +4,7 @@ import android.content.Context;
import android.view.View;
import androidx.appcompat.app.AlertDialog;
+import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import androidx.core.util.Consumer;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
@@ -15,7 +16,7 @@ public class ChooseDataFolderDialog {
public static void showDialog(final Context context, Consumer<String> handlerFunc) {
View content = View.inflate(context, R.layout.choose_data_folder_dialog, null);
- AlertDialog dialog = new AlertDialog.Builder(context)
+ AlertDialog dialog = new MaterialAlertDialogBuilder(context)
.setView(content)
.setTitle(R.string.choose_data_directory)
.setMessage(R.string.choose_data_directory_message)
diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/DownloadLogDetailsDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/DownloadLogDetailsDialog.java
index 50fb0651f..023d0a152 100644
--- a/app/src/main/java/de/danoeh/antennapod/dialog/DownloadLogDetailsDialog.java
+++ b/app/src/main/java/de/danoeh/antennapod/dialog/DownloadLogDetailsDialog.java
@@ -6,6 +6,7 @@ import android.content.Context;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
+import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import de.danoeh.antennapod.R;
import de.danoeh.antennapod.model.download.DownloadStatus;
import de.danoeh.antennapod.core.storage.DBReader;
@@ -14,7 +15,7 @@ import de.danoeh.antennapod.model.feed.Feed;
import de.danoeh.antennapod.model.feed.FeedMedia;
import org.greenrobot.eventbus.EventBus;
-public class DownloadLogDetailsDialog extends AlertDialog.Builder {
+public class DownloadLogDetailsDialog extends MaterialAlertDialogBuilder {
public DownloadLogDetailsDialog(@NonNull Context context, DownloadStatus status) {
super(context);
diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/EpisodeFilterDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/EpisodeFilterDialog.java
index 595f37e40..ff58fb1a2 100644
--- a/app/src/main/java/de/danoeh/antennapod/dialog/EpisodeFilterDialog.java
+++ b/app/src/main/java/de/danoeh/antennapod/dialog/EpisodeFilterDialog.java
@@ -6,7 +6,7 @@ import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.RadioButton;
-import androidx.appcompat.app.AlertDialog;
+import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import de.danoeh.antennapod.R;
import de.danoeh.antennapod.model.feed.FeedFilter;
@@ -14,7 +14,7 @@ import de.danoeh.antennapod.model.feed.FeedFilter;
/**
* Displays a dialog with a text box for filtering episodes and two radio buttons for exclusion/inclusion
*/
-public abstract class EpisodeFilterDialog extends AlertDialog.Builder {
+public abstract class EpisodeFilterDialog extends MaterialAlertDialogBuilder {
private final FeedFilter initialFilter;
public EpisodeFilterDialog(Context context, FeedFilter filter) {
diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/FeedPreferenceSkipDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/FeedPreferenceSkipDialog.java
index 0e5a064eb..77c9ff67e 100644
--- a/app/src/main/java/de/danoeh/antennapod/dialog/FeedPreferenceSkipDialog.java
+++ b/app/src/main/java/de/danoeh/antennapod/dialog/FeedPreferenceSkipDialog.java
@@ -3,13 +3,13 @@ package de.danoeh.antennapod.dialog;
import android.content.Context;
import android.view.View;
import android.widget.EditText;
-import androidx.appcompat.app.AlertDialog;
+import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import de.danoeh.antennapod.R;
/**
* Displays a dialog with a username and password text field and an optional checkbox to save username and preferences.
*/
-public abstract class FeedPreferenceSkipDialog extends AlertDialog.Builder {
+public abstract class FeedPreferenceSkipDialog extends MaterialAlertDialogBuilder {
public FeedPreferenceSkipDialog(Context context, int skipIntroInitialValue,
int skipEndInitialValue) {
diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/FeedRefreshIntervalDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/FeedRefreshIntervalDialog.java
index f97940f8b..e6074da7f 100644
--- a/app/src/main/java/de/danoeh/antennapod/dialog/FeedRefreshIntervalDialog.java
+++ b/app/src/main/java/de/danoeh/antennapod/dialog/FeedRefreshIntervalDialog.java
@@ -7,7 +7,7 @@ import android.text.format.DateFormat;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ArrayAdapter;
-import androidx.appcompat.app.AlertDialog;
+import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import de.danoeh.antennapod.R;
import de.danoeh.antennapod.core.preferences.UserPreferences;
import de.danoeh.antennapod.core.util.download.AutoUpdateManager;
@@ -26,7 +26,7 @@ public class FeedRefreshIntervalDialog {
}
public void show() {
- AlertDialog.Builder builder = new AlertDialog.Builder(context);
+ MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(context);
builder.setTitle(R.string.feed_refresh_title);
builder.setMessage(R.string.feed_refresh_sum);
viewBinding = FeedRefreshDialogBinding.inflate(LayoutInflater.from(context));
diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/FeedSortDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/FeedSortDialog.java
index b89d05f88..c89ef8159 100644
--- a/app/src/main/java/de/danoeh/antennapod/dialog/FeedSortDialog.java
+++ b/app/src/main/java/de/danoeh/antennapod/dialog/FeedSortDialog.java
@@ -2,7 +2,7 @@ package de.danoeh.antennapod.dialog;
import android.content.Context;
-import androidx.appcompat.app.AlertDialog;
+import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import org.greenrobot.eventbus.EventBus;
@@ -15,7 +15,7 @@ import de.danoeh.antennapod.core.preferences.UserPreferences;
public class FeedSortDialog {
public static void showDialog(Context context) {
- AlertDialog.Builder dialog = new AlertDialog.Builder(context);
+ MaterialAlertDialogBuilder dialog = new MaterialAlertDialogBuilder(context);
dialog.setTitle(context.getString(R.string.pref_nav_drawer_feed_order_title));
dialog.setNegativeButton(android.R.string.cancel, (d, listener) -> d.dismiss());
diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/IntraFeedSortDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/IntraFeedSortDialog.java
index 40afddb6c..dc8cf65ba 100644
--- a/app/src/main/java/de/danoeh/antennapod/dialog/IntraFeedSortDialog.java
+++ b/app/src/main/java/de/danoeh/antennapod/dialog/IntraFeedSortDialog.java
@@ -4,7 +4,7 @@ import android.content.Context;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
-import androidx.appcompat.app.AlertDialog;
+import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import de.danoeh.antennapod.R;
import de.danoeh.antennapod.model.feed.SortOrder;
@@ -39,8 +39,8 @@ public abstract class IntraFeedSortDialog {
public void openDialog() {
int idxCurrentSort = getCurrentSortOrderIndex();
- AlertDialog.Builder builder =
- new AlertDialog.Builder(context)
+ MaterialAlertDialogBuilder builder =
+ new MaterialAlertDialogBuilder(context)
.setTitle(R.string.sort)
.setSingleChoiceItems(sortItems, idxCurrentSort, (dialog, idxNewSort) -> {
updateSort(sortValues[idxNewSort]);
diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/PlaybackControlsDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/PlaybackControlsDialog.java
index 841c121e9..eb3e42a6f 100644
--- a/app/src/main/java/de/danoeh/antennapod/dialog/PlaybackControlsDialog.java
+++ b/app/src/main/java/de/danoeh/antennapod/dialog/PlaybackControlsDialog.java
@@ -7,6 +7,7 @@ import android.os.Looper;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
+import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import androidx.fragment.app.DialogFragment;
import android.widget.Button;
import android.widget.CheckBox;
@@ -54,7 +55,7 @@ public class PlaybackControlsDialog extends DialogFragment {
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
- dialog = new AlertDialog.Builder(getContext())
+ dialog = new MaterialAlertDialogBuilder(getContext())
.setTitle(R.string.audio_controls)
.setView(R.layout.audio_controls)
.setPositiveButton(R.string.close_label, null).create();
diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/ProxyDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/ProxyDialog.java
index 266724e78..cc152f783 100644
--- a/app/src/main/java/de/danoeh/antennapod/dialog/ProxyDialog.java
+++ b/app/src/main/java/de/danoeh/antennapod/dialog/ProxyDialog.java
@@ -5,6 +5,7 @@ import android.content.Context;
import android.content.res.TypedArray;
import android.os.Build;
import androidx.appcompat.app.AlertDialog;
+import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import androidx.core.content.ContextCompat;
import android.text.Editable;
import android.text.TextUtils;
@@ -62,7 +63,7 @@ public class ProxyDialog {
View content = View.inflate(context, R.layout.proxy_settings, null);
spType = content.findViewById(R.id.spType);
- dialog = new AlertDialog.Builder(context)
+ dialog = new MaterialAlertDialogBuilder(context)
.setTitle(R.string.pref_proxy_title)
.setView(content)
.setNegativeButton(R.string.cancel_label, null)
diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/RenameItemDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/RenameItemDialog.java
index 52240606e..e6c5808f8 100644
--- a/app/src/main/java/de/danoeh/antennapod/dialog/RenameItemDialog.java
+++ b/app/src/main/java/de/danoeh/antennapod/dialog/RenameItemDialog.java
@@ -8,6 +8,7 @@ import java.util.List;
import android.view.LayoutInflater;
import androidx.appcompat.app.AlertDialog;
+import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import de.danoeh.antennapod.R;
import de.danoeh.antennapod.core.storage.NavDrawerData;
import de.danoeh.antennapod.model.feed.Feed;
@@ -41,7 +42,7 @@ public class RenameItemDialog {
String title = feed != null ? feed.getTitle() : drawerItem.getTitle();
binding.urlEditText.setText(title);
- AlertDialog dialog = new AlertDialog.Builder(activity)
+ AlertDialog dialog = new MaterialAlertDialogBuilder(activity)
.setView(binding.getRoot())
.setTitle(feed != null ? R.string.rename_feed_label : R.string.rename_tag_label)
.setPositiveButton(android.R.string.ok, (d, input) -> {
diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/SkipPreferenceDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/SkipPreferenceDialog.java
index 2b8976635..8362f6863 100644
--- a/app/src/main/java/de/danoeh/antennapod/dialog/SkipPreferenceDialog.java
+++ b/app/src/main/java/de/danoeh/antennapod/dialog/SkipPreferenceDialog.java
@@ -3,6 +3,7 @@ package de.danoeh.antennapod.dialog;
import android.content.Context;
import android.widget.TextView;
import androidx.appcompat.app.AlertDialog;
+import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import java.text.NumberFormat;
import java.util.Locale;
@@ -34,7 +35,7 @@ public class SkipPreferenceDialog {
"%d %s", values[i], context.getString(R.string.time_seconds));
}
- AlertDialog.Builder builder = new AlertDialog.Builder(context);
+ MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(context);
builder.setTitle(direction == SkipDirection.SKIP_FORWARD ? R.string.pref_fast_forward : R.string.pref_rewind);
builder.setSingleChoiceItems(choices, checked, null);
builder.setNegativeButton(R.string.cancel_label, null);
diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/SleepTimerDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/SleepTimerDialog.java
index 8cd34b5f8..5a4adf6a4 100644
--- a/app/src/main/java/de/danoeh/antennapod/dialog/SleepTimerDialog.java
+++ b/app/src/main/java/de/danoeh/antennapod/dialog/SleepTimerDialog.java
@@ -14,7 +14,7 @@ import android.widget.LinearLayout;
import android.widget.Spinner;
import android.widget.TextView;
import androidx.annotation.NonNull;
-import androidx.appcompat.app.AlertDialog;
+import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import androidx.fragment.app.DialogFragment;
import com.google.android.material.snackbar.Snackbar;
import de.danoeh.antennapod.R;
@@ -64,7 +64,7 @@ public class SleepTimerDialog extends DialogFragment {
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
View content = View.inflate(getContext(), R.layout.time_dialog, null);
- AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
+ MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(getContext());
builder.setTitle(R.string.sleep_timer_label);
builder.setView(content);
builder.setPositiveButton(R.string.close_label, null);
diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/StreamingConfirmationDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/StreamingConfirmationDialog.java
index a38463c4a..1edc580a8 100644
--- a/app/src/main/java/de/danoeh/antennapod/dialog/StreamingConfirmationDialog.java
+++ b/app/src/main/java/de/danoeh/antennapod/dialog/StreamingConfirmationDialog.java
@@ -1,7 +1,7 @@
package de.danoeh.antennapod.dialog;
import android.content.Context;
-import androidx.appcompat.app.AlertDialog;
+import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import de.danoeh.antennapod.R;
import de.danoeh.antennapod.core.preferences.UserPreferences;
import de.danoeh.antennapod.model.playback.Playable;
@@ -17,7 +17,7 @@ public class StreamingConfirmationDialog {
}
public void show() {
- new AlertDialog.Builder(context)
+ new MaterialAlertDialogBuilder(context)
.setTitle(R.string.stream_label)
.setMessage(R.string.confirm_mobile_streaming_notification_message)
.setPositiveButton(R.string.confirm_mobile_streaming_button_once, (dialog, which) -> stream())
diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/SubscriptionsFilterDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/SubscriptionsFilterDialog.java
index a468794cb..dd51a4b31 100644
--- a/app/src/main/java/de/danoeh/antennapod/dialog/SubscriptionsFilterDialog.java
+++ b/app/src/main/java/de/danoeh/antennapod/dialog/SubscriptionsFilterDialog.java
@@ -7,7 +7,7 @@ import android.view.View;
import android.widget.LinearLayout;
import android.widget.RadioButton;
-import androidx.appcompat.app.AlertDialog;
+import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import org.greenrobot.eventbus.EventBus;
@@ -26,7 +26,7 @@ public class SubscriptionsFilterDialog {
public static void showDialog(Context context) {
SubscriptionsFilter subscriptionsFilter = UserPreferences.getSubscriptionsFilter();
final Set<String> filterValues = new HashSet<>(Arrays.asList(subscriptionsFilter.getValues()));
- AlertDialog.Builder builder = new AlertDialog.Builder(context);
+ MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(context);
builder.setTitle(context.getString(R.string.pref_filter_feed_title));
LayoutInflater inflater = LayoutInflater.from(context);
diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/SwipeActionsDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/SwipeActionsDialog.java
index 6849e641b..a4ed7ac8c 100644
--- a/app/src/main/java/de/danoeh/antennapod/dialog/SwipeActionsDialog.java
+++ b/app/src/main/java/de/danoeh/antennapod/dialog/SwipeActionsDialog.java
@@ -8,6 +8,7 @@ import android.view.LayoutInflater;
import android.view.View;
import androidx.appcompat.app.AlertDialog;
+import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import androidx.appcompat.content.res.AppCompatResources;
import androidx.core.graphics.drawable.DrawableCompat;
import androidx.gridlayout.widget.GridLayout;
@@ -52,7 +53,7 @@ public class SwipeActionsDialog {
leftAction = actions.left;
rightAction = actions.right;
- final AlertDialog.Builder builder = new AlertDialog.Builder(context);
+ final MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(context);
keys = SwipeActions.swipeActions;
@@ -128,7 +129,7 @@ public class SwipeActionsDialog {
}
private void showPicker(SwipeactionsRowBinding view, int direction) {
- AlertDialog.Builder builder = new AlertDialog.Builder(context);
+ MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(context);
builder.setTitle(direction == LEFT ? R.string.swipe_left : R.string.swipe_right);
SwipeactionsPickerBinding picker = SwipeactionsPickerBinding.inflate(LayoutInflater.from(context));
diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/TagSettingsDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/TagSettingsDialog.java
index 8f5f1b802..47a706c86 100644
--- a/app/src/main/java/de/danoeh/antennapod/dialog/TagSettingsDialog.java
+++ b/app/src/main/java/de/danoeh/antennapod/dialog/TagSettingsDialog.java
@@ -10,7 +10,7 @@ import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
-import androidx.appcompat.app.AlertDialog;
+import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import androidx.fragment.app.DialogFragment;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
@@ -85,7 +85,7 @@ public class TagSettingsDialog extends DialogFragment {
viewBinding.commonTagsInfo.setVisibility(View.VISIBLE);
}
- AlertDialog.Builder dialog = new AlertDialog.Builder(getContext());
+ MaterialAlertDialogBuilder dialog = new MaterialAlertDialogBuilder(getContext());
dialog.setView(viewBinding.getRoot());
dialog.setTitle(R.string.feed_tags_label);
dialog.setPositiveButton(android.R.string.ok, (d, input) -> {
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/AddFeedFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/AddFeedFragment.java
index ab6d5a302..4b6beac13 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/AddFeedFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/AddFeedFragment.java
@@ -20,7 +20,7 @@ import androidx.activity.result.contract.ActivityResultContracts.GetContent;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
-import androidx.appcompat.app.AlertDialog;
+import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import androidx.documentfile.provider.DocumentFile;
import androidx.fragment.app.Fragment;
import com.google.android.material.snackbar.Snackbar;
@@ -132,7 +132,7 @@ public class AddFeedFragment extends Fragment {
}
private void showAddViaUrlDialog() {
- AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
+ MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(getContext());
builder.setTitle(R.string.add_podcast_by_url);
final EditTextDialogBinding dialogBinding = EditTextDialogBinding.inflate(getLayoutInflater());
dialogBinding.urlEditText.setHint(R.string.add_podcast_by_url_hint);
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/AudioPlayerFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/AudioPlayerFragment.java
index 5ec7fb091..5a00e0e96 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/AudioPlayerFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/AudioPlayerFragment.java
@@ -14,7 +14,7 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
-import androidx.appcompat.app.AlertDialog;
+import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.google.android.material.appbar.MaterialToolbar;
import androidx.cardview.widget.CardView;
import androidx.fragment.app.Fragment;
@@ -399,7 +399,7 @@ public class AudioPlayerFragment extends Fragment implements
@Subscribe(threadMode = ThreadMode.MAIN)
public void mediaPlayerError(PlayerErrorEvent event) {
- final AlertDialog.Builder errorDialog = new AlertDialog.Builder(getContext());
+ final MaterialAlertDialogBuilder errorDialog = new MaterialAlertDialogBuilder(getContext());
errorDialog.setTitle(R.string.error_label);
errorDialog.setMessage(event.getMessage());
errorDialog.setPositiveButton(android.R.string.ok, (dialog, which) ->
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/ChaptersFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/ChaptersFragment.java
index de63227e5..8304b8f58 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/ChaptersFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/ChaptersFragment.java
@@ -11,7 +11,7 @@ import android.widget.RelativeLayout;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
-import androidx.appcompat.app.AlertDialog;
+import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import androidx.appcompat.app.AppCompatDialogFragment;
import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.LinearLayoutManager;
@@ -47,7 +47,7 @@ public class ChaptersFragment extends AppCompatDialogFragment {
@NonNull
@Override
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
- return new AlertDialog.Builder(requireContext())
+ return new MaterialAlertDialogBuilder(requireContext())
.setTitle(getString(R.string.chapters_label))
.setView(onCreateView(getLayoutInflater()))
.setNegativeButton(getString(R.string.cancel_label), null) //dismisses
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/FeedInfoFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/FeedInfoFragment.java
index 0b6a2aa56..29074567c 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/FeedInfoFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/FeedInfoFragment.java
@@ -23,7 +23,7 @@ import androidx.activity.result.contract.ActivityResultContracts;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
-import androidx.appcompat.app.AlertDialog;
+import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import androidx.appcompat.content.res.AppCompatResources;
import com.google.android.material.appbar.MaterialToolbar;
import androidx.documentfile.provider.DocumentFile;
@@ -292,7 +292,7 @@ public class FeedInfoFragment extends Fragment implements MaterialToolbar.OnMenu
boolean handled = FeedMenuHandler.onOptionsItemClicked(getContext(), item, feed);
if (item.getItemId() == R.id.reconnect_local_folder && Build.VERSION.SDK_INT >= 21) {
- AlertDialog.Builder alert = new AlertDialog.Builder(getContext());
+ MaterialAlertDialogBuilder alert = new MaterialAlertDialogBuilder(getContext());
alert.setMessage(R.string.reconnect_local_folder_warning);
alert.setPositiveButton(android.R.string.ok, (dialog, which) -> {
try {
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/FeedSettingsFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/FeedSettingsFragment.java
index 3f775c6f2..1999d7294 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/FeedSettingsFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/FeedSettingsFragment.java
@@ -7,7 +7,7 @@ import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
-import androidx.appcompat.app.AlertDialog;
+import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.google.android.material.appbar.MaterialToolbar;
import androidx.fragment.app.Fragment;
import androidx.preference.ListPreference;
@@ -216,7 +216,7 @@ public class FeedSettingsFragment extends Fragment {
});
viewBinding.useGlobalCheckbox.setChecked(speed == FeedPreferences.SPEED_USE_GLOBAL);
viewBinding.seekBar.updateSpeed(speed == FeedPreferences.SPEED_USE_GLOBAL ? 1 : speed);
- new AlertDialog.Builder(getContext())
+ new MaterialAlertDialogBuilder(getContext())
.setTitle(R.string.playback_speed)
.setView(viewBinding.getRoot())
.setPositiveButton(android.R.string.ok, (dialog, which) -> {
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 67671188a..c54374059 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java
@@ -16,7 +16,7 @@ import android.view.ViewGroup;
import android.widget.CheckBox;
import android.widget.TextView;
import androidx.annotation.NonNull;
-import androidx.appcompat.app.AlertDialog;
+import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.google.android.material.appbar.MaterialToolbar;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.ItemTouchHelper;
@@ -348,7 +348,7 @@ public class QueueFragment extends Fragment implements MaterialToolbar.OnMenuIte
if (!shouldShowLockWarning) {
setQueueLocked(true);
} else {
- AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
+ MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(getContext());
builder.setTitle(R.string.lock_queue);
builder.setMessage(R.string.queue_lock_warning);
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/actions/FeedMultiSelectActionHandler.java b/app/src/main/java/de/danoeh/antennapod/fragment/actions/FeedMultiSelectActionHandler.java
index 5cd0f26ab..203a64c32 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/actions/FeedMultiSelectActionHandler.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/actions/FeedMultiSelectActionHandler.java
@@ -3,7 +3,7 @@ package de.danoeh.antennapod.fragment.actions;
import android.util.Log;
import androidx.annotation.PluralsRes;
-import androidx.appcompat.app.AlertDialog;
+import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import androidx.core.util.Consumer;
import com.google.android.material.snackbar.Snackbar;
@@ -75,7 +75,7 @@ public class FeedMultiSelectActionHandler {
viewBinding.currentSpeedLabel.setAlpha(isChecked ? 0.4f : 1f);
});
viewBinding.seekBar.updateSpeed(1.0f);
- new AlertDialog.Builder(activity)
+ new MaterialAlertDialogBuilder(activity)
.setTitle(R.string.playback_speed)
.setView(viewBinding.getRoot())
.setPositiveButton(android.R.string.ok, (dialog, which) -> {
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/preferences/ImportExportPreferencesFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/preferences/ImportExportPreferencesFragment.java
index 075d01b8b..3b4368464 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/preferences/ImportExportPreferencesFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/preferences/ImportExportPreferencesFragment.java
@@ -16,7 +16,7 @@ import androidx.activity.result.contract.ActivityResultContracts.GetContent;
import androidx.activity.result.contract.ActivityResultContracts.StartActivityForResult;
import androidx.annotation.NonNull;
import androidx.annotation.StringRes;
-import androidx.appcompat.app.AlertDialog;
+import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import androidx.core.app.ShareCompat;
import androidx.core.content.FileProvider;
import androidx.preference.PreferenceFragmentCompat;
@@ -166,7 +166,7 @@ public class ImportExportPreferencesFragment extends PreferenceFragmentCompat {
private void importDatabase() {
// setup the alert builder
- AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
+ MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(getActivity());
builder.setTitle(R.string.database_import_label);
builder.setMessage(R.string.database_import_warning);
@@ -183,7 +183,7 @@ public class ImportExportPreferencesFragment extends PreferenceFragmentCompat {
}
private void showDatabaseImportSuccessDialog() {
- AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
+ MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(getContext());
builder.setTitle(R.string.successful_import_label);
builder.setMessage(R.string.import_ok);
builder.setCancelable(false);
@@ -192,7 +192,7 @@ public class ImportExportPreferencesFragment extends PreferenceFragmentCompat {
}
private void showExportSuccessDialog(String path, Uri streamUri, Export exportType) {
- final AlertDialog.Builder alert = new AlertDialog.Builder(getContext());
+ final MaterialAlertDialogBuilder alert = new MaterialAlertDialogBuilder(getContext());
alert.setNeutralButton(android.R.string.ok, (dialog, which) -> dialog.dismiss());
alert.setTitle(R.string.export_success_title);
alert.setMessage(getContext().getString(R.string.export_success_sum, path));
@@ -209,7 +209,7 @@ public class ImportExportPreferencesFragment extends PreferenceFragmentCompat {
private void showExportErrorDialog(final Throwable error) {
progressDialog.dismiss();
- final AlertDialog.Builder alert = new AlertDialog.Builder(getContext());
+ final MaterialAlertDialogBuilder alert = new MaterialAlertDialogBuilder(getContext());
alert.setPositiveButton(android.R.string.ok, (dialog, which) -> dialog.dismiss());
alert.setTitle(R.string.export_error_label);
alert.setMessage(error.getMessage());
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/preferences/MainPreferencesFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/preferences/MainPreferencesFragment.java
index 7a0b47937..91bb00437 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/preferences/MainPreferencesFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/preferences/MainPreferencesFragment.java
@@ -5,7 +5,7 @@ import android.graphics.PorterDuff;
import android.graphics.PorterDuffColorFilter;
import android.os.Bundle;
-import androidx.appcompat.app.AlertDialog;
+import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import androidx.appcompat.app.AppCompatActivity;
import androidx.preference.Preference;
import androidx.preference.PreferenceFragmentCompat;
@@ -132,7 +132,7 @@ public class MainPreferencesFragment extends PreferenceFragmentCompat {
});
findPreference(PREF_STATISTICS).setOnPreferenceClickListener(
preference -> {
- new AlertDialog.Builder(getContext())
+ new MaterialAlertDialogBuilder(getContext())
.setMessage(R.string.statistics_moved)
.setPositiveButton(android.R.string.ok, null)
.show();
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/preferences/UserInterfacePreferencesFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/preferences/UserInterfacePreferencesFragment.java
index ef6dabe24..64e75acfe 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/preferences/UserInterfacePreferencesFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/preferences/UserInterfacePreferencesFragment.java
@@ -5,9 +5,10 @@ import android.os.Build;
import android.os.Bundle;
import android.widget.ListView;
import androidx.appcompat.app.AlertDialog;
+import com.google.android.material.snackbar.Snackbar;
+import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import androidx.core.app.ActivityCompat;
import androidx.preference.PreferenceFragmentCompat;
-import com.google.android.material.snackbar.Snackbar;
import de.danoeh.antennapod.R;
import de.danoeh.antennapod.activity.PreferenceActivity;
import de.danoeh.antennapod.core.preferences.UserPreferences;
@@ -98,7 +99,7 @@ public class UserInterfacePreferencesFragment extends PreferenceFragmentCompat {
}
}
- AlertDialog.Builder builder = new AlertDialog.Builder(context);
+ MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(context);
builder.setTitle(String.format(context.getResources().getString(
R.string.pref_compact_notification_buttons_dialog_title), 2));
builder.setMultiChoiceItems(allButtonNames, checked, (dialog, which, isChecked) -> {
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/preferences/about/LicensesFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/preferences/about/LicensesFragment.java
index 38e532aed..8b86d106e 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/preferences/about/LicensesFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/preferences/about/LicensesFragment.java
@@ -6,7 +6,7 @@ import android.widget.ListView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
-import androidx.appcompat.app.AlertDialog;
+import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import androidx.fragment.app.ListFragment;
import de.danoeh.antennapod.R;
import de.danoeh.antennapod.activity.PreferenceActivity;
@@ -81,7 +81,7 @@ public class LicensesFragment extends ListFragment {
LicenseItem item = licenses.get(position);
CharSequence[] items = {"View website", "View license"};
- new AlertDialog.Builder(getContext())
+ new MaterialAlertDialogBuilder(getContext())
.setTitle(item.title)
.setItems(items, (dialog, which) -> {
if (which == 0) {
@@ -102,7 +102,7 @@ public class LicensesFragment extends ListFragment {
licenseText.append(line).append("\n");
}
- new AlertDialog.Builder(getContext())
+ new MaterialAlertDialogBuilder(getContext())
.setMessage(licenseText)
.show();
} catch (IOException e) {
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/preferences/dialog/PreferenceListDialog.java b/app/src/main/java/de/danoeh/antennapod/fragment/preferences/dialog/PreferenceListDialog.java
index d5c487d1d..b6a11c001 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/preferences/dialog/PreferenceListDialog.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/preferences/dialog/PreferenceListDialog.java
@@ -2,7 +2,7 @@ package de.danoeh.antennapod.fragment.preferences.dialog;
import android.content.Context;
-import androidx.appcompat.app.AlertDialog;
+import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import de.danoeh.antennapod.R;
@@ -29,7 +29,7 @@ public class PreferenceListDialog {
public void openDialog(String[] items) {
- AlertDialog.Builder builder = new AlertDialog.Builder(context);
+ MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(context);
builder.setTitle(title);
builder.setSingleChoiceItems(items, selectedPos, (dialog, which) -> {
selectedPos = which;
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/preferences/dialog/PreferenceSwitchDialog.java b/app/src/main/java/de/danoeh/antennapod/fragment/preferences/dialog/PreferenceSwitchDialog.java
index cc7c92194..69319c11e 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/preferences/dialog/PreferenceSwitchDialog.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/preferences/dialog/PreferenceSwitchDialog.java
@@ -4,7 +4,7 @@ import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
-import androidx.appcompat.app.AlertDialog;
+import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import androidx.appcompat.widget.SwitchCompat;
import de.danoeh.antennapod.R;
@@ -33,7 +33,7 @@ public class PreferenceSwitchDialog {
public void openDialog() {
- AlertDialog.Builder builder = new AlertDialog.Builder(context);
+ MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(context);
builder.setTitle(title);
LayoutInflater inflater = LayoutInflater.from(this.context);
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/preferences/synchronization/GpodderAuthenticationFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/preferences/synchronization/GpodderAuthenticationFragment.java
index e3e069868..e340d6c1d 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/preferences/synchronization/GpodderAuthenticationFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/preferences/synchronization/GpodderAuthenticationFragment.java
@@ -15,7 +15,7 @@ import android.widget.TextView;
import android.widget.ViewFlipper;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
-import androidx.appcompat.app.AlertDialog;
+import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import androidx.fragment.app.DialogFragment;
import com.google.android.material.button.MaterialButton;
import de.danoeh.antennapod.R;
@@ -62,7 +62,7 @@ public class GpodderAuthenticationFragment extends DialogFragment {
@NonNull
@Override
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
- AlertDialog.Builder dialog = new AlertDialog.Builder(getContext());
+ MaterialAlertDialogBuilder dialog = new MaterialAlertDialogBuilder(getContext());
dialog.setTitle(R.string.gpodnetauth_login_butLabel);
dialog.setNegativeButton(R.string.cancel_label, null);
dialog.setCancelable(false);
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/preferences/synchronization/NextcloudAuthenticationFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/preferences/synchronization/NextcloudAuthenticationFragment.java
index 2e9260c1d..3578dace5 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/preferences/synchronization/NextcloudAuthenticationFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/preferences/synchronization/NextcloudAuthenticationFragment.java
@@ -6,7 +6,7 @@ import android.os.Bundle;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
-import androidx.appcompat.app.AlertDialog;
+import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import androidx.fragment.app.DialogFragment;
import de.danoeh.antennapod.R;
import de.danoeh.antennapod.core.service.download.AntennapodHttpClient;
@@ -30,7 +30,7 @@ public class NextcloudAuthenticationFragment extends DialogFragment
@NonNull
@Override
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
- AlertDialog.Builder dialog = new AlertDialog.Builder(getContext());
+ MaterialAlertDialogBuilder dialog = new MaterialAlertDialogBuilder(getContext());
dialog.setTitle(R.string.gpodnetauth_login_butLabel);
dialog.setNegativeButton(R.string.cancel_label, null);
dialog.setCancelable(false);
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/preferences/synchronization/SynchronizationPreferencesFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/preferences/synchronization/SynchronizationPreferencesFragment.java
index 8cb7f45db..2ac1f78df 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/preferences/synchronization/SynchronizationPreferencesFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/preferences/synchronization/SynchronizationPreferencesFragment.java
@@ -13,7 +13,7 @@ import android.widget.ListAdapter;
import android.widget.TextView;
import androidx.annotation.NonNull;
-import androidx.appcompat.app.AlertDialog;
+import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import androidx.core.text.HtmlCompat;
import androidx.preference.Preference;
import androidx.preference.PreferenceFragmentCompat;
@@ -149,7 +149,7 @@ public class SynchronizationPreferencesFragment extends PreferenceFragmentCompat
}
private void chooseProviderAndLogin() {
- AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
+ MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(getContext());
builder.setTitle(R.string.dialog_choose_sync_service_title);
SynchronizationProviderViewData[] providers = SynchronizationProviderViewData.values();
@@ -199,8 +199,7 @@ public class SynchronizationPreferencesFragment extends PreferenceFragmentCompat
updateScreen();
});
- AlertDialog dialog = builder.create();
- dialog.show();
+ builder.show();
}
private boolean isProviderSelected(@NonNull SynchronizationProviderViewData provider) {
diff --git a/app/src/main/java/de/danoeh/antennapod/preferences/NumberPickerPreference.java b/app/src/main/java/de/danoeh/antennapod/preferences/NumberPickerPreference.java
index 484d56e96..a15c6d6b2 100644
--- a/app/src/main/java/de/danoeh/antennapod/preferences/NumberPickerPreference.java
+++ b/app/src/main/java/de/danoeh/antennapod/preferences/NumberPickerPreference.java
@@ -2,6 +2,7 @@ package de.danoeh.antennapod.preferences;
import android.content.Context;
import androidx.appcompat.app.AlertDialog;
+import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import androidx.preference.Preference;
import android.text.InputFilter;
import android.util.AttributeSet;
@@ -78,7 +79,7 @@ public class NumberPickerPreference extends Preference {
return "";
}});
- AlertDialog dialog = new AlertDialog.Builder(context)
+ AlertDialog dialog = new MaterialAlertDialogBuilder(context)
.setTitle(getTitle())
.setView(view)
.setNegativeButton(android.R.string.cancel, null)
diff --git a/app/src/main/res/layout/swipeactions_row.xml b/app/src/main/res/layout/swipeactions_row.xml
index df55d3f89..7185d8238 100644
--- a/app/src/main/res/layout/swipeactions_row.xml
+++ b/app/src/main/res/layout/swipeactions_row.xml
@@ -54,6 +54,7 @@
android:id="@+id/previewContainer"
android:layout_width="match_parent"
android:layout_height="76dp"
+ android:background="?attr/background_color"
android:gravity="center"
android:foreground="?attr/selectableItemBackground"
android:orientation="horizontal">
diff --git a/core/src/main/java/de/danoeh/antennapod/core/dialog/ConfirmationDialog.java b/core/src/main/java/de/danoeh/antennapod/core/dialog/ConfirmationDialog.java
index 47b5dcd09..b964c7508 100644
--- a/core/src/main/java/de/danoeh/antennapod/core/dialog/ConfirmationDialog.java
+++ b/core/src/main/java/de/danoeh/antennapod/core/dialog/ConfirmationDialog.java
@@ -3,6 +3,7 @@ package de.danoeh.antennapod.core.dialog;
import android.content.Context;
import android.content.DialogInterface;
import androidx.appcompat.app.AlertDialog;
+import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import android.util.Log;
import de.danoeh.antennapod.core.R;
@@ -43,7 +44,7 @@ public abstract class ConfirmationDialog {
public abstract void onConfirmButtonPressed(DialogInterface dialog);
public final AlertDialog createNewDialog() {
- AlertDialog.Builder builder = new AlertDialog.Builder(context);
+ MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(context);
builder.setTitle(titleId);
builder.setMessage(message);
builder.setPositiveButton(positiveText != 0 ? positiveText : R.string.confirm_label,
diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/download/AutoUpdateManager.java b/core/src/main/java/de/danoeh/antennapod/core/util/download/AutoUpdateManager.java
index 674082a13..e79be8019 100644
--- a/core/src/main/java/de/danoeh/antennapod/core/util/download/AutoUpdateManager.java
+++ b/core/src/main/java/de/danoeh/antennapod/core/util/download/AutoUpdateManager.java
@@ -4,7 +4,7 @@ import android.content.Context;
import android.util.Log;
import androidx.annotation.NonNull;
-import androidx.appcompat.app.AlertDialog;
+import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import androidx.work.Constraints;
import androidx.work.Data;
import androidx.work.ExistingPeriodicWorkPolicy;
@@ -131,7 +131,7 @@ public class AutoUpdateManager {
}
private static void confirmMobileAllFeedsRefresh(final Context context) {
- AlertDialog.Builder builder = new AlertDialog.Builder(context)
+ MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(context)
.setTitle(R.string.feed_refresh_title)
.setMessage(R.string.confirm_mobile_feed_refresh_dialog_message)
.setPositiveButton(R.string.confirm_mobile_streaming_button_once,
diff --git a/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/feed/FeedStatisticsDialogFragment.java b/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/feed/FeedStatisticsDialogFragment.java
index f0308e364..f3a063aac 100644
--- a/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/feed/FeedStatisticsDialogFragment.java
+++ b/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/feed/FeedStatisticsDialogFragment.java
@@ -5,7 +5,7 @@ import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
-import androidx.appcompat.app.AlertDialog;
+import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import androidx.fragment.app.DialogFragment;
import de.danoeh.antennapod.ui.appstartintent.MainActivityStarter;
@@ -27,7 +27,7 @@ public class FeedStatisticsDialogFragment extends DialogFragment {
@NonNull
@Override
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
- AlertDialog.Builder dialog = new AlertDialog.Builder(getContext());
+ MaterialAlertDialogBuilder dialog = new MaterialAlertDialogBuilder(getContext());
dialog.setPositiveButton(android.R.string.ok, null);
dialog.setNeutralButton(R.string.open_podcast, (dialogInterface, i) -> {
long feedId = getArguments().getLong(EXTRA_FEED_ID);
diff --git a/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/subscriptions/StatisticsFilterDialog.java b/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/subscriptions/StatisticsFilterDialog.java
index 567edd2bf..8efdcf603 100644
--- a/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/subscriptions/StatisticsFilterDialog.java
+++ b/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/subscriptions/StatisticsFilterDialog.java
@@ -4,7 +4,7 @@ import android.content.Context;
import android.content.SharedPreferences;
import android.view.LayoutInflater;
import android.widget.ArrayAdapter;
-import androidx.appcompat.app.AlertDialog;
+import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import androidx.core.util.Pair;
import de.danoeh.antennapod.event.StatisticsEvent;
import de.danoeh.antennapod.ui.statistics.R;
@@ -40,7 +40,7 @@ public class StatisticsFilterDialog {
public void show() {
StatisticsFilterDialogBinding dialogBinding = StatisticsFilterDialogBinding.inflate(
LayoutInflater.from(context));
- AlertDialog.Builder builder = new AlertDialog.Builder(context);
+ MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(context);
builder.setView(dialogBinding.getRoot());
builder.setTitle(R.string.filter);
dialogBinding.includeMarkedCheckbox.setOnCheckedChangeListener((compoundButton, checked) -> {