Skip to content

Commit

Permalink
Use MaterialAlertDialogBuilders over AlertDialog.Builder
Browse files Browse the repository at this point in the history
Applies the Material 3 theme to each alert dialog
  • Loading branch information
t895 authored and thestinger committed Apr 19, 2024
1 parent a5785e7 commit 25d2749
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
import androidx.activity.result.ActivityResultLauncher;
import androidx.activity.result.contract.ActivityResultContracts;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.preference.PreferenceManager;

import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.google.android.material.snackbar.Snackbar;
import com.google.common.collect.ImmutableSet;
import com.google.zxing.BarcodeFormat;
Expand Down Expand Up @@ -535,7 +535,7 @@ public boolean onPrepareOptionsMenu(final Menu menu) {
public boolean onOptionsItemSelected(final MenuItem item) {
final int itemId = item.getItemId();
if (itemId == R.id.action_clear_auditee) {
new AlertDialog.Builder(this)
new MaterialAlertDialogBuilder(this)
.setMessage(getString(R.string.action_clear_auditee) + "?")
.setPositiveButton(R.string.clear, (dialogInterface, i) -> {
executor.submit(() -> {
Expand All @@ -552,7 +552,7 @@ public boolean onOptionsItemSelected(final MenuItem item) {
.show();
return true;
} else if (itemId == R.id.action_clear_auditor) {
new AlertDialog.Builder(this)
new MaterialAlertDialogBuilder(this)
.setMessage(getString(R.string.action_clear_auditor) + "?")
.setPositiveButton(R.string.clear, (dialogInterface, i) -> {
executor.submit(() -> {
Expand All @@ -568,7 +568,7 @@ public boolean onOptionsItemSelected(final MenuItem item) {
startQrScanner();
return true;
} else if (itemId == R.id.action_disable_remote_verify) {
new AlertDialog.Builder(this)
new MaterialAlertDialogBuilder(this)
.setMessage(getString(R.string.action_disable_remote_verify) + "?")
.setPositiveButton(R.string.disable, (dialogInterface, i) -> {
RemoteVerifyJob.executor.submit(() -> {
Expand Down

0 comments on commit 25d2749

Please sign in to comment.