From 9b7c5a44581065890771dd917c7722224c65068e Mon Sep 17 00:00:00 2001 From: Charles Lombardo Date: Sun, 24 Apr 2022 14:50:53 -0400 Subject: [PATCH] Android: Modernize theming system themes.xml now contains a collection of colors, attributes, and styles. No visuals have changed, but this will allow for a more flexible theming system in the future for custom day/night/etc themes. This also removes a bunch of redundant code that can now be written as global styles and inherited themes. --- .../Android/app/src/main/AndroidManifest.xml | 18 ++-- .../activities/EmulationActivity.java | 18 ++-- .../activities/UserDataActivity.java | 4 +- .../dolphinemu/dialogs/AlertMessage.java | 3 +- .../dolphinemu/dialogs/GameDetailsDialog.java | 3 +- .../dialogs/GamePropertiesDialog.java | 5 +- .../cheats/ui/CheatDetailsFragment.java | 2 +- .../features/cheats/ui/CheatsActivity.java | 8 +- .../settings/ui/SettingsActivity.java | 2 +- .../features/settings/ui/SettingsAdapter.java | 14 ++- .../ui/viewholder/RunRunnableViewHolder.java | 2 +- .../ui/viewholder/SettingViewHolder.java | 2 +- ...nlineUpdateRegionSelectDialogFragment.java | 2 +- .../SystemMenuNotInstalledDialogFragment.java | 2 +- .../ui/SystemUpdateResultFragment.java | 2 +- .../dolphinemu/fragments/ConvertFragment.java | 4 +- .../dolphinemu/ui/main/MainPresenter.java | 6 +- .../dolphinemu/utils/Analytics.java | 2 +- .../dolphinemu/utils/FileBrowserHelper.java | 2 +- .../dolphinemu/utils/ThreadUtil.java | 4 +- .../main/res/layout/fragment_ingame_menu.xml | 3 +- .../app/src/main/res/values/styles.xml | 89 +------------------ .../app/src/main/res/values/themes.xml | 68 ++++++++++++++ 23 files changed, 120 insertions(+), 145 deletions(-) create mode 100644 Source/Android/app/src/main/res/values/themes.xml diff --git a/Source/Android/app/src/main/AndroidManifest.xml b/Source/Android/app/src/main/AndroidManifest.xml index 35fd924eea2c..78bd53c35f13 100644 --- a/Source/Android/app/src/main/AndroidManifest.xml +++ b/Source/Android/app/src/main/AndroidManifest.xml @@ -49,7 +49,7 @@ + android:theme="@style/Theme.Dolphin.Main"> @@ -62,7 +62,7 @@ + android:theme="@style/Theme.Dolphin.TV"> @@ -76,26 +76,26 @@ android:name=".features.settings.ui.SettingsActivity" android:exported="false" android:configChanges="orientation|screenSize" - android:theme="@style/DolphinSettingsBase" + android:theme="@style/Theme.Dolphin.Settings" android:label="@string/settings"/> + android:theme="@style/Theme.Dolphin.FilePicker"> @@ -119,18 +119,18 @@ + android:theme="@style/Theme.Dolphin.Main" /> + android:theme="@style/Theme.Dolphin.Settings" /> + android:theme="@style/Theme.Dolphin.Main" /> SettingsActivity.launch(activity, MenuTag.CONFIG_PATHS)); @@ -807,7 +807,7 @@ public boolean dispatchKeyEvent(KeyEvent event) private void toggleControls() { - AlertDialog.Builder builder = new AlertDialog.Builder(this, R.style.DolphinDialogBase); + AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle(R.string.emulation_toggle_controls); if (!NativeLibrary.IsEmulatingWii() || mPreferences.getInt("wiiController", 3) == 0) { @@ -869,7 +869,7 @@ else if (mPreferences.getInt("wiiController", 3) == 4) public void chooseDoubleTapButton() { - AlertDialog.Builder builder = new AlertDialog.Builder(this, R.style.DolphinDialogBase); + AlertDialog.Builder builder = new AlertDialog.Builder(this); int currentController = mPreferences.getInt("wiiController", InputOverlay.OVERLAY_WIIMOTE_NUNCHUK); @@ -955,7 +955,7 @@ public void onStopTrackingTouch(SeekBar seekBar) }); valueOpacity.setText(seekbarOpacity.getProgress() + "%"); - AlertDialog.Builder builder = new AlertDialog.Builder(this, R.style.DolphinDialogBase); + AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle(R.string.emulation_control_adjustments); builder.setView(view); builder.setPositiveButton(R.string.ok, (dialogInterface, i) -> @@ -977,7 +977,7 @@ public void onStopTrackingTouch(SeekBar seekBar) private void chooseController() { final SharedPreferences.Editor editor = mPreferences.edit(); - AlertDialog.Builder builder = new AlertDialog.Builder(this, R.style.DolphinDialogBase); + AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle(R.string.emulation_choose_controller); builder.setSingleChoiceItems(R.array.controllersEntries, mPreferences.getInt("wiiController", 3), @@ -999,7 +999,7 @@ private void chooseController() private void showMotionControlsOptions() { - AlertDialog.Builder builder = new AlertDialog.Builder(this, R.style.DolphinDialogBase); + AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle(R.string.emulation_motion_controls); builder.setSingleChoiceItems(R.array.motionControlsEntries, IntSetting.MAIN_MOTION_CONTROLS.getInt(mSettings), @@ -1019,7 +1019,7 @@ private void showMotionControlsOptions() private void setIRMode() { - AlertDialog.Builder builder = new AlertDialog.Builder(this, R.style.DolphinDialogBase); + AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle(R.string.emulation_ir_mode); builder.setSingleChoiceItems(R.array.irModeEntries, IntSetting.MAIN_IR_MODE.getInt(mSettings), @@ -1129,7 +1129,7 @@ private void setIRSensitivity() } }); - AlertDialog.Builder builder = new AlertDialog.Builder(this, R.style.DolphinDialogBase); + AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle(getString(R.string.emulation_ir_sensitivity)); builder.setView(view); builder.setPositiveButton(R.string.ok, (dialogInterface, i) -> @@ -1162,7 +1162,7 @@ private void setIRSensitivity() private void resetOverlay() { - new AlertDialog.Builder(this, R.style.DolphinDialogBase) + new AlertDialog.Builder(this) .setTitle(getString(R.string.emulation_touch_overlay_reset)) .setPositiveButton(R.string.yes, (dialogInterface, i) -> mEmulationFragment.resetInputOverlay()) diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/UserDataActivity.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/UserDataActivity.java index 3471ef4fa5bd..0ab446a67d04 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/UserDataActivity.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/UserDataActivity.java @@ -100,7 +100,7 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) { Uri uri = data.getData(); - AlertDialog.Builder builder = new AlertDialog.Builder(this, R.style.DolphinDialogBase); + AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setMessage(R.string.user_data_import_warning); builder.setNegativeButton(R.string.no, (dialog, i) -> dialog.dismiss()); @@ -148,7 +148,7 @@ private void openFileManager() { // Activity not found. Perhaps it was removed by the OEM, or by some new Android version // that didn't exist at the time of writing. Not much we can do other than tell the user - new AlertDialog.Builder(this, R.style.DolphinDialogBase) + new AlertDialog.Builder(this) .setMessage(R.string.user_data_open_system_file_manager_failed) .setPositiveButton(R.string.ok, null) .show(); diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/dialogs/AlertMessage.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/dialogs/AlertMessage.java index 870d244033a1..529f9fb7008b 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/dialogs/AlertMessage.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/dialogs/AlertMessage.java @@ -47,8 +47,7 @@ public Dialog onCreateDialog(Bundle savedInstanceState) boolean isWarning = requireArguments().getBoolean(ARG_IS_WARNING); setCancelable(false); - AlertDialog.Builder builder = new AlertDialog.Builder(emulationActivity, - R.style.DolphinDialogBase) + AlertDialog.Builder builder = new AlertDialog.Builder(emulationActivity) .setTitle(title) .setMessage(message); diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/dialogs/GameDetailsDialog.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/dialogs/GameDetailsDialog.java index 4b49d7608397..2b1bf87beedc 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/dialogs/GameDetailsDialog.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/dialogs/GameDetailsDialog.java @@ -38,8 +38,7 @@ public Dialog onCreateDialog(Bundle savedInstanceState) { GameFile gameFile = GameFileCacheManager.addOrGet(getArguments().getString(ARG_GAME_PATH)); - AlertDialog.Builder builder = new AlertDialog.Builder(requireActivity(), - R.style.DolphinDialogBase); + AlertDialog.Builder builder = new AlertDialog.Builder(requireActivity()); ViewGroup contents = (ViewGroup) getActivity().getLayoutInflater() .inflate(R.layout.dialog_game_details, null); diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/dialogs/GamePropertiesDialog.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/dialogs/GamePropertiesDialog.java index 00d98643b84c..0c9b16cb0172 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/dialogs/GamePropertiesDialog.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/dialogs/GamePropertiesDialog.java @@ -117,8 +117,7 @@ public Dialog onCreateDialog(Bundle savedInstanceState) itemsBuilder.add(R.string.properties_clear_game_settings, (dialog, i) -> clearGameSettingsWithConfirmation(gameId)); - AlertDialog.Builder builder = new AlertDialog.Builder(requireContext(), - R.style.DolphinDialogBase); + AlertDialog.Builder builder = new AlertDialog.Builder(requireContext()); itemsBuilder.applyToBuilder(builder); builder.setTitle(requireContext() .getString(R.string.preferences_game_properties_with_game_id, gameId)); @@ -127,7 +126,7 @@ public Dialog onCreateDialog(Bundle savedInstanceState) private void clearGameSettingsWithConfirmation(String gameId) { - new AlertDialog.Builder(requireContext(), R.style.DolphinDialogBase) + new AlertDialog.Builder(requireContext()) .setTitle(R.string.properties_clear_game_settings) .setMessage(R.string.properties_clear_game_settings_confirmation) .setPositiveButton(R.string.yes, (dialog, i) -> clearGameSettings(gameId)) diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/ui/CheatDetailsFragment.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/ui/CheatDetailsFragment.java index de147c35b7cf..e5a027f64ba5 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/ui/CheatDetailsFragment.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/ui/CheatDetailsFragment.java @@ -89,7 +89,7 @@ private void clearEditErrors() private void onDeleteClicked(View view) { AlertDialog.Builder builder = - new AlertDialog.Builder(requireContext(), R.style.DolphinDialogBase); + new AlertDialog.Builder(requireContext()); builder.setMessage(getString(R.string.cheats_delete_confirmation, mCheat.getName())); builder.setPositiveButton(R.string.yes, (dialog, i) -> mViewModel.deleteSelectedCheat()); builder.setNegativeButton(R.string.no, null); diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/ui/CheatsActivity.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/ui/CheatsActivity.java index 238a764f3ba6..b3bb5cb0cdd4 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/ui/CheatsActivity.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/ui/CheatsActivity.java @@ -191,7 +191,7 @@ public Settings loadGameSpecificSettings() public void downloadGeckoCodes() { - AlertDialog progressDialog = new AlertDialog.Builder(this, R.style.DolphinDialogBase).create(); + AlertDialog progressDialog = new AlertDialog.Builder(this).create(); progressDialog.setTitle(R.string.cheats_downloading); progressDialog.setCancelable(false); progressDialog.show(); @@ -206,14 +206,14 @@ public void downloadGeckoCodes() if (codes == null) { - new AlertDialog.Builder(this, R.style.DolphinDialogBase) + new AlertDialog.Builder(this) .setMessage(getString(R.string.cheats_download_failed)) .setPositiveButton(R.string.ok, null) .show(); } else if (codes.length == 0) { - new AlertDialog.Builder(this, R.style.DolphinDialogBase) + new AlertDialog.Builder(this) .setMessage(getString(R.string.cheats_download_empty)) .setPositiveButton(R.string.ok, null) .show(); @@ -223,7 +223,7 @@ else if (codes.length == 0) int cheatsAdded = mViewModel.addDownloadedGeckoCodes(codes); String message = getString(R.string.cheats_download_succeeded, codes.length, cheatsAdded); - new AlertDialog.Builder(this, R.style.DolphinDialogBase) + new AlertDialog.Builder(this) .setMessage(message) .setPositiveButton(R.string.ok, null) .show(); 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 3cc3e2f9107a..baaf955e9607 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 @@ -228,7 +228,7 @@ public void hideLoading() @Override public void showGameIniJunkDeletionQuestion() { - new AlertDialog.Builder(this, R.style.DolphinDialogBase) + new AlertDialog.Builder(this) .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 a26be577544e..8e5649b23cd2 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 @@ -195,8 +195,7 @@ public void onSingleChoiceClick(SingleChoiceSetting item, int position) int value = getSelectionForSingleChoiceValue(item); - AlertDialog.Builder builder = new AlertDialog.Builder(mView.getActivity(), - R.style.DolphinDialogBase); + AlertDialog.Builder builder = new AlertDialog.Builder(mView.getActivity()); builder.setTitle(item.getName()); builder.setSingleChoiceItems(item.getChoicesId(), value, this); @@ -209,8 +208,7 @@ public void onStringSingleChoiceClick(StringSingleChoiceSetting item, int positi mClickedItem = item; mClickedPosition = position; - AlertDialog.Builder builder = new AlertDialog.Builder(mView.getActivity(), - R.style.DolphinDialogBase); + AlertDialog.Builder builder = new AlertDialog.Builder(mView.getActivity()); builder.setTitle(item.getName()); builder.setSingleChoiceItems(item.getChoicesId(), item.getSelectValueIndex(getSettings()), @@ -227,8 +225,7 @@ public void onSingleChoiceDynamicDescriptionsClick(SingleChoiceSettingDynamicDes int value = getSelectionForSingleChoiceDynamicDescriptionsValue(item); - AlertDialog.Builder builder = new AlertDialog.Builder(mView.getActivity(), - R.style.DolphinDialogBase); + AlertDialog.Builder builder = new AlertDialog.Builder(mView.getActivity()); builder.setTitle(item.getName()); builder.setSingleChoiceItems(item.getChoicesId(), value, this); @@ -242,8 +239,7 @@ public void onSliderClick(SliderSetting item, int position) mClickedPosition = position; mSeekbarMinValue = item.getMin(); mSeekbarProgress = item.getSelectedValue(getSettings()); - AlertDialog.Builder builder = new AlertDialog.Builder(mView.getActivity(), - R.style.DolphinDialogBase); + AlertDialog.Builder builder = new AlertDialog.Builder(mView.getActivity()); LayoutInflater inflater = LayoutInflater.from(mView.getActivity()); View view = inflater.inflate(R.layout.dialog_seekbar, null); @@ -303,7 +299,7 @@ public void onFilePickerDirectoryClick(SettingsItem item, int position) if (!PermissionsHandler.isExternalStorageLegacy()) { - AlertDialog.Builder builder = new AlertDialog.Builder(mContext, R.style.DolphinDialogBase); + AlertDialog.Builder builder = new AlertDialog.Builder(mContext); builder.setMessage(R.string.path_not_changeable_scoped_storage); builder.setPositiveButton(R.string.ok, (dialog, i) -> dialog.dismiss()); builder.show(); diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/RunRunnableViewHolder.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/RunRunnableViewHolder.java index 2d55f66c6bf3..cecc88fd21f7 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/RunRunnableViewHolder.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/RunRunnableViewHolder.java @@ -54,7 +54,7 @@ public void onClick(View clicked) if (alertTextID > 0) { - AlertDialog.Builder builder = new AlertDialog.Builder(mContext, R.style.DolphinDialogBase) + AlertDialog.Builder builder = new AlertDialog.Builder(mContext) .setTitle(mItem.getName()) .setMessage(alertTextID); diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/SettingViewHolder.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/SettingViewHolder.java index 3abbedbdafb6..41a7e94abd9b 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/SettingViewHolder.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/SettingViewHolder.java @@ -96,7 +96,7 @@ public boolean onLongClick(View clicked) Context context = clicked.getContext(); - AlertDialog.Builder builder = new AlertDialog.Builder(context, R.style.DolphinDialogBase) + AlertDialog.Builder builder = new AlertDialog.Builder(context) .setMessage(R.string.setting_clear_confirm); builder diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/sysupdate/ui/OnlineUpdateRegionSelectDialogFragment.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/sysupdate/ui/OnlineUpdateRegionSelectDialogFragment.java index dddcd204f820..d5bc94b11cad 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/sysupdate/ui/OnlineUpdateRegionSelectDialogFragment.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/sysupdate/ui/OnlineUpdateRegionSelectDialogFragment.java @@ -23,7 +23,7 @@ public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) R.string.japan), getString(R.string.korea), getString(R.string.united_states)}; int checkedItem = -1; - return new AlertDialog.Builder(requireContext(), R.style.DolphinDialogBase) + return new AlertDialog.Builder(requireContext()) .setTitle(R.string.region_select_title) .setSingleChoiceItems(items, checkedItem, (dialog, which) -> { diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/sysupdate/ui/SystemMenuNotInstalledDialogFragment.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/sysupdate/ui/SystemMenuNotInstalledDialogFragment.java index 02f73f1045df..9acf23804217 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/sysupdate/ui/SystemMenuNotInstalledDialogFragment.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/sysupdate/ui/SystemMenuNotInstalledDialogFragment.java @@ -16,7 +16,7 @@ public class SystemMenuNotInstalledDialogFragment extends DialogFragment @Override public Dialog onCreateDialog(Bundle savedInstanceState) { - return new AlertDialog.Builder(requireContext(), R.style.DolphinDialogBase) + return new AlertDialog.Builder(requireContext()) .setTitle(R.string.system_menu_not_installed_title) .setMessage(R.string.system_menu_not_installed_message) .setPositiveButton(R.string.yes, (dialog, which) -> diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/sysupdate/ui/SystemUpdateResultFragment.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/sysupdate/ui/SystemUpdateResultFragment.java index 298b4ac0ed60..292aadbd7e0c 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/sysupdate/ui/SystemUpdateResultFragment.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/sysupdate/ui/SystemUpdateResultFragment.java @@ -88,7 +88,7 @@ public Dialog onCreateDialog(Bundle savedInstanceState) throw new IllegalStateException("Unexpected value: " + mResult); } - return new AlertDialog.Builder(requireContext(), R.style.DolphinDialogBase) + return new AlertDialog.Builder(requireContext()) .setTitle(title) .setMessage(message) .setPositiveButton(R.string.ok, (dialog, which) -> diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/ConvertFragment.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/ConvertFragment.java index 180e100c42c5..dbae87c43776 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/ConvertFragment.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/ConvertFragment.java @@ -361,7 +361,7 @@ private Runnable addAreYouSureDialog(Runnable action, @StringRes int warning_tex return () -> { Context context = requireContext(); - AlertDialog.Builder builder = new AlertDialog.Builder(context, R.style.DolphinDialogBase); + AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setMessage(warning_text) .setPositiveButton(R.string.yes, (dialog, i) -> action.run()) .setNegativeButton(R.string.no, null); @@ -459,7 +459,7 @@ private void convert(String outPath) { progressDialog.dismiss(); - AlertDialog.Builder builder = new AlertDialog.Builder(context, R.style.DolphinDialogBase); + AlertDialog.Builder builder = new AlertDialog.Builder(context); if (success) { builder.setMessage(R.string.convert_success_message) diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/main/MainPresenter.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/main/MainPresenter.java index 52423c3da4cc..ca57cde56ffd 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/main/MainPresenter.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/main/MainPresenter.java @@ -165,7 +165,7 @@ public void onDirectorySelected(Intent result) if (Arrays.stream(childNames).noneMatch((name) -> FileBrowserHelper.GAME_EXTENSIONS.contains( FileBrowserHelper.getExtension(name, false)))) { - AlertDialog.Builder builder = new AlertDialog.Builder(mActivity, R.style.DolphinDialogBase); + AlertDialog.Builder builder = new AlertDialog.Builder(mActivity); builder.setMessage(mActivity.getString(R.string.wrong_file_extension_in_directory, FileBrowserHelper.setToSortedDelimitedString(FileBrowserHelper.GAME_EXTENSIONS))); builder.setPositiveButton(R.string.ok, null); @@ -204,7 +204,7 @@ public void importWiiSave(String path) mActivity.runOnUiThread(() -> { AlertDialog.Builder builder = - new AlertDialog.Builder(mActivity, R.style.DolphinDialogBase); + new AlertDialog.Builder(mActivity); builder.setMessage(R.string.wii_save_exists); builder.setCancelable(false); builder.setPositiveButton(R.string.yes, (dialog, i) -> canOverwriteFuture.complete(true)); @@ -250,7 +250,7 @@ public void importWiiSave(String path) public void importNANDBin(String path) { AlertDialog.Builder builder = - new AlertDialog.Builder(mActivity, R.style.DolphinDialogBase); + new AlertDialog.Builder(mActivity); builder.setMessage(R.string.nand_import_warning); builder.setNegativeButton(R.string.no, (dialog, i) -> dialog.dismiss()); diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/Analytics.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/Analytics.java index 05cd91e7075f..b5c5548ca38c 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/Analytics.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/Analytics.java @@ -36,7 +36,7 @@ public static void checkAnalyticsInit(Context context) private static void showMessage(Context context) { - new AlertDialog.Builder(context, R.style.DolphinDialogBase) + new AlertDialog.Builder(context) .setTitle(context.getString(R.string.analytics)) .setMessage(context.getString(R.string.analytics_desc)) .setPositiveButton(R.string.yes, (dialogInterface, i) -> diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/FileBrowserHelper.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/FileBrowserHelper.java index 848b5c4970d9..388ed98b694d 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/FileBrowserHelper.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/FileBrowserHelper.java @@ -118,7 +118,7 @@ public static void runAfterExtensionCheck(Context context, Uri uri, Set setToSortedDelimitedString(validExtensions)); } - new AlertDialog.Builder(context, R.style.DolphinDialogBase) + new AlertDialog.Builder(context) .setMessage(message) .setPositiveButton(R.string.yes, (dialogInterface, i) -> runnable.run()) .setNegativeButton(R.string.no, null) diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/ThreadUtil.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/ThreadUtil.java index 1c2a3faa531f..8c2dcb767327 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/ThreadUtil.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/ThreadUtil.java @@ -27,7 +27,7 @@ public static void runOnThreadAndShowResult(Activity activity, int progressTitle @Nullable DialogInterface.OnDismissListener onResultDismiss) { Resources resources = activity.getResources(); - AlertDialog progressDialog = new AlertDialog.Builder(activity, R.style.DolphinDialogBase) + AlertDialog progressDialog = new AlertDialog.Builder(activity) .create(); progressDialog.setTitle(progressTitle); if (progressMessage != 0) @@ -45,7 +45,7 @@ public static void runOnThreadAndShowResult(Activity activity, int progressTitle if (result != null) { AlertDialog.Builder builder = - new AlertDialog.Builder(activity, R.style.DolphinDialogBase); + new AlertDialog.Builder(activity); builder.setMessage(result); builder.setPositiveButton(R.string.ok, (dialog, i) -> dialog.dismiss()); builder.setOnDismissListener(onResultDismiss); diff --git a/Source/Android/app/src/main/res/layout/fragment_ingame_menu.xml b/Source/Android/app/src/main/res/layout/fragment_ingame_menu.xml index 898adf617980..71dd4b6ad8de 100644 --- a/Source/Android/app/src/main/res/layout/fragment_ingame_menu.xml +++ b/Source/Android/app/src/main/res/layout/fragment_ingame_menu.xml @@ -27,8 +27,7 @@ android:layout_height="0dp" android:layout_weight="1" android:scrollbarSize="8dp" - android:fadeScrollbars="false" - android:theme="@style/InGameScrollView"> + android:fadeScrollbars="false"> - - - - - - - - - - @@ -53,26 +12,7 @@ false - - - - - + - - - - - - diff --git a/Source/Android/app/src/main/res/values/themes.xml b/Source/Android/app/src/main/res/values/themes.xml new file mode 100644 index 000000000000..110242a3022c --- /dev/null +++ b/Source/Android/app/src/main/res/values/themes.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + +