From 163b176bab2ce2ea659aeab78dad2d179fe1c7fd Mon Sep 17 00:00:00 2001 From: JosJuice Date: Thu, 2 Apr 2020 15:02:41 +0200 Subject: [PATCH] Android: Use the newly added style for all dialogs For consistency, and in case I missed any cases where not specifing a theme could lead to a crash on Android TV. --- .../org/dolphinemu/dolphinemu/NativeLibrary.java | 3 ++- .../dolphinemu/activities/EmulationActivity.java | 16 ++++++++-------- .../dolphinemu/adapters/GameAdapter.java | 2 +- .../features/settings/ui/SettingsActivity.java | 2 +- .../features/settings/ui/SettingsAdapter.java | 12 ++++++++---- .../ui/viewholder/ConfirmRunnableViewHolder.java | 2 +- .../dolphinemu/utils/PermissionsHandler.java | 2 +- 7 files changed, 22 insertions(+), 17 deletions(-) diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/NativeLibrary.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/NativeLibrary.java index 171946a226..f04fee5c67 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/NativeLibrary.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/NativeLibrary.java @@ -463,7 +463,8 @@ public final class NativeLibrary { // Create object used for waiting. final Object lock = new Object(); - AlertDialog.Builder builder = new AlertDialog.Builder(emulationActivity) + AlertDialog.Builder builder = new AlertDialog.Builder(emulationActivity, + R.style.DolphinDialogBase) .setTitle(caption) .setMessage(text); diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/EmulationActivity.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/EmulationActivity.java index aaad6b7250..2317cdd0bb 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/EmulationActivity.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/EmulationActivity.java @@ -738,7 +738,7 @@ public final class EmulationActivity extends AppCompatActivity { final SharedPreferences.Editor editor = mPreferences.edit(); boolean[] enabledButtons = new boolean[14]; - AlertDialog.Builder builder = new AlertDialog.Builder(this); + AlertDialog.Builder builder = new AlertDialog.Builder(this, R.style.DolphinDialogBase); builder.setTitle(R.string.emulation_toggle_controls); if (sIsGameCubeGame || mPreferences.getInt("wiiController", 3) == 0) { @@ -795,7 +795,7 @@ public final class EmulationActivity extends AppCompatActivity public void chooseDoubleTapButton() { final SharedPreferences.Editor editor = mPreferences.edit(); - AlertDialog.Builder builder = new AlertDialog.Builder(this); + AlertDialog.Builder builder = new AlertDialog.Builder(this, R.style.DolphinDialogBase); int currentController = mPreferences.getInt("wiiController", InputOverlay.OVERLAY_WIIMOTE_NUNCHUCK); @@ -857,7 +857,7 @@ public final class EmulationActivity extends AppCompatActivity value.setText(String.valueOf(seekbar.getProgress() + 50)); units.setText("%"); - AlertDialog.Builder builder = new AlertDialog.Builder(this); + AlertDialog.Builder builder = new AlertDialog.Builder(this, R.style.DolphinDialogBase); builder.setTitle(R.string.emulation_control_scale); builder.setView(view); builder.setPositiveButton(getString(R.string.ok), (dialogInterface, i) -> @@ -876,7 +876,7 @@ public final class EmulationActivity extends AppCompatActivity private void chooseController() { final SharedPreferences.Editor editor = mPreferences.edit(); - AlertDialog.Builder builder = new AlertDialog.Builder(this); + AlertDialog.Builder builder = new AlertDialog.Builder(this, R.style.DolphinDialogBase); builder.setTitle(R.string.emulation_choose_controller); builder.setSingleChoiceItems(R.array.controllersEntries, mPreferences.getInt("wiiController", 3), @@ -902,7 +902,7 @@ public final class EmulationActivity extends AppCompatActivity private void showMotionControlsOptions() { final SharedPreferences.Editor editor = mPreferences.edit(); - AlertDialog.Builder builder = new AlertDialog.Builder(this); + AlertDialog.Builder builder = new AlertDialog.Builder(this, R.style.DolphinDialogBase); builder.setTitle(R.string.emulation_motion_controls); builder.setSingleChoiceItems(R.array.motionControlsEntries, mPreferences.getInt("motionControlsEnabled", 0), @@ -938,7 +938,7 @@ public final class EmulationActivity extends AppCompatActivity } final SharedPreferences.Editor editor = mPreferences.edit(); - AlertDialog.Builder builder = new AlertDialog.Builder(this); + AlertDialog.Builder builder = new AlertDialog.Builder(this, R.style.DolphinDialogBase); builder.setTitle(R.string.emulation_screen_orientation); builder.setSingleChoiceItems(R.array.orientationEntries, initialIndex, (dialog, indexSelected) -> @@ -1055,7 +1055,7 @@ public final class EmulationActivity extends AppCompatActivity } }); - AlertDialog.Builder builder = new AlertDialog.Builder(this); + AlertDialog.Builder builder = new AlertDialog.Builder(this, R.style.DolphinDialogBase); builder.setTitle(getString(R.string.emulation_ir_sensitivity)); builder.setView(view); builder.setPositiveButton(R.string.ok, (dialogInterface, i) -> @@ -1090,7 +1090,7 @@ public final class EmulationActivity extends AppCompatActivity private void resetOverlay() { - new AlertDialog.Builder(this) + new AlertDialog.Builder(this, R.style.DolphinDialogBase) .setTitle(getString(R.string.emulation_touch_overlay_reset)) .setPositiveButton(R.string.yes, (dialogInterface, i) -> { diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/GameAdapter.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/GameAdapter.java index 3f463b372a..9fe084e1de 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/GameAdapter.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/GameAdapter.java @@ -137,7 +137,7 @@ public final class GameAdapter extends RecyclerView.Adapter impl if (gameId.isEmpty()) { - AlertDialog.Builder builder = new AlertDialog.Builder(activity); + AlertDialog.Builder builder = new AlertDialog.Builder(activity, R.style.DolphinDialogBase); builder.setTitle("Game Settings"); builder.setMessage("Files without game IDs don't support game-specific settings."); diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsActivity.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsActivity.java index bfaf6daf80..efd00d4abe 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsActivity.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsActivity.java @@ -218,7 +218,7 @@ public final class SettingsActivity extends AppCompatActivity implements Setting @Override public void showGameIniJunkDeletionQuestion() { - new AlertDialog.Builder(this) + new AlertDialog.Builder(this, R.style.DolphinDialogBase) .setTitle(getString(R.string.game_ini_junk_title)) .setMessage(getString(R.string.game_ini_junk_question)) .setPositiveButton(R.string.yes, (dialogInterface, i) -> mPresenter.clearSettings()) diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsAdapter.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsAdapter.java index f11a183626..30e410bb5b 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsAdapter.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsAdapter.java @@ -192,7 +192,8 @@ public final class SettingsAdapter extends RecyclerView.Adapter