Merge pull request #10725 from t895/theme-merge

Android: App redesign with multi-theme system
This commit is contained in:
JosJuice 2022-09-10 20:08:37 +02:00 committed by GitHub
commit 84507ec420
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
91 changed files with 1707 additions and 1004 deletions

View File

@ -76,19 +76,19 @@
android:name=".features.settings.ui.SettingsActivity" android:name=".features.settings.ui.SettingsActivity"
android:exported="false" android:exported="false"
android:configChanges="orientation|screenSize" android:configChanges="orientation|screenSize"
android:theme="@style/Theme.Dolphin.Settings" android:theme="@style/Theme.Dolphin.Main"
android:label="@string/settings"/> android:label="@string/settings"/>
<activity <activity
android:name=".features.cheats.ui.CheatsActivity" android:name=".features.cheats.ui.CheatsActivity"
android:exported="false" android:exported="false"
android:theme="@style/Theme.Dolphin.Settings" android:theme="@style/Theme.Dolphin.Main"
android:label="@string/cheats"/> android:label="@string/cheats"/>
<activity <activity
android:name=".activities.EmulationActivity" android:name=".activities.EmulationActivity"
android:exported="false" android:exported="false"
android:theme="@style/Theme.Dolphin.Main.Emulation" android:theme="@style/Theme.Dolphin.Main"
android:preferMinimalPostProcessing="true"/> android:preferMinimalPostProcessing="true"/>
<activity <activity
@ -125,7 +125,7 @@
android:name=".activities.UserDataActivity" android:name=".activities.UserDataActivity"
android:exported="false" android:exported="false"
android:label="@string/user_data_submenu" android:label="@string/user_data_submenu"
android:theme="@style/Theme.Dolphin.Settings" /> android:theme="@style/Theme.Dolphin.Main" />
<activity <activity
android:name=".features.riivolution.ui.RiivolutionBootActivity" android:name=".features.riivolution.ui.RiivolutionBootActivity"

View File

@ -10,6 +10,7 @@ import androidx.appcompat.app.AppCompatActivity;
import org.dolphinemu.dolphinemu.R; import org.dolphinemu.dolphinemu.R;
import org.dolphinemu.dolphinemu.fragments.ConvertFragment; import org.dolphinemu.dolphinemu.fragments.ConvertFragment;
import org.dolphinemu.dolphinemu.utils.ThemeHelper;
public class ConvertActivity extends AppCompatActivity public class ConvertActivity extends AppCompatActivity
{ {
@ -25,6 +26,8 @@ public class ConvertActivity extends AppCompatActivity
@Override @Override
protected void onCreate(Bundle savedInstanceState) protected void onCreate(Bundle savedInstanceState)
{ {
ThemeHelper.setTheme(this);
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_convert); setContentView(R.layout.activity_convert);

View File

@ -19,14 +19,12 @@ import android.view.MenuItem;
import android.view.MotionEvent; import android.view.MotionEvent;
import android.view.View; import android.view.View;
import android.view.WindowManager; import android.view.WindowManager;
import android.widget.SeekBar;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
import androidx.annotation.IntDef; import androidx.annotation.IntDef;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.PopupMenu; import androidx.appcompat.widget.PopupMenu;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
@ -48,12 +46,14 @@ import org.dolphinemu.dolphinemu.fragments.SaveLoadStateFragment;
import org.dolphinemu.dolphinemu.overlay.InputOverlay; import org.dolphinemu.dolphinemu.overlay.InputOverlay;
import org.dolphinemu.dolphinemu.overlay.InputOverlayPointer; import org.dolphinemu.dolphinemu.overlay.InputOverlayPointer;
import org.dolphinemu.dolphinemu.ui.main.MainPresenter; import org.dolphinemu.dolphinemu.ui.main.MainPresenter;
import org.dolphinemu.dolphinemu.ui.main.ThemeProvider;
import org.dolphinemu.dolphinemu.utils.AfterDirectoryInitializationRunner; import org.dolphinemu.dolphinemu.utils.AfterDirectoryInitializationRunner;
import org.dolphinemu.dolphinemu.utils.ControllerMappingHelper; import org.dolphinemu.dolphinemu.utils.ControllerMappingHelper;
import org.dolphinemu.dolphinemu.utils.FileBrowserHelper; import org.dolphinemu.dolphinemu.utils.FileBrowserHelper;
import org.dolphinemu.dolphinemu.utils.IniFile; import org.dolphinemu.dolphinemu.utils.IniFile;
import org.dolphinemu.dolphinemu.utils.MotionListener; import org.dolphinemu.dolphinemu.utils.MotionListener;
import org.dolphinemu.dolphinemu.utils.Rumble; import org.dolphinemu.dolphinemu.utils.Rumble;
import org.dolphinemu.dolphinemu.utils.ThemeHelper;
import java.io.File; import java.io.File;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
@ -61,7 +61,11 @@ import java.util.List;
import static java.lang.annotation.RetentionPolicy.SOURCE; import static java.lang.annotation.RetentionPolicy.SOURCE;
public final class EmulationActivity extends AppCompatActivity import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.google.android.material.slider.LabelFormatter;
import com.google.android.material.slider.Slider;
public final class EmulationActivity extends AppCompatActivity implements ThemeProvider
{ {
private static final String BACKSTACK_NAME_MENU = "menu"; private static final String BACKSTACK_NAME_MENU = "menu";
private static final String BACKSTACK_NAME_SUBMENU = "submenu"; private static final String BACKSTACK_NAME_SUBMENU = "submenu";
@ -74,6 +78,8 @@ public final class EmulationActivity extends AppCompatActivity
private Settings mSettings; private Settings mSettings;
private int mThemeId;
private boolean mMenuVisible; private boolean mMenuVisible;
private static boolean sIgnoreLaunchRequests = false; private static boolean sIgnoreLaunchRequests = false;
@ -193,25 +199,27 @@ public final class EmulationActivity extends AppCompatActivity
!FileBrowserHelper.isPathEmptyOrValid(StringSetting.MAIN_LOAD_PATH) || !FileBrowserHelper.isPathEmptyOrValid(StringSetting.MAIN_LOAD_PATH) ||
!FileBrowserHelper.isPathEmptyOrValid(StringSetting.MAIN_RESOURCEPACK_PATH)) !FileBrowserHelper.isPathEmptyOrValid(StringSetting.MAIN_RESOURCEPACK_PATH))
{ {
AlertDialog.Builder builder = new AlertDialog.Builder(activity); new MaterialAlertDialogBuilder(activity)
builder.setMessage(R.string.unavailable_paths); .setMessage(R.string.unavailable_paths)
builder.setPositiveButton(R.string.yes, (dialogInterface, i) -> .setPositiveButton(R.string.yes,
SettingsActivity.launch(activity, MenuTag.CONFIG_PATHS)); (dialogInterface, i) -> SettingsActivity.launch(activity,
builder.setNeutralButton(R.string.continue_anyway, (dialogInterface, i) -> MenuTag.CONFIG_PATHS))
continueCallback.run()); .setNeutralButton(R.string.continue_anyway,
builder.show(); (dialogInterface, i) -> continueCallback.run())
.show();
} }
else if (!FileBrowserHelper.isPathEmptyOrValid(StringSetting.MAIN_WII_SD_CARD_IMAGE_PATH) || else if (!FileBrowserHelper.isPathEmptyOrValid(StringSetting.MAIN_WII_SD_CARD_IMAGE_PATH) ||
!FileBrowserHelper.isPathEmptyOrValid( !FileBrowserHelper.isPathEmptyOrValid(
StringSetting.MAIN_WII_SD_CARD_SYNC_FOLDER_PATH)) StringSetting.MAIN_WII_SD_CARD_SYNC_FOLDER_PATH))
{ {
AlertDialog.Builder builder = new AlertDialog.Builder(activity); new MaterialAlertDialogBuilder(activity)
builder.setMessage(R.string.unavailable_paths); .setMessage(R.string.unavailable_paths)
builder.setPositiveButton(R.string.yes, (dialogInterface, i) -> .setPositiveButton(R.string.yes,
SettingsActivity.launch(activity, MenuTag.CONFIG_WII)); (dialogInterface, i) -> SettingsActivity.launch(activity,
builder.setNeutralButton(R.string.continue_anyway, (dialogInterface, i) -> MenuTag.CONFIG_WII))
continueCallback.run()); .setNeutralButton(R.string.continue_anyway,
builder.show(); (dialogInterface, i) -> continueCallback.run())
.show();
} }
else else
{ {
@ -295,6 +303,8 @@ public final class EmulationActivity extends AppCompatActivity
@Override @Override
protected void onCreate(Bundle savedInstanceState) protected void onCreate(Bundle savedInstanceState)
{ {
ThemeHelper.setTheme(this);
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
MainPresenter.skipRescanningLibrary(); MainPresenter.skipRescanningLibrary();
@ -382,6 +392,8 @@ public final class EmulationActivity extends AppCompatActivity
@Override @Override
protected void onResume() protected void onResume()
{ {
ThemeHelper.setCorrectTheme(this);
super.onResume(); super.onResume();
// Only android 9+ support this feature. // Only android 9+ support this feature.
@ -816,8 +828,8 @@ public final class EmulationActivity extends AppCompatActivity
private void toggleControls() private void toggleControls()
{ {
AlertDialog.Builder builder = new AlertDialog.Builder(this); MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(this)
builder.setTitle(R.string.emulation_toggle_controls); .setTitle(R.string.emulation_toggle_controls);
int currentController = InputOverlay.getConfiguredControllerType(this); int currentController = InputOverlay.getConfiguredControllerType(this);
@ -873,17 +885,14 @@ public final class EmulationActivity extends AppCompatActivity
} }
builder.setNeutralButton(R.string.emulation_toggle_all, builder.setNeutralButton(R.string.emulation_toggle_all,
(dialogInterface, i) -> mEmulationFragment.toggleInputOverlayVisibility(mSettings)); (dialogInterface, i) -> mEmulationFragment.toggleInputOverlayVisibility(mSettings))
builder.setPositiveButton(R.string.ok, (dialogInterface, i) -> .setPositiveButton(R.string.ok, (dialogInterface, i) ->
mEmulationFragment.refreshInputOverlay()); mEmulationFragment.refreshInputOverlay())
.show();
builder.show();
} }
public void chooseDoubleTapButton() public void chooseDoubleTapButton()
{ {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
int currentValue = IntSetting.MAIN_DOUBLE_TAP_BUTTON.getInt(mSettings); int currentValue = IntSetting.MAIN_DOUBLE_TAP_BUTTON.getInt(mSettings);
int buttonList = InputOverlay.getConfiguredControllerType(this) == int buttonList = InputOverlay.getConfiguredControllerType(this) ==
@ -900,14 +909,13 @@ public final class EmulationActivity extends AppCompatActivity
} }
} }
builder.setSingleChoiceItems(buttonList, checkedItem, new MaterialAlertDialogBuilder(this)
(DialogInterface dialog, int which) -> IntSetting.MAIN_DOUBLE_TAP_BUTTON .setSingleChoiceItems(buttonList, checkedItem,
.setInt(mSettings, InputOverlayPointer.DOUBLE_TAP_OPTIONS.get(which))); (DialogInterface dialog, int which) -> IntSetting.MAIN_DOUBLE_TAP_BUTTON.setInt(
mSettings, InputOverlayPointer.DOUBLE_TAP_OPTIONS.get(which)))
builder.setPositiveButton(R.string.ok, (dialogInterface, i) -> .setPositiveButton(R.string.ok,
mEmulationFragment.initInputPointer()); (dialogInterface, i) -> mEmulationFragment.initInputPointer())
.show();
builder.show();
} }
private void adjustScale() private void adjustScale()
@ -915,130 +923,96 @@ public final class EmulationActivity extends AppCompatActivity
LayoutInflater inflater = LayoutInflater.from(this); LayoutInflater inflater = LayoutInflater.from(this);
View view = inflater.inflate(R.layout.dialog_input_adjust, null); View view = inflater.inflate(R.layout.dialog_input_adjust, null);
final SeekBar scaleSeekbar = view.findViewById(R.id.input_scale_seekbar); final Slider scaleSlider = view.findViewById(R.id.input_scale_slider);
final TextView scaleValue = view.findViewById(R.id.input_scale_value); final TextView scaleValue = view.findViewById(R.id.input_scale_value);
scaleSlider.setValueTo(150);
scaleSeekbar.setMax(150); scaleSlider.setValue(IntSetting.MAIN_CONTROL_SCALE.getInt(mSettings));
scaleSeekbar.setProgress(IntSetting.MAIN_CONTROL_SCALE.getInt(mSettings)); scaleSlider.setStepSize(1);
scaleSeekbar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() scaleSlider.addOnChangeListener(
{ (slider, progress, fromUser) -> scaleValue.setText(((int) progress + 50) + "%"));
public void onStartTrackingTouch(SeekBar seekBar) scaleValue.setText(((int) scaleSlider.getValue() + 50) + "%");
{
// Do nothing
}
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser)
{
scaleValue.setText((progress + 50) + "%");
}
public void onStopTrackingTouch(SeekBar seekBar)
{
// Do nothing
}
});
scaleValue.setText((scaleSeekbar.getProgress() + 50) + "%");
// alpha // alpha
final SeekBar seekbarOpacity = view.findViewById(R.id.input_opacity_seekbar); final Slider sliderOpacity = view.findViewById(R.id.input_opacity_slider);
final TextView valueOpacity = view.findViewById(R.id.input_opacity_value); final TextView valueOpacity = view.findViewById(R.id.input_opacity_value);
sliderOpacity.setValueTo(100);
sliderOpacity.setValue(IntSetting.MAIN_CONTROL_OPACITY.getInt(mSettings));
sliderOpacity.setStepSize(1);
sliderOpacity.addOnChangeListener(
(slider, progress, fromUser) -> valueOpacity.setText(((int) progress) + "%"));
valueOpacity.setText(((int) sliderOpacity.getValue()) + "%");
seekbarOpacity.setMax(100);
seekbarOpacity.setProgress(IntSetting.MAIN_CONTROL_OPACITY.getInt(mSettings));
seekbarOpacity.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener()
{
public void onStartTrackingTouch(SeekBar seekBar)
{
// Do nothing
}
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) new MaterialAlertDialogBuilder(this)
{ .setTitle(R.string.emulation_control_adjustments)
valueOpacity.setText(progress + "%"); .setView(view)
} .setPositiveButton(R.string.ok, (dialog, which) ->
{
public void onStopTrackingTouch(SeekBar seekBar) IntSetting.MAIN_CONTROL_SCALE.setInt(mSettings, (int) scaleSlider.getValue());
{ IntSetting.MAIN_CONTROL_OPACITY.setInt(mSettings, (int) sliderOpacity.getValue());
// Do nothing mEmulationFragment.refreshInputOverlay();
} })
}); .setNeutralButton(R.string.default_values, (dialog, which) ->
valueOpacity.setText(seekbarOpacity.getProgress() + "%"); {
IntSetting.MAIN_CONTROL_SCALE.delete(mSettings);
AlertDialog.Builder builder = new AlertDialog.Builder(this); IntSetting.MAIN_CONTROL_OPACITY.delete(mSettings);
builder.setTitle(R.string.emulation_control_adjustments); mEmulationFragment.refreshInputOverlay();
builder.setView(view); })
builder.setPositiveButton(R.string.ok, (dialogInterface, i) -> .show();
{
IntSetting.MAIN_CONTROL_SCALE.setInt(mSettings, scaleSeekbar.getProgress());
IntSetting.MAIN_CONTROL_OPACITY.setInt(mSettings, seekbarOpacity.getProgress());
mEmulationFragment.refreshInputOverlay();
});
builder.setNeutralButton(R.string.default_values, (dialogInterface, i) ->
{
IntSetting.MAIN_CONTROL_SCALE.delete(mSettings);
IntSetting.MAIN_CONTROL_OPACITY.delete(mSettings);
mEmulationFragment.refreshInputOverlay();
});
builder.show();
} }
private void chooseController() private void chooseController()
{ {
final SharedPreferences.Editor editor = mPreferences.edit(); final SharedPreferences.Editor editor = mPreferences.edit();
AlertDialog.Builder builder = new AlertDialog.Builder(this); new MaterialAlertDialogBuilder(this)
builder.setTitle(R.string.emulation_choose_controller); .setTitle(R.string.emulation_choose_controller)
builder.setSingleChoiceItems(R.array.controllersEntries, .setSingleChoiceItems(R.array.controllersEntries,
InputOverlay.getConfiguredControllerType(this), InputOverlay.getConfiguredControllerType(this),
(dialog, indexSelected) -> (dialog, indexSelected) ->
{
editor.putInt("wiiController", indexSelected);
updateWiimoteNewController(indexSelected, this);
NativeLibrary.ReloadWiimoteConfig();
})
.setPositiveButton(R.string.ok, (dialogInterface, i) ->
{ {
editor.putInt("wiiController", indexSelected); editor.apply();
mEmulationFragment.refreshInputOverlay();
updateWiimoteNewController(indexSelected, this); })
NativeLibrary.ReloadWiimoteConfig(); .show();
});
builder.setPositiveButton(R.string.ok, (dialogInterface, i) ->
{
editor.apply();
mEmulationFragment.refreshInputOverlay();
});
builder.show();
} }
private void showMotionControlsOptions() private void showMotionControlsOptions()
{ {
AlertDialog.Builder builder = new AlertDialog.Builder(this); new MaterialAlertDialogBuilder(this)
builder.setTitle(R.string.emulation_motion_controls); .setTitle(R.string.emulation_motion_controls)
builder.setSingleChoiceItems(R.array.motionControlsEntries, .setSingleChoiceItems(R.array.motionControlsEntries,
IntSetting.MAIN_MOTION_CONTROLS.getInt(mSettings), IntSetting.MAIN_MOTION_CONTROLS.getInt(mSettings),
(dialog, indexSelected) -> (dialog, indexSelected) ->
{ {
IntSetting.MAIN_MOTION_CONTROLS.setInt(mSettings, indexSelected); IntSetting.MAIN_MOTION_CONTROLS.setInt(mSettings, indexSelected);
updateMotionListener(); updateMotionListener();
updateWiimoteNewImuIr(indexSelected); updateWiimoteNewImuIr(indexSelected);
NativeLibrary.ReloadWiimoteConfig(); NativeLibrary.ReloadWiimoteConfig();
}); })
builder.setPositiveButton(R.string.ok, (dialogInterface, i) -> dialogInterface.dismiss()); .setPositiveButton(R.string.ok, (dialogInterface, i) -> dialogInterface.dismiss())
.show();
builder.show();
} }
private void setIRMode() private void setIRMode()
{ {
AlertDialog.Builder builder = new AlertDialog.Builder(this); new MaterialAlertDialogBuilder(this)
builder.setTitle(R.string.emulation_ir_mode); .setTitle(R.string.emulation_ir_mode)
builder.setSingleChoiceItems(R.array.irModeEntries, .setSingleChoiceItems(R.array.irModeEntries,
IntSetting.MAIN_IR_MODE.getInt(mSettings), IntSetting.MAIN_IR_MODE.getInt(mSettings),
(dialog, indexSelected) -> (dialog, indexSelected) ->
IntSetting.MAIN_IR_MODE.setInt(mSettings, indexSelected)); IntSetting.MAIN_IR_MODE.setInt(mSettings, indexSelected))
builder.setPositiveButton(R.string.ok, (dialogInterface, i) -> .setPositiveButton(R.string.ok, (dialogInterface, i) ->
mEmulationFragment.refreshOverlayPointer(mSettings)); mEmulationFragment.refreshOverlayPointer(mSettings))
.show();
builder.show();
} }
private void setIRSensitivity() private void setIRSensitivity()
@ -1054,59 +1028,30 @@ public final class EmulationActivity extends AppCompatActivity
TextView text_slider_value_pitch = view.findViewById(R.id.text_ir_pitch); TextView text_slider_value_pitch = view.findViewById(R.id.text_ir_pitch);
TextView units = view.findViewById(R.id.text_ir_pitch_units); TextView units = view.findViewById(R.id.text_ir_pitch_units);
SeekBar seekbar_pitch = view.findViewById(R.id.seekbar_pitch); Slider slider_pitch = view.findViewById(R.id.slider_pitch);
text_slider_value_pitch.setText(String.valueOf(ir_pitch)); text_slider_value_pitch.setText(String.valueOf(ir_pitch));
units.setText(getString(R.string.pitch)); units.setText(getString(R.string.pitch));
seekbar_pitch.setMax(100); slider_pitch.setValueTo(100);
seekbar_pitch.setProgress(ir_pitch); slider_pitch.setValue(ir_pitch);
seekbar_pitch.setKeyProgressIncrement(5); slider_pitch.setStepSize(1);
seekbar_pitch.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() slider_pitch.addOnChangeListener(
{ (slider, progress, fromUser) -> text_slider_value_pitch.setText(
@Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) String.valueOf((int) progress)));
{
text_slider_value_pitch.setText(String.valueOf(progress));
}
@Override public void onStartTrackingTouch(SeekBar seekBar)
{
// Do nothing
}
@Override public void onStopTrackingTouch(SeekBar seekBar)
{
// Do nothing
}
});
int ir_yaw = ini.getInt(Settings.SECTION_CONTROLS, SettingsFile.KEY_WIIBIND_IR_YAW, 25); int ir_yaw = ini.getInt(Settings.SECTION_CONTROLS, SettingsFile.KEY_WIIBIND_IR_YAW, 25);
TextView text_slider_value_yaw = view.findViewById(R.id.text_ir_yaw); TextView text_slider_value_yaw = view.findViewById(R.id.text_ir_yaw);
TextView units_yaw = view.findViewById(R.id.text_ir_yaw_units); TextView units_yaw = view.findViewById(R.id.text_ir_yaw_units);
SeekBar seekbar_yaw = view.findViewById(R.id.seekbar_width); Slider seekbar_yaw = view.findViewById(R.id.slider_width);
text_slider_value_yaw.setText(String.valueOf(ir_yaw)); text_slider_value_yaw.setText(String.valueOf(ir_yaw));
units_yaw.setText(getString(R.string.yaw)); units_yaw.setText(getString(R.string.yaw));
seekbar_yaw.setMax(100); seekbar_yaw.setValueTo(100);
seekbar_yaw.setProgress(ir_yaw); seekbar_yaw.setValue(ir_yaw);
seekbar_yaw.setKeyProgressIncrement(5); seekbar_yaw.setStepSize(1);
seekbar_yaw.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() seekbar_yaw.addOnChangeListener((slider, progress, fromUser) -> text_slider_value_yaw.setText(
{ String.valueOf((int) progress)));
@Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser)
{
text_slider_value_yaw.setText(String.valueOf(progress));
}
@Override public void onStartTrackingTouch(SeekBar seekBar)
{
// Do nothing
}
@Override public void onStopTrackingTouch(SeekBar seekBar)
{
// Do nothing
}
});
int ir_vertical_offset = int ir_vertical_offset =
@ -1114,71 +1059,52 @@ public final class EmulationActivity extends AppCompatActivity
TextView text_slider_value_vertical_offset = view.findViewById(R.id.text_ir_vertical_offset); TextView text_slider_value_vertical_offset = view.findViewById(R.id.text_ir_vertical_offset);
TextView units_vertical_offset = view.findViewById(R.id.text_ir_vertical_offset_units); TextView units_vertical_offset = view.findViewById(R.id.text_ir_vertical_offset_units);
SeekBar seekbar_vertical_offset = view.findViewById(R.id.seekbar_vertical_offset); Slider seekbar_vertical_offset = view.findViewById(R.id.slider_vertical_offset);
text_slider_value_vertical_offset.setText(String.valueOf(ir_vertical_offset)); text_slider_value_vertical_offset.setText(String.valueOf(ir_vertical_offset));
units_vertical_offset.setText(getString(R.string.vertical_offset)); units_vertical_offset.setText(getString(R.string.vertical_offset));
seekbar_vertical_offset.setMax(100); seekbar_vertical_offset.setValueTo(100);
seekbar_vertical_offset.setProgress(ir_vertical_offset); seekbar_vertical_offset.setValue(ir_vertical_offset);
seekbar_vertical_offset.setKeyProgressIncrement(5); seekbar_vertical_offset.setStepSize(1);
seekbar_vertical_offset.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() seekbar_vertical_offset.addOnChangeListener(
{ (slider, progress, fromUser) -> text_slider_value_vertical_offset.setText(
@Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) String.valueOf((int) progress)));
{
text_slider_value_vertical_offset.setText(String.valueOf(progress));
}
@Override public void onStartTrackingTouch(SeekBar seekBar) new MaterialAlertDialogBuilder(this)
{ .setTitle(getString(R.string.emulation_ir_sensitivity))
// Do nothing .setView(view)
} .setPositiveButton(R.string.ok, (dialogInterface, i) ->
{
ini.setString(Settings.SECTION_CONTROLS, SettingsFile.KEY_WIIBIND_IR_PITCH,
text_slider_value_pitch.getText().toString());
ini.setString(Settings.SECTION_CONTROLS, SettingsFile.KEY_WIIBIND_IR_YAW,
text_slider_value_yaw.getText().toString());
ini.setString(Settings.SECTION_CONTROLS, SettingsFile.KEY_WIIBIND_IR_VERTICAL_OFFSET,
text_slider_value_vertical_offset.getText().toString());
ini.save(file);
@Override public void onStopTrackingTouch(SeekBar seekBar) NativeLibrary.ReloadWiimoteConfig();
{ })
// Do nothing .setNegativeButton(R.string.cancel, null)
} .setNeutralButton(R.string.default_values, (dialogInterface, i) ->
}); {
ini.deleteKey(Settings.SECTION_CONTROLS, SettingsFile.KEY_WIIBIND_IR_PITCH);
ini.deleteKey(Settings.SECTION_CONTROLS, SettingsFile.KEY_WIIBIND_IR_YAW);
ini.deleteKey(Settings.SECTION_CONTROLS, SettingsFile.KEY_WIIBIND_IR_VERTICAL_OFFSET);
ini.save(file);
AlertDialog.Builder builder = new AlertDialog.Builder(this); NativeLibrary.ReloadWiimoteConfig();
builder.setTitle(getString(R.string.emulation_ir_sensitivity)); })
builder.setView(view); .show();
builder.setPositiveButton(R.string.ok, (dialogInterface, i) ->
{
ini.setString(Settings.SECTION_CONTROLS, SettingsFile.KEY_WIIBIND_IR_PITCH,
text_slider_value_pitch.getText().toString());
ini.setString(Settings.SECTION_CONTROLS, SettingsFile.KEY_WIIBIND_IR_YAW,
text_slider_value_yaw.getText().toString());
ini.setString(Settings.SECTION_CONTROLS, SettingsFile.KEY_WIIBIND_IR_VERTICAL_OFFSET,
text_slider_value_vertical_offset.getText().toString());
ini.save(file);
NativeLibrary.ReloadWiimoteConfig();
});
builder.setNegativeButton(R.string.cancel, (dialogInterface, i) ->
{
// Do nothing
});
builder.setNeutralButton(R.string.default_values, (dialogInterface, i) ->
{
ini.deleteKey(Settings.SECTION_CONTROLS, SettingsFile.KEY_WIIBIND_IR_PITCH);
ini.deleteKey(Settings.SECTION_CONTROLS, SettingsFile.KEY_WIIBIND_IR_YAW);
ini.deleteKey(Settings.SECTION_CONTROLS, SettingsFile.KEY_WIIBIND_IR_VERTICAL_OFFSET);
ini.save(file);
NativeLibrary.ReloadWiimoteConfig();
});
builder.show();
} }
private void resetOverlay() private void resetOverlay()
{ {
new AlertDialog.Builder(this) new MaterialAlertDialogBuilder(this)
.setTitle(getString(R.string.emulation_touch_overlay_reset)) .setTitle(getString(R.string.emulation_touch_overlay_reset))
.setPositiveButton(R.string.yes, (dialogInterface, i) -> .setPositiveButton(R.string.yes,
mEmulationFragment.resetInputOverlay()) (dialogInterface, i) -> mEmulationFragment.resetInputOverlay())
.setNegativeButton(R.string.cancel, (dialogInterface, i) -> .setNegativeButton(R.string.cancel, null)
{
})
.show(); .show();
} }
@ -1300,4 +1226,17 @@ public final class EmulationActivity extends AppCompatActivity
{ {
mEmulationFragment.initInputPointer(); mEmulationFragment.initInputPointer();
} }
@Override
public void setTheme(int themeId)
{
super.setTheme(themeId);
this.mThemeId = themeId;
}
@Override
public int getThemeId()
{
return mThemeId;
}
} }

View File

@ -14,12 +14,15 @@ import android.widget.Button;
import android.widget.TextView; import android.widget.TextView;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import org.dolphinemu.dolphinemu.R; import org.dolphinemu.dolphinemu.R;
import org.dolphinemu.dolphinemu.utils.DirectoryInitialization; import org.dolphinemu.dolphinemu.utils.DirectoryInitialization;
import org.dolphinemu.dolphinemu.utils.Log; import org.dolphinemu.dolphinemu.utils.Log;
import org.dolphinemu.dolphinemu.utils.ThemeHelper;
import org.dolphinemu.dolphinemu.utils.ThreadUtil; import org.dolphinemu.dolphinemu.utils.ThreadUtil;
import java.io.File; import java.io.File;
@ -50,6 +53,8 @@ public class UserDataActivity extends AppCompatActivity
@Override @Override
protected void onCreate(Bundle savedInstanceState) protected void onCreate(Bundle savedInstanceState)
{ {
ThemeHelper.setTheme(this);
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_user_data); setContentView(R.layout.activity_user_data);
@ -80,7 +85,8 @@ public class UserDataActivity extends AppCompatActivity
buttonExportUserData.setOnClickListener(view -> exportUserData()); buttonExportUserData.setOnClickListener(view -> exportUserData());
// show up button Toolbar tb = findViewById(R.id.toolbar_user_data);
setSupportActionBar(tb);
getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(true);
} }
@ -100,26 +106,25 @@ public class UserDataActivity extends AppCompatActivity
{ {
Uri uri = data.getData(); Uri uri = data.getData();
AlertDialog.Builder builder = new AlertDialog.Builder(this); new MaterialAlertDialogBuilder(this)
.setMessage(R.string.user_data_import_warning)
.setNegativeButton(R.string.no, (dialog, i) -> dialog.dismiss())
.setPositiveButton(R.string.yes, (dialog, i) ->
{
dialog.dismiss();
builder.setMessage(R.string.user_data_import_warning); ThreadUtil.runOnThreadAndShowResult(this, R.string.import_in_progress,
builder.setNegativeButton(R.string.no, (dialog, i) -> dialog.dismiss()); R.string.do_not_close_app,
builder.setPositiveButton(R.string.yes, (dialog, i) -> () -> getResources().getString(importUserData(uri)),
{ (dialogInterface) ->
dialog.dismiss(); {
if (sMustRestartApp)
ThreadUtil.runOnThreadAndShowResult(this, R.string.import_in_progress, {
R.string.do_not_close_app, () -> getResources().getString(importUserData(uri)), System.exit(0);
(dialogInterface) -> }
{ });
if (sMustRestartApp) })
{ .show();
System.exit(0);
}
});
});
builder.show();
} }
else if (requestCode == REQUEST_CODE_EXPORT && resultCode == Activity.RESULT_OK) else if (requestCode == REQUEST_CODE_EXPORT && resultCode == Activity.RESULT_OK)
{ {
@ -148,7 +153,7 @@ public class UserDataActivity extends AppCompatActivity
{ {
// Activity not found. Perhaps it was removed by the OEM, or by some new Android version // 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 // that didn't exist at the time of writing. Not much we can do other than tell the user
new AlertDialog.Builder(this) new MaterialAlertDialogBuilder(this)
.setMessage(R.string.user_data_open_system_file_manager_failed) .setMessage(R.string.user_data_open_system_file_manager_failed)
.setPositiveButton(R.string.ok, null) .setPositiveButton(R.string.ok, null)
.show(); .show();

View File

@ -62,7 +62,8 @@ public class PlatformPagerAdapter extends FragmentPagerAdapter
// Apparently a workaround for TabLayout not supporting icons. // Apparently a workaround for TabLayout not supporting icons.
// TODO: This workaround will eventually not be necessary; switch to more legit methods when that is the case // TODO: This workaround will eventually not be necessary; switch to more legit methods when that is the case
// TODO: Also remove additional hax from styles.xml // TODO: Also remove additional hax from styles.xml
Drawable drawable = mContext.getResources().getDrawable(TAB_ICONS[position]); Drawable drawable =
mContext.getResources().getDrawable(TAB_ICONS[position], mContext.getTheme());
drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight()); drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());
ImageSpan imageSpan = new ImageSpan(drawable, ImageSpan.ALIGN_BOTTOM); ImageSpan imageSpan = new ImageSpan(drawable, ImageSpan.ALIGN_BOTTOM);

View File

@ -6,9 +6,10 @@ import android.app.Dialog;
import android.os.Bundle; import android.os.Bundle;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.DialogFragment; import androidx.fragment.app.DialogFragment;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import org.dolphinemu.dolphinemu.NativeLibrary; import org.dolphinemu.dolphinemu.NativeLibrary;
import org.dolphinemu.dolphinemu.R; import org.dolphinemu.dolphinemu.R;
import org.dolphinemu.dolphinemu.activities.EmulationActivity; import org.dolphinemu.dolphinemu.activities.EmulationActivity;
@ -47,7 +48,7 @@ public final class AlertMessage extends DialogFragment
boolean isWarning = requireArguments().getBoolean(ARG_IS_WARNING); boolean isWarning = requireArguments().getBoolean(ARG_IS_WARNING);
setCancelable(false); setCancelable(false);
AlertDialog.Builder builder = new AlertDialog.Builder(emulationActivity) MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(emulationActivity)
.setTitle(title) .setTitle(title)
.setMessage(message); .setMessage(message);

View File

@ -9,9 +9,10 @@ import android.view.ViewGroup;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.DialogFragment; import androidx.fragment.app.DialogFragment;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import org.dolphinemu.dolphinemu.NativeLibrary; import org.dolphinemu.dolphinemu.NativeLibrary;
import org.dolphinemu.dolphinemu.R; import org.dolphinemu.dolphinemu.R;
import org.dolphinemu.dolphinemu.model.GameFile; import org.dolphinemu.dolphinemu.model.GameFile;
@ -38,7 +39,6 @@ public final class GameDetailsDialog extends DialogFragment
{ {
GameFile gameFile = GameFileCacheManager.addOrGet(getArguments().getString(ARG_GAME_PATH)); GameFile gameFile = GameFileCacheManager.addOrGet(getArguments().getString(ARG_GAME_PATH));
AlertDialog.Builder builder = new AlertDialog.Builder(requireActivity());
ViewGroup contents = (ViewGroup) getActivity().getLayoutInflater() ViewGroup contents = (ViewGroup) getActivity().getLayoutInflater()
.inflate(R.layout.dialog_game_details, null); .inflate(R.layout.dialog_game_details, null);
@ -116,7 +116,8 @@ public final class GameDetailsDialog extends DialogFragment
PicassoUtils.loadGameBanner(banner, gameFile); PicassoUtils.loadGameBanner(banner, gameFile);
builder.setView(contents); return new MaterialAlertDialogBuilder(requireActivity())
return builder.create(); .setView(contents)
.create();
} }
} }

View File

@ -8,9 +8,10 @@ import android.os.Bundle;
import android.widget.Toast; import android.widget.Toast;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.DialogFragment; import androidx.fragment.app.DialogFragment;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import org.dolphinemu.dolphinemu.DolphinApplication; import org.dolphinemu.dolphinemu.DolphinApplication;
import org.dolphinemu.dolphinemu.R; import org.dolphinemu.dolphinemu.R;
import org.dolphinemu.dolphinemu.activities.ConvertActivity; import org.dolphinemu.dolphinemu.activities.ConvertActivity;
@ -117,16 +118,16 @@ public class GamePropertiesDialog extends DialogFragment
itemsBuilder.add(R.string.properties_clear_game_settings, (dialog, i) -> itemsBuilder.add(R.string.properties_clear_game_settings, (dialog, i) ->
clearGameSettingsWithConfirmation(gameId)); clearGameSettingsWithConfirmation(gameId));
AlertDialog.Builder builder = new AlertDialog.Builder(requireContext()); MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(requireContext())
.setTitle(requireContext()
.getString(R.string.preferences_game_properties_with_game_id, gameId));
itemsBuilder.applyToBuilder(builder); itemsBuilder.applyToBuilder(builder);
builder.setTitle(requireContext()
.getString(R.string.preferences_game_properties_with_game_id, gameId));
return builder.create(); return builder.create();
} }
private void clearGameSettingsWithConfirmation(String gameId) private void clearGameSettingsWithConfirmation(String gameId)
{ {
new AlertDialog.Builder(requireContext()) new MaterialAlertDialogBuilder(requireContext())
.setTitle(R.string.properties_clear_game_settings) .setTitle(R.string.properties_clear_game_settings)
.setMessage(R.string.properties_clear_game_settings_confirmation) .setMessage(R.string.properties_clear_game_settings_confirmation)
.setPositiveButton(R.string.yes, (dialog, i) -> clearGameSettings(gameId)) .setPositiveButton(R.string.yes, (dialog, i) -> clearGameSettings(gameId))

View File

@ -3,13 +3,29 @@
package org.dolphinemu.dolphinemu.dialogs; package org.dolphinemu.dolphinemu.dialogs;
import android.content.Context; import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.util.TypedValue;
import android.view.InputDevice; import android.view.InputDevice;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.MotionEvent; import android.view.MotionEvent;
import androidx.annotation.AttrRes;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.StyleRes;
import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.view.ContextThemeWrapper;
import androidx.core.view.ViewCompat;
import com.google.android.material.color.MaterialColors;
import com.google.android.material.dialog.MaterialDialogs;
import com.google.android.material.resources.MaterialAttributes;
import com.google.android.material.shape.MaterialShapeDrawable;
import org.dolphinemu.dolphinemu.R;
import org.dolphinemu.dolphinemu.features.settings.model.view.InputBindingSetting; import org.dolphinemu.dolphinemu.features.settings.model.view.InputBindingSetting;
import org.dolphinemu.dolphinemu.features.settings.ui.SettingsAdapter; import org.dolphinemu.dolphinemu.features.settings.ui.SettingsAdapter;
import org.dolphinemu.dolphinemu.utils.ControllerMappingHelper; import org.dolphinemu.dolphinemu.utils.ControllerMappingHelper;
@ -18,12 +34,20 @@ import org.dolphinemu.dolphinemu.utils.Log;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import static com.google.android.material.theme.overlay.MaterialThemeOverlay.wrap;
/** /**
* {@link AlertDialog} derivative that listens for * {@link AlertDialog} derivative that listens for
* motion events from controllers and joysticks. * motion events from controllers and joysticks.
*/ */
public final class MotionAlertDialog extends AlertDialog public final class MotionAlertDialog extends AlertDialog
{ {
@AttrRes private static final int DEF_STYLE_ATTR = R.attr.alertDialogStyle;
@StyleRes private static final int DEF_STYLE_RES = R.style.MaterialAlertDialog_MaterialComponents;
@AttrRes
private static final int MATERIAL_ALERT_DIALOG_THEME_OVERLAY = R.attr.materialAlertDialogTheme;
// The selected input preference // The selected input preference
private final InputBindingSetting setting; private final InputBindingSetting setting;
private final ArrayList<Float> mPreviousValues = new ArrayList<>(); private final ArrayList<Float> mPreviousValues = new ArrayList<>();
@ -39,10 +63,63 @@ public final class MotionAlertDialog extends AlertDialog
*/ */
public MotionAlertDialog(Context context, InputBindingSetting setting, SettingsAdapter adapter) public MotionAlertDialog(Context context, InputBindingSetting setting, SettingsAdapter adapter)
{ {
super(context); super(createMaterialAlertDialogThemedContext(context));
this.setting = setting; this.setting = setting;
mAdapter = adapter; mAdapter = adapter;
// Using code from MaterialAlertDialogBuilder allows us to nearly perfectly recreate its look
context = getContext();
Resources.Theme theme = context.getTheme();
int surfaceColor =
MaterialColors.getColor(context, R.attr.colorSurface, getClass().getCanonicalName());
MaterialShapeDrawable materialShapeDrawable =
new MaterialShapeDrawable(context, null, R.attr.alertDialogStyle,
R.style.MaterialAlertDialog_MaterialComponents);
materialShapeDrawable.initializeElevationOverlay(context);
materialShapeDrawable.setFillColor(ColorStateList.valueOf(surfaceColor));
materialShapeDrawable.setElevation(ViewCompat.getElevation(this.getWindow().getDecorView()));
this.getWindow().setBackgroundDrawable(materialShapeDrawable);
Rect backgroundInsets =
MaterialDialogs.getDialogBackgroundInsets(context, R.attr.alertDialogStyle,
R.style.MaterialAlertDialog_MaterialComponents);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P)
{
TypedValue dialogCornerRadiusValue = new TypedValue();
theme.resolveAttribute(android.R.attr.dialogCornerRadius, dialogCornerRadiusValue, true);
float dialogCornerRadius =
dialogCornerRadiusValue.getDimension(context.getResources().getDisplayMetrics());
if (dialogCornerRadiusValue.type == TypedValue.TYPE_DIMENSION && dialogCornerRadius >= 0)
{
materialShapeDrawable.setCornerSize(dialogCornerRadius);
}
}
Drawable insetDrawable = MaterialDialogs.insetDrawable(materialShapeDrawable, backgroundInsets);
this.getWindow().setBackgroundDrawable(insetDrawable);
}
private static Context createMaterialAlertDialogThemedContext(@NonNull Context context)
{
int themeOverlayId = getMaterialAlertDialogThemeOverlay(context);
Context themedContext = wrap(context, null, DEF_STYLE_ATTR, DEF_STYLE_RES);
if (themeOverlayId == 0)
{
return themedContext;
}
return new ContextThemeWrapper(themedContext, themeOverlayId);
}
private static int getMaterialAlertDialogThemeOverlay(@NonNull Context context)
{
TypedValue materialAlertDialogThemeOverlay =
MaterialAttributes.resolve(context, MATERIAL_ALERT_DIALOG_THEME_OVERLAY);
if (materialAlertDialogThemeOverlay == null)
{
return 0;
}
return materialAlertDialogThemeOverlay.data;
} }
public boolean onKeyEvent(int keyCode, KeyEvent event) public boolean onKeyEvent(int keyCode, KeyEvent event)

View File

@ -7,16 +7,17 @@ import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.Button; import android.widget.Button;
import android.widget.EditText;
import android.widget.ScrollView; import android.widget.ScrollView;
import android.widget.TextView;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProvider; import androidx.lifecycle.ViewModelProvider;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.google.android.material.textfield.TextInputEditText;
import com.google.android.material.textfield.TextInputLayout;
import org.dolphinemu.dolphinemu.R; import org.dolphinemu.dolphinemu.R;
import org.dolphinemu.dolphinemu.features.cheats.model.Cheat; import org.dolphinemu.dolphinemu.features.cheats.model.Cheat;
import org.dolphinemu.dolphinemu.features.cheats.model.CheatsViewModel; import org.dolphinemu.dolphinemu.features.cheats.model.CheatsViewModel;
@ -25,14 +26,14 @@ public class CheatDetailsFragment extends Fragment
{ {
private View mRoot; private View mRoot;
private ScrollView mScrollView; private ScrollView mScrollView;
private TextView mLabelName; private TextInputLayout mEditNameLayout;
private EditText mEditName; private TextInputEditText mEditName;
private TextView mLabelCreator; private TextInputLayout mEditCreatorLayout;
private EditText mEditCreator; private TextInputEditText mEditCreator;
private TextView mLabelNotes; private TextInputLayout mEditNotesLayout;
private EditText mEditNotes; private TextInputEditText mEditNotes;
private TextView mLabelCode; private TextInputLayout mEditCodeLayout;
private EditText mEditCode; private TextInputEditText mEditCode;
private Button mButtonDelete; private Button mButtonDelete;
private Button mButtonEdit; private Button mButtonEdit;
private Button mButtonCancel; private Button mButtonCancel;
@ -54,14 +55,14 @@ public class CheatDetailsFragment extends Fragment
{ {
mRoot = view.findViewById(R.id.root); mRoot = view.findViewById(R.id.root);
mScrollView = view.findViewById(R.id.scroll_view); mScrollView = view.findViewById(R.id.scroll_view);
mLabelName = view.findViewById(R.id.label_name); mEditNameLayout = view.findViewById(R.id.edit_name);
mEditName = view.findViewById(R.id.edit_name); mEditName = view.findViewById(R.id.edit_name_input);
mLabelCreator = view.findViewById(R.id.label_creator); mEditCreatorLayout = view.findViewById(R.id.edit_creator);
mEditCreator = view.findViewById(R.id.edit_creator); mEditCreator = view.findViewById(R.id.edit_creator_input);
mLabelNotes = view.findViewById(R.id.label_notes); mEditNotesLayout = view.findViewById(R.id.edit_notes);
mEditNotes = view.findViewById(R.id.edit_notes); mEditNotes = view.findViewById(R.id.edit_notes_input);
mLabelCode = view.findViewById(R.id.label_code); mEditCodeLayout = view.findViewById(R.id.edit_code);
mEditCode = view.findViewById(R.id.edit_code); mEditCode = view.findViewById(R.id.edit_code_input);
mButtonDelete = view.findViewById(R.id.button_delete); mButtonDelete = view.findViewById(R.id.button_delete);
mButtonEdit = view.findViewById(R.id.button_edit); mButtonEdit = view.findViewById(R.id.button_edit);
mButtonCancel = view.findViewById(R.id.button_cancel); mButtonCancel = view.findViewById(R.id.button_cancel);
@ -84,18 +85,17 @@ public class CheatDetailsFragment extends Fragment
private void clearEditErrors() private void clearEditErrors()
{ {
mEditName.setError(null); mEditNameLayout.setError(null);
mEditCode.setError(null); mEditCodeLayout.setError(null);
} }
private void onDeleteClicked(View view) private void onDeleteClicked(View view)
{ {
AlertDialog.Builder builder = new MaterialAlertDialogBuilder(requireContext())
new AlertDialog.Builder(requireContext()); .setMessage(getString(R.string.cheats_delete_confirmation, mCheat.getName()))
builder.setMessage(getString(R.string.cheats_delete_confirmation, mCheat.getName())); .setPositiveButton(R.string.yes, (dialog, i) -> mViewModel.deleteSelectedCheat())
builder.setPositiveButton(R.string.yes, (dialog, i) -> mViewModel.deleteSelectedCheat()); .setNegativeButton(R.string.no, null)
builder.setNegativeButton(R.string.no, null); .show();
builder.show();
} }
private void onEditClicked(View view) private void onEditClicked(View view)
@ -134,19 +134,19 @@ public class CheatDetailsFragment extends Fragment
mButtonEdit.requestFocus(); mButtonEdit.requestFocus();
break; break;
case Cheat.TRY_SET_FAIL_NO_NAME: case Cheat.TRY_SET_FAIL_NO_NAME:
mEditName.setError(getString(R.string.cheats_error_no_name)); mEditNameLayout.setError(getString(R.string.cheats_error_no_name));
mScrollView.smoothScrollTo(0, mLabelName.getTop()); mScrollView.smoothScrollTo(0, mEditName.getTop());
break; break;
case Cheat.TRY_SET_FAIL_NO_CODE_LINES: case Cheat.TRY_SET_FAIL_NO_CODE_LINES:
mEditCode.setError(getString(R.string.cheats_error_no_code_lines)); mEditCodeLayout.setError(getString(R.string.cheats_error_no_code_lines));
mScrollView.smoothScrollTo(0, mEditCode.getBottom()); mScrollView.smoothScrollTo(0, mEditCode.getBottom());
break; break;
case Cheat.TRY_SET_FAIL_CODE_MIXED_ENCRYPTION: case Cheat.TRY_SET_FAIL_CODE_MIXED_ENCRYPTION:
mEditCode.setError(getString(R.string.cheats_error_mixed_encryption)); mEditCodeLayout.setError(getString(R.string.cheats_error_mixed_encryption));
mScrollView.smoothScrollTo(0, mEditCode.getBottom()); mScrollView.smoothScrollTo(0, mEditCode.getBottom());
break; break;
default: default:
mEditCode.setError(getString(R.string.cheats_error_on_line, result)); mEditCodeLayout.setError(getString(R.string.cheats_error_on_line, result));
mScrollView.smoothScrollTo(0, mEditCode.getBottom()); mScrollView.smoothScrollTo(0, mEditCode.getBottom());
break; break;
} }
@ -161,12 +161,9 @@ public class CheatDetailsFragment extends Fragment
int creatorVisibility = cheat != null && cheat.supportsCreator() ? View.VISIBLE : View.GONE; int creatorVisibility = cheat != null && cheat.supportsCreator() ? View.VISIBLE : View.GONE;
int notesVisibility = cheat != null && cheat.supportsNotes() ? View.VISIBLE : View.GONE; int notesVisibility = cheat != null && cheat.supportsNotes() ? View.VISIBLE : View.GONE;
int codeVisibility = cheat != null && cheat.supportsCode() ? View.VISIBLE : View.GONE; int codeVisibility = cheat != null && cheat.supportsCode() ? View.VISIBLE : View.GONE;
mLabelCreator.setVisibility(creatorVisibility); mEditCreatorLayout.setVisibility(creatorVisibility);
mEditCreator.setVisibility(creatorVisibility); mEditNotesLayout.setVisibility(notesVisibility);
mLabelNotes.setVisibility(notesVisibility); mEditCodeLayout.setVisibility(codeVisibility);
mEditNotes.setVisibility(notesVisibility);
mLabelCode.setVisibility(codeVisibility);
mEditCode.setVisibility(codeVisibility);
boolean userDefined = cheat != null && cheat.getUserDefined(); boolean userDefined = cheat != null && cheat.getUserDefined();
mButtonDelete.setEnabled(userDefined); mButtonDelete.setEnabled(userDefined);

View File

@ -13,10 +13,13 @@ import android.view.ViewGroup;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.core.view.ViewCompat; import androidx.core.view.ViewCompat;
import androidx.lifecycle.ViewModelProvider; import androidx.lifecycle.ViewModelProvider;
import androidx.slidingpanelayout.widget.SlidingPaneLayout; import androidx.slidingpanelayout.widget.SlidingPaneLayout;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import org.dolphinemu.dolphinemu.R; import org.dolphinemu.dolphinemu.R;
import org.dolphinemu.dolphinemu.features.cheats.model.Cheat; import org.dolphinemu.dolphinemu.features.cheats.model.Cheat;
import org.dolphinemu.dolphinemu.features.cheats.model.CheatsViewModel; import org.dolphinemu.dolphinemu.features.cheats.model.CheatsViewModel;
@ -24,6 +27,7 @@ import org.dolphinemu.dolphinemu.features.cheats.model.GeckoCheat;
import org.dolphinemu.dolphinemu.features.settings.model.Settings; import org.dolphinemu.dolphinemu.features.settings.model.Settings;
import org.dolphinemu.dolphinemu.ui.TwoPaneOnBackPressedCallback; import org.dolphinemu.dolphinemu.ui.TwoPaneOnBackPressedCallback;
import org.dolphinemu.dolphinemu.ui.main.MainPresenter; import org.dolphinemu.dolphinemu.ui.main.MainPresenter;
import org.dolphinemu.dolphinemu.utils.ThemeHelper;
public class CheatsActivity extends AppCompatActivity public class CheatsActivity extends AppCompatActivity
implements SlidingPaneLayout.PanelSlideListener implements SlidingPaneLayout.PanelSlideListener
@ -60,6 +64,8 @@ public class CheatsActivity extends AppCompatActivity
@Override @Override
protected void onCreate(Bundle savedInstanceState) protected void onCreate(Bundle savedInstanceState)
{ {
ThemeHelper.setTheme(this);
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
MainPresenter.skipRescanningLibrary(); MainPresenter.skipRescanningLibrary();
@ -94,7 +100,8 @@ public class CheatsActivity extends AppCompatActivity
mViewModel.getOpenDetailsViewEvent().observe(this, this::openDetailsView); mViewModel.getOpenDetailsViewEvent().observe(this, this::openDetailsView);
// show up button Toolbar tb = findViewById(R.id.toolbar_cheats);
setSupportActionBar(tb);
getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(true);
} }
@ -191,10 +198,10 @@ public class CheatsActivity extends AppCompatActivity
public void downloadGeckoCodes() public void downloadGeckoCodes()
{ {
AlertDialog progressDialog = new AlertDialog.Builder(this).create(); AlertDialog progressDialog = new MaterialAlertDialogBuilder(this)
progressDialog.setTitle(R.string.cheats_downloading); .setMessage(R.string.cheats_downloading)
progressDialog.setCancelable(false); .setCancelable(false)
progressDialog.show(); .show();
new Thread(() -> new Thread(() ->
{ {
@ -206,14 +213,14 @@ public class CheatsActivity extends AppCompatActivity
if (codes == null) if (codes == null)
{ {
new AlertDialog.Builder(this) new MaterialAlertDialogBuilder(this)
.setMessage(getString(R.string.cheats_download_failed)) .setMessage(getString(R.string.cheats_download_failed))
.setPositiveButton(R.string.ok, null) .setPositiveButton(R.string.ok, null)
.show(); .show();
} }
else if (codes.length == 0) else if (codes.length == 0)
{ {
new AlertDialog.Builder(this) new MaterialAlertDialogBuilder(this)
.setMessage(getString(R.string.cheats_download_empty)) .setMessage(getString(R.string.cheats_download_empty))
.setPositiveButton(R.string.ok, null) .setPositiveButton(R.string.ok, null)
.show(); .show();
@ -223,7 +230,7 @@ public class CheatsActivity extends AppCompatActivity
int cheatsAdded = mViewModel.addDownloadedGeckoCodes(codes); int cheatsAdded = mViewModel.addDownloadedGeckoCodes(codes);
String message = getString(R.string.cheats_download_succeeded, codes.length, cheatsAdded); String message = getString(R.string.cheats_download_succeeded, codes.length, cheatsAdded);
new AlertDialog.Builder(this) new MaterialAlertDialogBuilder(this)
.setMessage(message) .setMessage(message)
.setPositiveButton(R.string.ok, null) .setPositiveButton(R.string.ok, null)
.show(); .show();

View File

@ -17,6 +17,7 @@ import org.dolphinemu.dolphinemu.activities.EmulationActivity;
import org.dolphinemu.dolphinemu.features.riivolution.model.RiivolutionPatches; import org.dolphinemu.dolphinemu.features.riivolution.model.RiivolutionPatches;
import org.dolphinemu.dolphinemu.features.settings.model.StringSetting; import org.dolphinemu.dolphinemu.features.settings.model.StringSetting;
import org.dolphinemu.dolphinemu.utils.DirectoryInitialization; import org.dolphinemu.dolphinemu.utils.DirectoryInitialization;
import org.dolphinemu.dolphinemu.utils.ThemeHelper;
public class RiivolutionBootActivity extends AppCompatActivity public class RiivolutionBootActivity extends AppCompatActivity
{ {
@ -41,6 +42,8 @@ public class RiivolutionBootActivity extends AppCompatActivity
@Override @Override
protected void onCreate(Bundle savedInstanceState) protected void onCreate(Bundle savedInstanceState)
{ {
ThemeHelper.setTheme(this);
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_riivolution_boot); setContentView(R.layout.activity_riivolution_boot);

View File

@ -33,6 +33,7 @@ public enum IntSetting implements AbstractIntSetting
MAIN_CONTROL_OPACITY(Settings.FILE_DOLPHIN, Settings.SECTION_INI_ANDROID, "ControlOpacity", 65), MAIN_CONTROL_OPACITY(Settings.FILE_DOLPHIN, Settings.SECTION_INI_ANDROID, "ControlOpacity", 65),
MAIN_EMULATION_ORIENTATION(Settings.FILE_DOLPHIN, Settings.SECTION_INI_ANDROID, MAIN_EMULATION_ORIENTATION(Settings.FILE_DOLPHIN, Settings.SECTION_INI_ANDROID,
"EmulationOrientation", ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE), "EmulationOrientation", ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE),
MAIN_INTERFACE_THEME(Settings.FILE_DOLPHIN, Settings.SECTION_INI_ANDROID, "InterfaceTheme", 0),
MAIN_LAST_PLATFORM_TAB(Settings.FILE_DOLPHIN, Settings.SECTION_INI_ANDROID, "LastPlatformTab", 0), MAIN_LAST_PLATFORM_TAB(Settings.FILE_DOLPHIN, Settings.SECTION_INI_ANDROID, "LastPlatformTab", 0),
MAIN_MOTION_CONTROLS(Settings.FILE_DOLPHIN, Settings.SECTION_INI_ANDROID, "MotionControls", 1), MAIN_MOTION_CONTROLS(Settings.FILE_DOLPHIN, Settings.SECTION_INI_ANDROID, "MotionControls", 1),
MAIN_IR_MODE(Settings.FILE_DOLPHIN, Settings.SECTION_INI_ANDROID, "IRMode", MAIN_IR_MODE(Settings.FILE_DOLPHIN, Settings.SECTION_INI_ANDROID, "IRMode",

View File

@ -2,7 +2,6 @@
package org.dolphinemu.dolphinemu.features.settings.ui; package org.dolphinemu.dolphinemu.features.settings.ui;
import android.app.ProgressDialog;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.net.Uri; import android.net.Uri;
@ -15,13 +14,18 @@ import android.widget.Toast;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.fragment.app.FragmentTransaction; import androidx.fragment.app.FragmentTransaction;
import androidx.lifecycle.ViewModelProvider; import androidx.lifecycle.ViewModelProvider;
import com.google.android.material.appbar.CollapsingToolbarLayout;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import org.dolphinemu.dolphinemu.NativeLibrary; import org.dolphinemu.dolphinemu.NativeLibrary;
import org.dolphinemu.dolphinemu.R; import org.dolphinemu.dolphinemu.R;
import org.dolphinemu.dolphinemu.ui.main.MainPresenter; import org.dolphinemu.dolphinemu.ui.main.MainPresenter;
import org.dolphinemu.dolphinemu.utils.FileBrowserHelper; import org.dolphinemu.dolphinemu.utils.FileBrowserHelper;
import org.dolphinemu.dolphinemu.utils.ThemeHelper;
import java.util.Set; import java.util.Set;
@ -34,7 +38,9 @@ public final class SettingsActivity extends AppCompatActivity implements Setting
private static final String FRAGMENT_TAG = "settings"; private static final String FRAGMENT_TAG = "settings";
private SettingsActivityPresenter mPresenter; private SettingsActivityPresenter mPresenter;
private ProgressDialog dialog; private AlertDialog dialog;
private CollapsingToolbarLayout mToolbarLayout;
public static void launch(Context context, MenuTag menuTag, String gameId, int revision, public static void launch(Context context, MenuTag menuTag, String gameId, int revision,
boolean isWii) boolean isWii)
@ -58,6 +64,8 @@ public final class SettingsActivity extends AppCompatActivity implements Setting
@Override @Override
protected void onCreate(Bundle savedInstanceState) protected void onCreate(Bundle savedInstanceState)
{ {
ThemeHelper.setTheme(this);
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
// If we came here from the game list, we don't want to rescan when returning to the game list. // If we came here from the game list, we don't want to rescan when returning to the game list.
@ -80,7 +88,9 @@ public final class SettingsActivity extends AppCompatActivity implements Setting
mPresenter = new SettingsActivityPresenter(this, getSettings()); mPresenter = new SettingsActivityPresenter(this, getSettings());
mPresenter.onCreate(savedInstanceState, menuTag, gameID, revision, isWii, this); mPresenter.onCreate(savedInstanceState, menuTag, gameID, revision, isWii, this);
// show up button Toolbar tb = findViewById(R.id.toolbar_settings);
mToolbarLayout = findViewById(R.id.toolbar_settings_layout);
setSupportActionBar(tb);
getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(true);
} }
@ -211,11 +221,12 @@ public final class SettingsActivity extends AppCompatActivity implements Setting
{ {
if (dialog == null) if (dialog == null)
{ {
dialog = new ProgressDialog(this); dialog = new MaterialAlertDialogBuilder(this)
dialog.setMessage(getString(R.string.load_settings)); .setTitle(getString(R.string.load_settings))
dialog.setIndeterminate(true); .setView(getLayoutInflater().inflate(R.layout.dialog_indeterminate_progress, null,
false))
.create();
} }
dialog.show(); dialog.show();
} }
@ -228,7 +239,7 @@ public final class SettingsActivity extends AppCompatActivity implements Setting
@Override @Override
public void showGameIniJunkDeletionQuestion() public void showGameIniJunkDeletionQuestion()
{ {
new AlertDialog.Builder(this) new MaterialAlertDialogBuilder(this)
.setTitle(getString(R.string.game_ini_junk_title)) .setTitle(getString(R.string.game_ini_junk_title))
.setMessage(getString(R.string.game_ini_junk_question)) .setMessage(getString(R.string.game_ini_junk_question))
.setPositiveButton(R.string.yes, (dialogInterface, i) -> mPresenter.clearSettings()) .setPositiveButton(R.string.yes, (dialogInterface, i) -> mPresenter.clearSettings())
@ -312,4 +323,9 @@ public final class SettingsActivity extends AppCompatActivity implements Setting
{ {
return (SettingsFragment) getSupportFragmentManager().findFragmentByTag(FRAGMENT_TAG); return (SettingsFragment) getSupportFragmentManager().findFragmentByTag(FRAGMENT_TAG);
} }
public void setToolbarTitle(String title)
{
mToolbarLayout.setTitle(title);
}
} }

View File

@ -108,4 +108,9 @@ public interface SettingsActivityView
* Tell the user that there is junk in the game INI and ask if they want to delete the whole file. * Tell the user that there is junk in the game INI and ask if they want to delete the whole file.
*/ */
void showGameIniJunkDeletionQuestion(); void showGameIniJunkDeletionQuestion();
/**
* Accesses the material toolbar layout and changes the title
*/
void setToolbarTitle(String title);
} }

View File

@ -10,13 +10,16 @@ import android.provider.DocumentsContract;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.SeekBar;
import android.widget.TextView; import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AlertDialog;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.google.android.material.slider.Slider;
import com.google.android.material.textfield.TextInputEditText;
import org.dolphinemu.dolphinemu.R; import org.dolphinemu.dolphinemu.R;
import org.dolphinemu.dolphinemu.dialogs.MotionAlertDialog; import org.dolphinemu.dolphinemu.dialogs.MotionAlertDialog;
import org.dolphinemu.dolphinemu.features.settings.model.Settings; import org.dolphinemu.dolphinemu.features.settings.model.Settings;
@ -56,7 +59,7 @@ import java.io.RandomAccessFile;
import java.util.ArrayList; import java.util.ArrayList;
public final class SettingsAdapter extends RecyclerView.Adapter<SettingViewHolder> public final class SettingsAdapter extends RecyclerView.Adapter<SettingViewHolder>
implements DialogInterface.OnClickListener, SeekBar.OnSeekBarChangeListener implements DialogInterface.OnClickListener, Slider.OnChangeListener
{ {
private final SettingsFragmentView mView; private final SettingsFragmentView mView;
private final Context mContext; private final Context mContext;
@ -64,7 +67,6 @@ public final class SettingsAdapter extends RecyclerView.Adapter<SettingViewHolde
private SettingsItem mClickedItem; private SettingsItem mClickedItem;
private int mClickedPosition; private int mClickedPosition;
private int mSeekbarMinValue;
private int mSeekbarProgress; private int mSeekbarProgress;
private AlertDialog mDialog; private AlertDialog mDialog;
@ -204,28 +206,27 @@ public final class SettingsAdapter extends RecyclerView.Adapter<SettingViewHolde
{ {
LayoutInflater inflater = LayoutInflater.from(mContext); LayoutInflater inflater = LayoutInflater.from(mContext);
AlertDialog.Builder builder = new AlertDialog.Builder(mContext, R.style.DolphinDialogBase);
View dialogView = inflater.inflate(R.layout.dialog_input_string, null); View dialogView = inflater.inflate(R.layout.dialog_input_string, null);
EditText input = (EditText) dialogView.findViewById(R.id.input); TextInputEditText input = dialogView.findViewById(R.id.input);
input.setText(item.getSelectedValue(getSettings())); input.setText(item.getSelectedValue(getSettings()));
builder.setView(dialogView); mDialog = new MaterialAlertDialogBuilder(mView.getActivity())
builder.setMessage(item.getDescription()); .setView(dialogView)
builder.setPositiveButton(R.string.ok, (dialogInterface, i) -> .setMessage(item.getDescription())
{ .setPositiveButton(R.string.ok, (dialogInterface, i) ->
String editTextInput = input.getText().toString(); {
String editTextInput = input.getText().toString();
if (!item.getSelectedValue(mView.getSettings()).equals(editTextInput)) if (!item.getSelectedValue(mView.getSettings()).equals(editTextInput))
{ {
notifyItemChanged(position); notifyItemChanged(position);
mView.onSettingChanged(); mView.onSettingChanged();
} }
item.setSelectedValue(mView.getSettings(), editTextInput); item.setSelectedValue(mView.getSettings(), editTextInput);
}); })
builder.setNegativeButton(R.string.cancel, null); .setNegativeButton(R.string.cancel, null)
.show();
mDialog = builder.show();
} }
public void onSingleChoiceClick(SingleChoiceSetting item, int position) public void onSingleChoiceClick(SingleChoiceSetting item, int position)
@ -235,12 +236,10 @@ public final class SettingsAdapter extends RecyclerView.Adapter<SettingViewHolde
int value = getSelectionForSingleChoiceValue(item); int value = getSelectionForSingleChoiceValue(item);
AlertDialog.Builder builder = new AlertDialog.Builder(mView.getActivity()); mDialog = new MaterialAlertDialogBuilder(mView.getActivity())
.setTitle(item.getName())
builder.setTitle(item.getName()); .setSingleChoiceItems(item.getChoicesId(), value, this)
builder.setSingleChoiceItems(item.getChoicesId(), value, this); .show();
mDialog = builder.show();
} }
public void onStringSingleChoiceClick(StringSingleChoiceSetting item, int position) public void onStringSingleChoiceClick(StringSingleChoiceSetting item, int position)
@ -248,13 +247,11 @@ public final class SettingsAdapter extends RecyclerView.Adapter<SettingViewHolde
mClickedItem = item; mClickedItem = item;
mClickedPosition = position; mClickedPosition = position;
AlertDialog.Builder builder = new AlertDialog.Builder(mView.getActivity()); mDialog = new MaterialAlertDialogBuilder(mView.getActivity())
.setTitle(item.getName())
builder.setTitle(item.getName()); .setSingleChoiceItems(item.getChoices(), item.getSelectedValueIndex(getSettings()),
builder.setSingleChoiceItems(item.getChoices(), item.getSelectedValueIndex(getSettings()), this)
this); .show();
mDialog = builder.show();
} }
public void onSingleChoiceDynamicDescriptionsClick(SingleChoiceSettingDynamicDescriptions item, public void onSingleChoiceDynamicDescriptionsClick(SingleChoiceSettingDynamicDescriptions item,
@ -265,29 +262,26 @@ public final class SettingsAdapter extends RecyclerView.Adapter<SettingViewHolde
int value = getSelectionForSingleChoiceDynamicDescriptionsValue(item); int value = getSelectionForSingleChoiceDynamicDescriptionsValue(item);
AlertDialog.Builder builder = new AlertDialog.Builder(mView.getActivity()); mDialog = new MaterialAlertDialogBuilder(mView.getActivity())
.setTitle(item.getName())
builder.setTitle(item.getName()); .setSingleChoiceItems(item.getChoicesId(), value, this)
builder.setSingleChoiceItems(item.getChoicesId(), value, this); .show();
mDialog = builder.show();
} }
public void onSliderClick(SliderSetting item, int position) public void onSliderClick(SliderSetting item, int position)
{ {
mClickedItem = item; mClickedItem = item;
mClickedPosition = position; mClickedPosition = position;
mSeekbarMinValue = item.getMin();
mSeekbarProgress = item.getSelectedValue(getSettings()); mSeekbarProgress = item.getSelectedValue(getSettings());
AlertDialog.Builder builder = new AlertDialog.Builder(mView.getActivity());
LayoutInflater inflater = LayoutInflater.from(mView.getActivity()); LayoutInflater inflater = LayoutInflater.from(mView.getActivity());
View view = inflater.inflate(R.layout.dialog_seekbar, null); View view = inflater.inflate(R.layout.dialog_slider, null);
builder.setTitle(item.getName()); mDialog = new MaterialAlertDialogBuilder(mView.getActivity())
builder.setView(view); .setTitle(item.getName())
builder.setPositiveButton(R.string.ok, this); .setView(view)
mDialog = builder.show(); .setPositiveButton(R.string.ok, this)
.show();
mTextSliderValue = view.findViewById(R.id.text_value); mTextSliderValue = view.findViewById(R.id.text_value);
mTextSliderValue.setText(String.valueOf(mSeekbarProgress)); mTextSliderValue.setText(String.valueOf(mSeekbarProgress));
@ -295,16 +289,12 @@ public final class SettingsAdapter extends RecyclerView.Adapter<SettingViewHolde
TextView units = view.findViewById(R.id.text_units); TextView units = view.findViewById(R.id.text_units);
units.setText(item.getUnits()); units.setText(item.getUnits());
SeekBar seekbar = view.findViewById(R.id.seekbar); Slider slider = view.findViewById(R.id.slider);
slider.setValueFrom(item.getMin());
// TODO: Once we require API 26, uncomment this line and remove the mSeekbarMinValue variable slider.setValueTo(item.getMax());
//seekbar.setMin(item.getMin()); slider.setValue(mSeekbarProgress);
slider.setStepSize(1);
seekbar.setMax(item.getMax() - mSeekbarMinValue); slider.addOnChangeListener(this);
seekbar.setProgress(mSeekbarProgress - mSeekbarMinValue);
seekbar.setKeyProgressIncrement(5);
seekbar.setOnSeekBarChangeListener(this);
} }
public void onSubmenuClick(SubmenuSetting item) public void onSubmenuClick(SubmenuSetting item)
@ -339,10 +329,10 @@ public final class SettingsAdapter extends RecyclerView.Adapter<SettingViewHolde
if (!PermissionsHandler.isExternalStorageLegacy()) if (!PermissionsHandler.isExternalStorageLegacy())
{ {
AlertDialog.Builder builder = new AlertDialog.Builder(mContext); new MaterialAlertDialogBuilder(mContext)
builder.setMessage(R.string.path_not_changeable_scoped_storage); .setMessage(R.string.path_not_changeable_scoped_storage)
builder.setPositiveButton(R.string.ok, (dialog, i) -> dialog.dismiss()); .setPositiveButton(R.string.ok, (dialog, i) -> dialog.dismiss())
builder.show(); .show();
} }
else else
{ {
@ -509,22 +499,12 @@ public final class SettingsAdapter extends RecyclerView.Adapter<SettingViewHolde
} }
@Override @Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) public void onValueChange(@NonNull Slider slider, float progress, boolean fromUser)
{ {
mSeekbarProgress = progress + mSeekbarMinValue; mSeekbarProgress = (int) progress;
mTextSliderValue.setText(String.valueOf(mSeekbarProgress)); mTextSliderValue.setText(String.valueOf(mSeekbarProgress));
} }
@Override
public void onStartTrackingTouch(SeekBar seekBar)
{
}
@Override
public void onStopTrackingTouch(SeekBar seekBar)
{
}
private int getValueForSingleChoiceSelection(SingleChoiceSetting item, int which) private int getValueForSingleChoiceSelection(SingleChoiceSetting item, int which)
{ {
int valuesId = item.getValuesId(); int valuesId = item.getValuesId();

View File

@ -127,7 +127,7 @@ public final class SettingsFragment extends Fragment implements SettingsFragment
if (titles.containsKey(menuTag)) if (titles.containsKey(menuTag))
{ {
getActivity().setTitle(titles.get(menuTag)); mActivity.setToolbarTitle(getString(titles.get(menuTag)));
} }
LinearLayoutManager manager = new LinearLayoutManager(getActivity()); LinearLayoutManager manager = new LinearLayoutManager(getActivity());

View File

@ -43,6 +43,7 @@ import org.dolphinemu.dolphinemu.features.settings.utils.SettingsFile;
import org.dolphinemu.dolphinemu.ui.main.MainPresenter; import org.dolphinemu.dolphinemu.ui.main.MainPresenter;
import org.dolphinemu.dolphinemu.utils.BooleanSupplier; import org.dolphinemu.dolphinemu.utils.BooleanSupplier;
import org.dolphinemu.dolphinemu.utils.EGLHelper; import org.dolphinemu.dolphinemu.utils.EGLHelper;
import org.dolphinemu.dolphinemu.utils.ThemeHelper;
import org.dolphinemu.dolphinemu.utils.ThreadUtil; import org.dolphinemu.dolphinemu.utils.ThreadUtil;
import org.dolphinemu.dolphinemu.utils.WiiUtils; import org.dolphinemu.dolphinemu.utils.WiiUtils;
@ -323,6 +324,50 @@ public final class SettingsFragmentPresenter
R.string.download_game_covers, 0)); R.string.download_game_covers, 0));
sl.add(new CheckBoxSetting(mContext, BooleanSetting.MAIN_SHOW_GAME_TITLES, sl.add(new CheckBoxSetting(mContext, BooleanSetting.MAIN_SHOW_GAME_TITLES,
R.string.show_titles_in_game_list, R.string.show_titles_in_game_list_description)); R.string.show_titles_in_game_list, R.string.show_titles_in_game_list_description));
AbstractIntSetting appTheme = new AbstractIntSetting()
{
@Override public boolean isOverridden(Settings settings)
{
return IntSetting.MAIN_INTERFACE_THEME.isOverridden(settings);
}
@Override public boolean isRuntimeEditable()
{
// This only affects app UI
return true;
}
@Override public boolean delete(Settings settings)
{
ThemeHelper.deleteThemeKey(mView.getActivity());
return IntSetting.MAIN_INTERFACE_THEME.delete(settings);
}
@Override public int getInt(Settings settings)
{
return IntSetting.MAIN_INTERFACE_THEME.getInt(settings);
}
@Override public void setInt(Settings settings, int newValue)
{
ThemeHelper.saveTheme(mView.getActivity(), newValue);
IntSetting.MAIN_INTERFACE_THEME.setInt(settings, newValue);
mView.getActivity().recreate();
}
};
// If a Monet theme is run on a device below API 31, the app will crash
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S)
{
sl.add(new SingleChoiceSetting(mContext, appTheme, R.string.change_theme, 0,
R.array.themeEntriesA12, R.array.themeValuesA12));
}
else
{
sl.add(new SingleChoiceSetting(mContext, appTheme, R.string.change_theme, 0,
R.array.themeEntries, R.array.themeValues));
}
} }
private void addAudioSettings(ArrayList<SettingsItem> sl) private void addAudioSettings(ArrayList<SettingsItem> sl)

View File

@ -6,7 +6,7 @@ import android.content.Context;
import android.text.method.LinkMovementMethod; import android.text.method.LinkMovementMethod;
import android.view.View; import android.view.View;
import androidx.core.content.ContextCompat; import com.google.android.material.color.MaterialColors;
import org.dolphinemu.dolphinemu.R; import org.dolphinemu.dolphinemu.R;
import org.dolphinemu.dolphinemu.features.settings.model.view.SettingsItem; import org.dolphinemu.dolphinemu.features.settings.model.view.SettingsItem;
@ -27,7 +27,8 @@ public final class HeaderHyperLinkViewHolder extends HeaderViewHolder
public void bind(SettingsItem item) public void bind(SettingsItem item)
{ {
super.bind(item); super.bind(item);
mHeaderName.setMovementMethod(LinkMovementMethod.getInstance()); mHeaderName.setMovementMethod(LinkMovementMethod.getInstance());
mHeaderName.setLinkTextColor(ContextCompat.getColor(mContext, R.color.dolphin_blue_secondary)); mHeaderName.setLinkTextColor(MaterialColors.getColor(itemView, R.attr.colorTertiary));
} }
} }

View File

@ -8,7 +8,8 @@ import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import org.dolphinemu.dolphinemu.R; import org.dolphinemu.dolphinemu.R;
import org.dolphinemu.dolphinemu.features.settings.model.view.RunRunnable; import org.dolphinemu.dolphinemu.features.settings.model.view.RunRunnable;
@ -54,19 +55,16 @@ public final class RunRunnableViewHolder extends SettingViewHolder
if (alertTextID > 0) if (alertTextID > 0)
{ {
AlertDialog.Builder builder = new AlertDialog.Builder(mContext) new MaterialAlertDialogBuilder(mContext)
.setTitle(mItem.getName()) .setTitle(mItem.getName())
.setMessage(alertTextID); .setMessage(alertTextID)
builder
.setPositiveButton(R.string.ok, (dialog, whichButton) -> .setPositiveButton(R.string.ok, (dialog, whichButton) ->
{ {
runRunnable(); runRunnable();
dialog.dismiss(); dialog.dismiss();
}) })
.setNegativeButton(R.string.cancel, (dialog, whichButton) -> dialog.dismiss()); .setNegativeButton(R.string.cancel, (dialog, whichButton) -> dialog.dismiss())
.show();
builder.show();
} }
else else
{ {

View File

@ -10,9 +10,10 @@ import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import org.dolphinemu.dolphinemu.DolphinApplication; import org.dolphinemu.dolphinemu.DolphinApplication;
import org.dolphinemu.dolphinemu.R; import org.dolphinemu.dolphinemu.R;
import org.dolphinemu.dolphinemu.features.settings.model.view.SettingsItem; import org.dolphinemu.dolphinemu.features.settings.model.view.SettingsItem;
@ -96,10 +97,8 @@ public abstract class SettingViewHolder extends RecyclerView.ViewHolder
Context context = clicked.getContext(); Context context = clicked.getContext();
AlertDialog.Builder builder = new AlertDialog.Builder(context) new MaterialAlertDialogBuilder(context)
.setMessage(R.string.setting_clear_confirm); .setMessage(R.string.setting_clear_confirm)
builder
.setPositiveButton(R.string.ok, (dialog, whichButton) -> .setPositiveButton(R.string.ok, (dialog, whichButton) ->
{ {
getAdapter().clearSetting(item, getBindingAdapterPosition()); getAdapter().clearSetting(item, getBindingAdapterPosition());
@ -107,9 +106,8 @@ public abstract class SettingViewHolder extends RecyclerView.ViewHolder
Toast.makeText(context, R.string.setting_cleared, Toast.LENGTH_SHORT).show(); Toast.makeText(context, R.string.setting_cleared, Toast.LENGTH_SHORT).show();
dialog.dismiss(); dialog.dismiss();
}) })
.setNegativeButton(R.string.cancel, (dialog, whichButton) -> dialog.dismiss()); .setNegativeButton(R.string.cancel, (dialog, whichButton) -> dialog.dismiss())
.show();
builder.show();
return true; return true;
} }

View File

@ -7,10 +7,11 @@ import android.os.Bundle;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.DialogFragment; import androidx.fragment.app.DialogFragment;
import androidx.lifecycle.ViewModelProvider; import androidx.lifecycle.ViewModelProvider;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import org.dolphinemu.dolphinemu.R; import org.dolphinemu.dolphinemu.R;
public class OnlineUpdateRegionSelectDialogFragment extends DialogFragment public class OnlineUpdateRegionSelectDialogFragment extends DialogFragment
@ -23,7 +24,7 @@ public class OnlineUpdateRegionSelectDialogFragment extends DialogFragment
R.string.japan), getString(R.string.korea), getString(R.string.united_states)}; R.string.japan), getString(R.string.korea), getString(R.string.united_states)};
int checkedItem = -1; int checkedItem = -1;
return new AlertDialog.Builder(requireContext()) return new MaterialAlertDialogBuilder(requireContext())
.setTitle(R.string.region_select_title) .setTitle(R.string.region_select_title)
.setSingleChoiceItems(items, checkedItem, (dialog, which) -> .setSingleChoiceItems(items, checkedItem, (dialog, which) ->
{ {
@ -35,8 +36,6 @@ public class OnlineUpdateRegionSelectDialogFragment extends DialogFragment
new SystemUpdateProgressBarDialogFragment(); new SystemUpdateProgressBarDialogFragment();
progressBarFragment progressBarFragment
.show(getParentFragmentManager(), "OnlineUpdateProgressBarDialogFragment"); .show(getParentFragmentManager(), "OnlineUpdateProgressBarDialogFragment");
progressBarFragment.setCancelable(false);
dismiss(); dismiss();
}) })
.create(); .create();

View File

@ -5,10 +5,11 @@ package org.dolphinemu.dolphinemu.features.sysupdate.ui;
import android.app.Dialog; import android.app.Dialog;
import android.os.Bundle; import android.os.Bundle;
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.DialogFragment; import androidx.fragment.app.DialogFragment;
import androidx.fragment.app.FragmentManager; import androidx.fragment.app.FragmentManager;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import org.dolphinemu.dolphinemu.R; import org.dolphinemu.dolphinemu.R;
public class SystemMenuNotInstalledDialogFragment extends DialogFragment public class SystemMenuNotInstalledDialogFragment extends DialogFragment
@ -16,7 +17,7 @@ public class SystemMenuNotInstalledDialogFragment extends DialogFragment
@Override @Override
public Dialog onCreateDialog(Bundle savedInstanceState) public Dialog onCreateDialog(Bundle savedInstanceState)
{ {
return new AlertDialog.Builder(requireContext()) return new MaterialAlertDialogBuilder(requireContext())
.setTitle(R.string.system_menu_not_installed_title) .setTitle(R.string.system_menu_not_installed_title)
.setMessage(R.string.system_menu_not_installed_message) .setMessage(R.string.system_menu_not_installed_message)
.setPositiveButton(R.string.yes, (dialog, which) -> .setPositiveButton(R.string.yes, (dialog, which) ->
@ -27,10 +28,7 @@ public class SystemMenuNotInstalledDialogFragment extends DialogFragment
dialogFragment.show(fragmentManager, "OnlineUpdateRegionSelectDialogFragment"); dialogFragment.show(fragmentManager, "OnlineUpdateRegionSelectDialogFragment");
dismiss(); dismiss();
}) })
.setNegativeButton(R.string.no, (dialog, which) -> .setNegativeButton(R.string.no, (dialog, which) -> dismiss())
{
dismiss();
})
.create(); .create();
} }
} }

View File

@ -3,15 +3,20 @@
package org.dolphinemu.dolphinemu.features.sysupdate.ui; package org.dolphinemu.dolphinemu.features.sysupdate.ui;
import android.app.Dialog; import android.app.Dialog;
import android.app.ProgressDialog;
import android.content.pm.ActivityInfo; import android.content.pm.ActivityInfo;
import android.os.Bundle; import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.DialogFragment; import androidx.fragment.app.DialogFragment;
import androidx.lifecycle.ViewModelProvider; import androidx.lifecycle.ViewModelProvider;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.google.android.material.progressindicator.LinearProgressIndicator;
import org.dolphinemu.dolphinemu.R; import org.dolphinemu.dolphinemu.R;
public class SystemUpdateProgressBarDialogFragment extends DialogFragment public class SystemUpdateProgressBarDialogFragment extends DialogFragment
@ -28,28 +33,20 @@ public class SystemUpdateProgressBarDialogFragment extends DialogFragment
SystemUpdateViewModel viewModel = SystemUpdateViewModel viewModel =
new ViewModelProvider(requireActivity()).get(SystemUpdateViewModel.class); new ViewModelProvider(requireActivity()).get(SystemUpdateViewModel.class);
ProgressDialog progressDialog = new ProgressDialog(requireContext()); View dialogView = getLayoutInflater().inflate(R.layout.dialog_progress, null, false);
progressDialog.setTitle(getString(R.string.updating)); LinearProgressIndicator progressBar = dialogView.findViewById(R.id.update_progress);
// We need to set the message to something here, otherwise the text will not appear when we set it later.
progressDialog.setMessage("");
progressDialog.setButton(Dialog.BUTTON_NEGATIVE, getString(R.string.cancel), (dialog, i) ->
{
});
progressDialog.setOnShowListener((dialogInterface) ->
{
// By default, the ProgressDialog will immediately dismiss itself upon a button being pressed.
// Setting the OnClickListener again after the dialog is shown overrides this behavior.
progressDialog.getButton(Dialog.BUTTON_NEGATIVE).setOnClickListener((view) ->
{
viewModel.setCanceled();
});
});
progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
viewModel.getProgressData().observe(this, (@Nullable Integer progress) -> // We need to set the message to something here, otherwise the text will not appear when we set it later.
{ AlertDialog progressDialog = new MaterialAlertDialogBuilder(requireContext())
progressDialog.setProgress(progress.intValue()); .setTitle(getString(R.string.updating))
}); .setMessage("")
.setNegativeButton(getString(R.string.cancel), null)
.setView(dialogView)
.setCancelable(false)
.create();
viewModel.getProgressData()
.observe(this, (@Nullable Integer progress) -> progressBar.setProgress(progress));
viewModel.getTotalData().observe(this, (@Nullable Integer total) -> viewModel.getTotalData().observe(this, (@Nullable Integer total) ->
{ {
@ -58,13 +55,11 @@ public class SystemUpdateProgressBarDialogFragment extends DialogFragment
return; return;
} }
progressDialog.setMax(total.intValue()); progressBar.setMax(total);
}); });
viewModel.getTitleIdData().observe(this, (@Nullable Long titleId) -> viewModel.getTitleIdData().observe(this, (@Nullable Long titleId) -> progressDialog.setMessage(
{ getString(R.string.updating_message, titleId)));
progressDialog.setMessage(getString(R.string.updating_message, titleId));
});
viewModel.getResultData().observe(this, (@Nullable Integer result) -> viewModel.getResultData().observe(this, (@Nullable Integer result) ->
{ {
@ -88,4 +83,17 @@ public class SystemUpdateProgressBarDialogFragment extends DialogFragment
} }
return progressDialog; return progressDialog;
} }
// By default, the ProgressDialog will immediately dismiss itself upon a button being pressed.
// Setting the OnClickListener again after the dialog is shown overrides this behavior.
@Override
public void onResume()
{
super.onResume();
AlertDialog alertDialog = (AlertDialog) getDialog();
SystemUpdateViewModel viewModel =
new ViewModelProvider(requireActivity()).get(SystemUpdateViewModel.class);
Button negativeButton = alertDialog.getButton(Dialog.BUTTON_NEGATIVE);
negativeButton.setOnClickListener(v -> viewModel.setCanceled());
}
} }

View File

@ -6,10 +6,11 @@ import android.app.Dialog;
import android.os.Bundle; import android.os.Bundle;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.DialogFragment; import androidx.fragment.app.DialogFragment;
import androidx.lifecycle.ViewModelProvider; import androidx.lifecycle.ViewModelProvider;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import org.dolphinemu.dolphinemu.R; import org.dolphinemu.dolphinemu.R;
import org.dolphinemu.dolphinemu.utils.WiiUtils; import org.dolphinemu.dolphinemu.utils.WiiUtils;
@ -88,13 +89,10 @@ public class SystemUpdateResultFragment extends DialogFragment
throw new IllegalStateException("Unexpected value: " + mResult); throw new IllegalStateException("Unexpected value: " + mResult);
} }
return new AlertDialog.Builder(requireContext()) return new MaterialAlertDialogBuilder(requireContext())
.setTitle(title) .setTitle(title)
.setMessage(message) .setMessage(message)
.setPositiveButton(R.string.ok, (dialog, which) -> .setPositiveButton(R.string.ok, (dialog, which) -> dismiss())
{
dismiss();
})
.create(); .create();
} }

View File

@ -3,7 +3,6 @@
package org.dolphinemu.dolphinemu.fragments; package org.dolphinemu.dolphinemu.fragments;
import android.app.Activity; import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.os.Build; import android.os.Build;
@ -22,6 +21,9 @@ import androidx.annotation.StringRes;
import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.google.android.material.progressindicator.LinearProgressIndicator;
import org.dolphinemu.dolphinemu.NativeLibrary; import org.dolphinemu.dolphinemu.NativeLibrary;
import org.dolphinemu.dolphinemu.R; import org.dolphinemu.dolphinemu.R;
import org.dolphinemu.dolphinemu.model.GameFile; import org.dolphinemu.dolphinemu.model.GameFile;
@ -361,12 +363,11 @@ public class ConvertFragment extends Fragment implements View.OnClickListener
return () -> return () ->
{ {
Context context = requireContext(); Context context = requireContext();
AlertDialog.Builder builder = new AlertDialog.Builder(context); new MaterialAlertDialogBuilder(context)
builder.setMessage(warning_text) .setMessage(warning_text)
.setPositiveButton(R.string.yes, (dialog, i) -> action.run()) .setPositiveButton(R.string.yes, (dialog, i) -> action.run())
.setNegativeButton(R.string.no, null); .setNegativeButton(R.string.no, null)
AlertDialog alert = builder.create(); .show();
alert.show();
}; };
} }
@ -422,20 +423,16 @@ public class ConvertFragment extends Fragment implements View.OnClickListener
mCanceled = false; mCanceled = false;
// For some reason, setting R.style.DolphinDialogBase as the theme here gives us white text View dialogView = getLayoutInflater().inflate(R.layout.dialog_progress, null, false);
// on a white background when the device is set to dark mode, so let's not set a theme. LinearProgressIndicator progressBar = dialogView.findViewById(R.id.update_progress);
ProgressDialog progressDialog = new ProgressDialog(context); progressBar.setMax(PROGRESS_RESOLUTION);
progressDialog.setTitle(R.string.convert_converting); AlertDialog progressDialog = new MaterialAlertDialogBuilder(context)
.setTitle(R.string.convert_converting)
progressDialog.setIndeterminate(false); .setOnCancelListener((dialog) -> mCanceled = true)
progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL); .setNegativeButton(getString(R.string.cancel), (dialog, i) -> dialog.dismiss())
progressDialog.setMax(PROGRESS_RESOLUTION); .setView(dialogView)
.show();
progressDialog.setCancelable(true);
progressDialog.setOnCancelListener((dialog) -> mCanceled = true);
progressDialog.show();
mThread = new Thread(() -> mThread = new Thread(() ->
{ {
@ -447,9 +444,8 @@ public class ConvertFragment extends Fragment implements View.OnClickListener
requireActivity().runOnUiThread(() -> requireActivity().runOnUiThread(() ->
{ {
progressDialog.setMessage(text); progressDialog.setMessage(text);
progressDialog.setProgress((int) (completion * PROGRESS_RESOLUTION)); progressBar.setProgress((int) (completion * PROGRESS_RESOLUTION));
}); });
return !mCanceled; return !mCanceled;
}); });
@ -459,7 +455,7 @@ public class ConvertFragment extends Fragment implements View.OnClickListener
{ {
progressDialog.dismiss(); progressDialog.dismiss();
AlertDialog.Builder builder = new AlertDialog.Builder(context); MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(context);
if (success) if (success)
{ {
builder.setMessage(R.string.convert_success_message) builder.setMessage(R.string.convert_success_message)
@ -475,8 +471,7 @@ public class ConvertFragment extends Fragment implements View.OnClickListener
builder.setMessage(R.string.convert_failure_message) builder.setMessage(R.string.convert_failure_message)
.setPositiveButton(R.string.ok, (dialog, i) -> dialog.dismiss()); .setPositiveButton(R.string.ok, (dialog, i) -> dialog.dismiss());
} }
AlertDialog alert = builder.create(); builder.show();
alert.show();
}); });
} }
}); });

View File

@ -37,6 +37,7 @@ import org.dolphinemu.dolphinemu.utils.DirectoryInitialization;
import org.dolphinemu.dolphinemu.utils.FileBrowserHelper; import org.dolphinemu.dolphinemu.utils.FileBrowserHelper;
import org.dolphinemu.dolphinemu.utils.PermissionsHandler; import org.dolphinemu.dolphinemu.utils.PermissionsHandler;
import org.dolphinemu.dolphinemu.utils.StartupHandler; import org.dolphinemu.dolphinemu.utils.StartupHandler;
import org.dolphinemu.dolphinemu.utils.ThemeHelper;
import org.dolphinemu.dolphinemu.utils.WiiUtils; import org.dolphinemu.dolphinemu.utils.WiiUtils;
/** /**
@ -44,13 +45,15 @@ import org.dolphinemu.dolphinemu.utils.WiiUtils;
* individually display a grid of available games for each Fragment, in a tabbed layout. * individually display a grid of available games for each Fragment, in a tabbed layout.
*/ */
public final class MainActivity extends AppCompatActivity public final class MainActivity extends AppCompatActivity
implements MainView, SwipeRefreshLayout.OnRefreshListener implements MainView, SwipeRefreshLayout.OnRefreshListener, ThemeProvider
{ {
private ViewPager mViewPager; private ViewPager mViewPager;
private Toolbar mToolbar; private Toolbar mToolbar;
private TabLayout mTabLayout; private TabLayout mTabLayout;
private FloatingActionButton mFab; private FloatingActionButton mFab;
private int mThemeId;
private final MainPresenter mPresenter = new MainPresenter(this, this); private final MainPresenter mPresenter = new MainPresenter(this, this);
@Override @Override
@ -60,6 +63,8 @@ public final class MainActivity extends AppCompatActivity
splashScreen.setKeepOnScreenCondition( splashScreen.setKeepOnScreenCondition(
() -> !DirectoryInitialization.areDolphinDirectoriesReady()); () -> !DirectoryInitialization.areDolphinDirectoriesReady());
ThemeHelper.setTheme(this);
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main); setContentView(R.layout.activity_main);
@ -74,7 +79,10 @@ public final class MainActivity extends AppCompatActivity
// Stuff in this block only happens when this activity is newly created (i.e. not a rotation) // Stuff in this block only happens when this activity is newly created (i.e. not a rotation)
if (savedInstanceState == null) if (savedInstanceState == null)
{
StartupHandler.HandleInit(this); StartupHandler.HandleInit(this);
new AfterDirectoryInitializationRunner().runWithLifecycle(this, this::checkTheme);
}
if (!DirectoryInitialization.isWaitingForWriteAccess(this)) if (!DirectoryInitialization.isWaitingForWriteAccess(this))
{ {
@ -86,6 +94,8 @@ public final class MainActivity extends AppCompatActivity
@Override @Override
protected void onResume() protected void onResume()
{ {
ThemeHelper.setCorrectTheme(this);
super.onResume(); super.onResume();
if (DirectoryInitialization.shouldStart(this)) if (DirectoryInitialization.shouldStart(this))
@ -355,4 +365,22 @@ public final class MainActivity extends AppCompatActivity
showGames(); showGames();
GameFileCacheManager.startLoad(this); GameFileCacheManager.startLoad(this);
} }
@Override
public void setTheme(int themeId)
{
super.setTheme(themeId);
this.mThemeId = themeId;
}
@Override
public int getThemeId()
{
return mThemeId;
}
private void checkTheme()
{
ThemeHelper.setCorrectTheme(this);
}
} }

View File

@ -7,11 +7,12 @@ import android.content.Intent;
import android.net.Uri; import android.net.Uri;
import androidx.activity.ComponentActivity; import androidx.activity.ComponentActivity;
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.FragmentActivity; import androidx.fragment.app.FragmentActivity;
import androidx.lifecycle.Observer; import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProvider; import androidx.lifecycle.ViewModelProvider;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import org.dolphinemu.dolphinemu.BuildConfig; import org.dolphinemu.dolphinemu.BuildConfig;
import org.dolphinemu.dolphinemu.R; import org.dolphinemu.dolphinemu.R;
import org.dolphinemu.dolphinemu.activities.EmulationActivity; import org.dolphinemu.dolphinemu.activities.EmulationActivity;
@ -171,11 +172,12 @@ public final class MainPresenter
if (Arrays.stream(childNames).noneMatch((name) -> FileBrowserHelper.GAME_EXTENSIONS.contains( if (Arrays.stream(childNames).noneMatch((name) -> FileBrowserHelper.GAME_EXTENSIONS.contains(
FileBrowserHelper.getExtension(name, false)))) FileBrowserHelper.getExtension(name, false))))
{ {
AlertDialog.Builder builder = new AlertDialog.Builder(mActivity); new MaterialAlertDialogBuilder(mActivity)
builder.setMessage(mActivity.getString(R.string.wrong_file_extension_in_directory, .setMessage(mActivity.getString(R.string.wrong_file_extension_in_directory,
FileBrowserHelper.setToSortedDelimitedString(FileBrowserHelper.GAME_EXTENSIONS))); FileBrowserHelper.setToSortedDelimitedString(
builder.setPositiveButton(R.string.ok, null); FileBrowserHelper.GAME_EXTENSIONS)))
builder.show(); .setPositiveButton(R.string.ok, null)
.show();
} }
ContentResolver contentResolver = mActivity.getContentResolver(); ContentResolver contentResolver = mActivity.getContentResolver();
@ -209,13 +211,12 @@ public final class MainPresenter
{ {
mActivity.runOnUiThread(() -> mActivity.runOnUiThread(() ->
{ {
AlertDialog.Builder builder = new MaterialAlertDialogBuilder(mActivity)
new AlertDialog.Builder(mActivity); .setMessage(R.string.wii_save_exists)
builder.setMessage(R.string.wii_save_exists); .setCancelable(false)
builder.setCancelable(false); .setPositiveButton(R.string.yes, (dialog, i) -> canOverwriteFuture.complete(true))
builder.setPositiveButton(R.string.yes, (dialog, i) -> canOverwriteFuture.complete(true)); .setNegativeButton(R.string.no, (dialog, i) -> canOverwriteFuture.complete(false))
builder.setNegativeButton(R.string.no, (dialog, i) -> canOverwriteFuture.complete(false)); .show();
builder.show();
}); });
try try
@ -255,26 +256,23 @@ public final class MainPresenter
public void importNANDBin(String path) public void importNANDBin(String path)
{ {
AlertDialog.Builder builder = new MaterialAlertDialogBuilder(mActivity)
new AlertDialog.Builder(mActivity); .setMessage(R.string.nand_import_warning)
.setNegativeButton(R.string.no, (dialog, i) -> dialog.dismiss())
.setPositiveButton(R.string.yes, (dialog, i) ->
{
dialog.dismiss();
builder.setMessage(R.string.nand_import_warning); ThreadUtil.runOnThreadAndShowResult(mActivity, R.string.import_in_progress,
builder.setNegativeButton(R.string.no, (dialog, i) -> dialog.dismiss()); R.string.do_not_close_app, () ->
builder.setPositiveButton(R.string.yes, (dialog, i) -> {
{ // ImportNANDBin unfortunately doesn't provide any result value...
dialog.dismiss(); // It does however show a panic alert if something goes wrong.
WiiUtils.importNANDBin(path);
ThreadUtil.runOnThreadAndShowResult(mActivity, R.string.import_in_progress, return null;
R.string.do_not_close_app, () -> });
{ })
// ImportNANDBin unfortunately doesn't provide any result value... .show();
// It does however show a panic alert if something goes wrong.
WiiUtils.importNANDBin(path);
return null;
});
});
builder.show();
} }
public static void skipRescanningLibrary() public static void skipRescanningLibrary()

View File

@ -0,0 +1,9 @@
package org.dolphinemu.dolphinemu.ui.main;
public interface ThemeProvider
{
/**
* Provides theme ID by overriding an activity's 'setTheme' method and returning that result
*/
int getThemeId();
}

View File

@ -6,7 +6,6 @@ import android.content.Intent;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.util.TypedValue;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.core.content.ContextCompat; import androidx.core.content.ContextCompat;
@ -121,10 +120,6 @@ public final class TvMainActivity extends FragmentActivity
{ {
mSwipeRefresh = findViewById(R.id.swipe_refresh); mSwipeRefresh = findViewById(R.id.swipe_refresh);
TypedValue typedValue = new TypedValue();
getTheme().resolveAttribute(R.attr.colorPrimary, typedValue, true);
mSwipeRefresh.setColorSchemeColors(typedValue.data);
mSwipeRefresh.setOnRefreshListener(this); mSwipeRefresh.setOnRefreshListener(this);
setRefreshing(GameFileCacheManager.isLoadingOrRescanning()); setRefreshing(GameFileCacheManager.isLoadingOrRescanning());
@ -138,7 +133,7 @@ public final class TvMainActivity extends FragmentActivity
// Set display parameters for the BrowseFragment // Set display parameters for the BrowseFragment
mBrowseFragment.setHeadersState(BrowseSupportFragment.HEADERS_ENABLED); mBrowseFragment.setHeadersState(BrowseSupportFragment.HEADERS_ENABLED);
mBrowseFragment.setBrandColor(ContextCompat.getColor(this, R.color.dolphin_blue_secondary)); mBrowseFragment.setBrandColor(ContextCompat.getColor(this, R.color.dolphin_blue));
buildRowsAdapter(); buildRowsAdapter();
mBrowseFragment.setOnItemViewClickedListener( mBrowseFragment.setOnItemViewClickedListener(
@ -364,7 +359,7 @@ public final class TvMainActivity extends FragmentActivity
ArrayObjectAdapter rowItems = new ArrayObjectAdapter(new SettingsRowPresenter()); ArrayObjectAdapter rowItems = new ArrayObjectAdapter(new SettingsRowPresenter());
rowItems.add(new TvSettingsItem(R.id.menu_settings, rowItems.add(new TvSettingsItem(R.id.menu_settings,
R.drawable.ic_settings, R.drawable.ic_settings_tv,
R.string.grid_menu_settings)); R.string.grid_menu_settings));
rowItems.add(new TvSettingsItem(R.id.button_add_directory, rowItems.add(new TvSettingsItem(R.id.button_add_directory,
@ -372,31 +367,31 @@ public final class TvMainActivity extends FragmentActivity
R.string.add_directory_title)); R.string.add_directory_title));
rowItems.add(new TvSettingsItem(R.id.menu_refresh, rowItems.add(new TvSettingsItem(R.id.menu_refresh,
R.drawable.ic_refresh, R.drawable.ic_refresh_tv,
R.string.grid_menu_refresh)); R.string.grid_menu_refresh));
rowItems.add(new TvSettingsItem(R.id.menu_open_file, rowItems.add(new TvSettingsItem(R.id.menu_open_file,
R.drawable.ic_play, R.drawable.ic_play_tv,
R.string.grid_menu_open_file)); R.string.grid_menu_open_file));
rowItems.add(new TvSettingsItem(R.id.menu_install_wad, rowItems.add(new TvSettingsItem(R.id.menu_install_wad,
R.drawable.ic_folder, R.drawable.ic_folder_tv,
R.string.grid_menu_install_wad)); R.string.grid_menu_install_wad));
rowItems.add(new TvSettingsItem(R.id.menu_load_wii_system_menu, rowItems.add(new TvSettingsItem(R.id.menu_load_wii_system_menu,
R.drawable.ic_folder, R.drawable.ic_folder_tv,
R.string.grid_menu_load_wii_system_menu)); R.string.grid_menu_load_wii_system_menu));
rowItems.add(new TvSettingsItem(R.id.menu_import_wii_save, rowItems.add(new TvSettingsItem(R.id.menu_import_wii_save,
R.drawable.ic_folder, R.drawable.ic_folder_tv,
R.string.grid_menu_import_wii_save)); R.string.grid_menu_import_wii_save));
rowItems.add(new TvSettingsItem(R.id.menu_import_nand_backup, rowItems.add(new TvSettingsItem(R.id.menu_import_nand_backup,
R.drawable.ic_folder, R.drawable.ic_folder_tv,
R.string.grid_menu_import_nand_backup)); R.string.grid_menu_import_nand_backup));
rowItems.add(new TvSettingsItem(R.id.menu_online_system_update, rowItems.add(new TvSettingsItem(R.id.menu_online_system_update,
R.drawable.ic_folder, R.drawable.ic_folder_tv,
R.string.grid_menu_online_system_update)); R.string.grid_menu_online_system_update));
// Create a header for this row. // Create a header for this row.

View File

@ -3,7 +3,6 @@
package org.dolphinemu.dolphinemu.ui.platform; package org.dolphinemu.dolphinemu.ui.platform;
import android.os.Bundle; import android.os.Bundle;
import android.util.TypedValue;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
@ -15,6 +14,8 @@ import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import com.google.android.material.color.MaterialColors;
import org.dolphinemu.dolphinemu.R; import org.dolphinemu.dolphinemu.R;
import org.dolphinemu.dolphinemu.adapters.GameAdapter; import org.dolphinemu.dolphinemu.adapters.GameAdapter;
import org.dolphinemu.dolphinemu.services.GameFileCacheManager; import org.dolphinemu.dolphinemu.services.GameFileCacheManager;
@ -62,9 +63,10 @@ public final class PlatformGamesFragment extends Fragment implements PlatformGam
RecyclerView.LayoutManager layoutManager = new GridLayoutManager(getActivity(), columns); RecyclerView.LayoutManager layoutManager = new GridLayoutManager(getActivity(), columns);
mAdapter = new GameAdapter(); mAdapter = new GameAdapter();
TypedValue typedValue = new TypedValue(); // Set theme color to the refresh animation's background
requireActivity().getTheme().resolveAttribute(R.attr.colorPrimary, typedValue, true); mSwipeRefresh.setProgressBackgroundColorSchemeColor(
mSwipeRefresh.setColorSchemeColors(typedValue.data); MaterialColors.getColor(mSwipeRefresh, R.attr.colorSurfaceVariant));
mSwipeRefresh.setColorSchemeColors(MaterialColors.getColor(mSwipeRefresh, R.attr.colorPrimary));
mSwipeRefresh.setOnRefreshListener(mOnRefreshListener); mSwipeRefresh.setOnRefreshListener(mOnRefreshListener);

View File

@ -5,7 +5,7 @@ package org.dolphinemu.dolphinemu.utils;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface.OnClickListener; import android.content.DialogInterface.OnClickListener;
import androidx.appcompat.app.AlertDialog; import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import java.util.ArrayList; import java.util.ArrayList;
@ -33,7 +33,7 @@ public class AlertDialogItemsBuilder
mListeners.add(listener); mListeners.add(listener);
} }
public void applyToBuilder(AlertDialog.Builder builder) public void applyToBuilder(MaterialAlertDialogBuilder builder)
{ {
CharSequence[] labels = new CharSequence[mLabels.size()]; CharSequence[] labels = new CharSequence[mLabels.size()];
labels = mLabels.toArray(labels); labels = mLabels.toArray(labels);

View File

@ -6,10 +6,10 @@ import android.content.Context;
import android.os.Build; import android.os.Build;
import androidx.annotation.Keep; import androidx.annotation.Keep;
import androidx.appcompat.app.AlertDialog;
import com.android.volley.Request; import com.android.volley.Request;
import com.android.volley.toolbox.StringRequest; import com.android.volley.toolbox.StringRequest;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import org.dolphinemu.dolphinemu.DolphinApplication; import org.dolphinemu.dolphinemu.DolphinApplication;
import org.dolphinemu.dolphinemu.R; import org.dolphinemu.dolphinemu.R;
@ -36,17 +36,11 @@ public class Analytics
private static void showMessage(Context context) private static void showMessage(Context context)
{ {
new AlertDialog.Builder(context) new MaterialAlertDialogBuilder(context)
.setTitle(context.getString(R.string.analytics)) .setTitle(context.getString(R.string.analytics))
.setMessage(context.getString(R.string.analytics_desc)) .setMessage(context.getString(R.string.analytics_desc))
.setPositiveButton(R.string.yes, (dialogInterface, i) -> .setPositiveButton(R.string.yes, (dialogInterface, i) -> firstAnalyticsAdd(true))
{ .setNegativeButton(R.string.no, (dialogInterface, i) -> firstAnalyticsAdd(false))
firstAnalyticsAdd(true);
})
.setNegativeButton(R.string.no, (dialogInterface, i) ->
{
firstAnalyticsAdd(false);
})
.show(); .show();
} }

View File

@ -20,6 +20,7 @@ import androidx.lifecycle.MutableLiveData;
import org.dolphinemu.dolphinemu.NativeLibrary; import org.dolphinemu.dolphinemu.NativeLibrary;
import org.dolphinemu.dolphinemu.R; import org.dolphinemu.dolphinemu.R;
import org.dolphinemu.dolphinemu.activities.EmulationActivity; import org.dolphinemu.dolphinemu.activities.EmulationActivity;
import org.dolphinemu.dolphinemu.features.settings.model.IntSetting;
import java.io.File; import java.io.File;
import java.io.FileOutputStream; import java.io.FileOutputStream;
@ -77,6 +78,15 @@ public final class DirectoryInitialization
areDirectoriesAvailable = true; areDirectoriesAvailable = true;
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
if (IntSetting.MAIN_INTERFACE_THEME.getIntGlobal() !=
preferences.getInt(ThemeHelper.CURRENT_THEME, ThemeHelper.DEFAULT))
{
preferences.edit()
.putInt(ThemeHelper.CURRENT_THEME, IntSetting.MAIN_INTERFACE_THEME.getIntGlobal())
.apply();
}
if (wiimoteIniWritten) if (wiimoteIniWritten)
{ {
// This has to be done after calling NativeLibrary.Initialize(), // This has to be done after calling NativeLibrary.Initialize(),

View File

@ -8,9 +8,9 @@ import android.net.Uri;
import android.os.Environment; import android.os.Environment;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.FragmentActivity; import androidx.fragment.app.FragmentActivity;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.nononsenseapps.filepicker.FilePickerActivity; import com.nononsenseapps.filepicker.FilePickerActivity;
import com.nononsenseapps.filepicker.Utils; import com.nononsenseapps.filepicker.Utils;
@ -126,7 +126,7 @@ public final class FileBrowserHelper
setToSortedDelimitedString(validExtensions)); setToSortedDelimitedString(validExtensions));
} }
new AlertDialog.Builder(context) new MaterialAlertDialogBuilder(context)
.setMessage(message) .setMessage(message)
.setPositiveButton(R.string.yes, (dialogInterface, i) -> runnable.run()) .setPositiveButton(R.string.yes, (dialogInterface, i) -> runnable.run())
.setNegativeButton(R.string.no, null) .setNegativeButton(R.string.no, null)

View File

@ -0,0 +1,107 @@
package org.dolphinemu.dolphinemu.utils;
import android.app.Activity;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.os.Build;
import android.preference.PreferenceManager;
import org.dolphinemu.dolphinemu.R;
import org.dolphinemu.dolphinemu.ui.main.ThemeProvider;
public class ThemeHelper
{
public static final String CURRENT_THEME = "current_theme";
public static final int DEFAULT = 0;
public static final int MONET = 1;
public static final int MATERIAL_DEFAULT = 2;
public static final int GREEN = 3;
public static final int PINK = 4;
public static void setTheme(Activity activity)
{
// We have to use shared preferences in addition to Dolphin's settings to guarantee that the
// requested theme id is ready before the onCreate method of any given Activity.
SharedPreferences preferences =
PreferenceManager.getDefaultSharedPreferences(activity.getApplicationContext());
switch (preferences.getInt(CURRENT_THEME, DEFAULT))
{
case DEFAULT:
activity.setTheme(R.style.Theme_Dolphin_Main);
activity.getWindow()
.setStatusBarColor(activity.getResources().getColor(R.color.dolphin_surface));
break;
case MONET:
activity.setTheme(R.style.Theme_Dolphin_Main_MaterialYou);
int currentNightMode = activity.getResources().getConfiguration().uiMode &
Configuration.UI_MODE_NIGHT_MASK;
switch (currentNightMode)
{
case Configuration.UI_MODE_NIGHT_NO:
activity.getWindow().setStatusBarColor(
activity.getResources().getColor(R.color.m3_sys_color_dynamic_light_surface));
break;
case Configuration.UI_MODE_NIGHT_YES:
activity.getWindow().setStatusBarColor(
activity.getResources().getColor(R.color.m3_sys_color_dynamic_dark_surface));
break;
}
break;
case MATERIAL_DEFAULT:
activity.setTheme(R.style.Theme_Dolphin_Main_Material);
activity.getWindow()
.setStatusBarColor(activity.getResources().getColor(R.color.dolphin_surface));
break;
case GREEN:
activity.setTheme(R.style.Theme_Dolphin_Main_Green);
activity.getWindow()
.setStatusBarColor(activity.getResources().getColor(R.color.green_surface));
break;
case PINK:
activity.setTheme(R.style.Theme_Dolphin_Main_Pink);
activity.getWindow()
.setStatusBarColor(activity.getResources().getColor(R.color.pink_surface));
break;
}
// Since the top app bar matches the color of the status bar, devices below API 23 have to get a
// black status bar since their icons do not adapt based on background color
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M)
{
activity.getWindow()
.setStatusBarColor(activity.getResources().getColor(android.R.color.black));
}
}
public static void saveTheme(Activity activity, int themeValue)
{
SharedPreferences preferences =
PreferenceManager.getDefaultSharedPreferences(activity.getApplicationContext());
preferences.edit().putInt(CURRENT_THEME, themeValue).apply();
}
public static void deleteThemeKey(Activity activity)
{
SharedPreferences preferences =
PreferenceManager.getDefaultSharedPreferences(activity.getApplicationContext());
preferences.edit().remove(CURRENT_THEME).apply();
activity.setTheme(R.style.Theme_Dolphin_Main);
activity.recreate();
}
public static void setCorrectTheme(Activity activity)
{
int currentTheme = ((ThemeProvider) activity).getThemeId();
setTheme(activity);
if (currentTheme != ((ThemeProvider) activity).getThemeId())
{
activity.recreate();
}
}
}

View File

@ -10,6 +10,8 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AlertDialog;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import org.dolphinemu.dolphinemu.R; import org.dolphinemu.dolphinemu.R;
import java.util.function.Supplier; import java.util.function.Supplier;
@ -27,12 +29,14 @@ public class ThreadUtil
@Nullable DialogInterface.OnDismissListener onResultDismiss) @Nullable DialogInterface.OnDismissListener onResultDismiss)
{ {
Resources resources = activity.getResources(); Resources resources = activity.getResources();
AlertDialog progressDialog = new AlertDialog.Builder(activity) AlertDialog progressDialog = new MaterialAlertDialogBuilder(activity)
.setTitle(progressTitle)
.setCancelable(false)
.create(); .create();
progressDialog.setTitle(progressTitle);
if (progressMessage != 0) if (progressMessage != 0)
progressDialog.setMessage(resources.getString(progressMessage)); progressDialog.setMessage(resources.getString(progressMessage));
progressDialog.setCancelable(false);
progressDialog.show(); progressDialog.show();
new Thread(() -> new Thread(() ->
@ -44,12 +48,11 @@ public class ThreadUtil
if (result != null) if (result != null)
{ {
AlertDialog.Builder builder = new MaterialAlertDialogBuilder(activity)
new AlertDialog.Builder(activity); .setMessage(result)
builder.setMessage(result); .setPositiveButton(R.string.ok, (dialog, i) -> dialog.dismiss())
builder.setPositiveButton(R.string.ok, (dialog, i) -> dialog.dismiss()); .setOnDismissListener(onResultDismiss)
builder.setOnDismissListener(onResultDismiss); .show();
builder.show();
} }
}); });
}, resources.getString(progressTitle)).start(); }, resources.getString(progressTitle)).start();

View File

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:color="@color/dolphin_blue_secondary"
android:state_focused="true"/>
<item
android:color="@android:color/white"/>
</selector>

View File

@ -4,6 +4,6 @@
android:viewportWidth="24" android:viewportWidth="24"
android:viewportHeight="24"> android:viewportHeight="24">
<path <path
android:fillColor="@android:color/white" android:fillColor="?attr/colorControlNormal"
android:pathData="M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/> android:pathData="M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/>
</vector> </vector>

View File

@ -4,6 +4,6 @@
android:viewportWidth="24" android:viewportWidth="24"
android:viewportHeight="24"> android:viewportHeight="24">
<path <path
android:fillColor="@android:color/white" android:fillColor="?attr/colorOnSurface"
android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/> android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/>
</vector> </vector>

View File

@ -4,6 +4,6 @@
android:viewportWidth="24" android:viewportWidth="24"
android:viewportHeight="24"> android:viewportHeight="24">
<path <path
android:fillColor="@android:color/white" android:fillColor="?attr/colorPrimary"
android:pathData="M10,4H4c-1.1,0 -1.99,0.9 -1.99,2L2,18c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2V8c0,-1.1 -0.9,-2 -2,-2h-8l-2,-2z"/> android:pathData="M10,4H4c-1.1,0 -1.99,0.9 -1.99,2L2,18c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2V8c0,-1.1 -0.9,-2 -2,-2h-8l-2,-2z"/>
</vector> </vector>

View File

@ -5,5 +5,5 @@
android:viewportHeight="24"> android:viewportHeight="24">
<path <path
android:fillColor="@android:color/white" android:fillColor="@android:color/white"
android:pathData="M17,3L5,3c-1.11,0 -2,0.9 -2,2v14c0,1.1 0.89,2 2,2h14c1.1,0 2,-0.9 2,-2L21,7l-4,-4zM12,19c-1.66,0 -3,-1.34 -3,-3s1.34,-3 3,-3 3,1.34 3,3 -1.34,3 -3,3zM15,9L5,9L5,5h10v4z"/> android:pathData="M10,4H4c-1.1,0 -1.99,0.9 -1.99,2L2,18c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2V8c0,-1.1 -0.9,-2 -2,-2h-8l-2,-2z"/>
</vector> </vector>

View File

@ -3,14 +3,14 @@
android:width="24dp" android:width="24dp"
android:viewportHeight="1402" android:viewportHeight="1402"
android:viewportWidth="1402" > android:viewportWidth="1402" >
<path android:fillColor="#ffffff" <path android:fillColor="?attr/colorPrimary"
android:pathData="M634.7,41.1c-38.4,21.9 -70.2,39.9 -70.7,39.9 -0.4,-0 -7,3.6 -14.6,7.9 -23,13.1 -339.6,193.5 -387.6,220.9 -24.7,14 -44.8,25.7 -44.8,26.1 0.1,0.3 40.9,25 90.7,54.9l90.7,54.3 40,-23c22.1,-12.6 113.2,-64.8 202.5,-116 89.3,-51.2 162.7,-93.1 163.2,-93.1 0.4,-0 64.6,38.3 142.6,85.1 78,46.8 142.3,85.3 142.9,85.6 1.1,0.4 44.5,-25.1 49.5,-29.1 1.4,-1.2 32.1,-19.7 68.1,-41.1 53.6,-31.9 65.2,-39.2 63.9,-40.1 -3,-2 -464.3,-271.6 -465.5,-271.9 -0.6,-0.2 -32.5,17.6 -70.9,39.6z"/> android:pathData="M634.7,41.1c-38.4,21.9 -70.2,39.9 -70.7,39.9 -0.4,-0 -7,3.6 -14.6,7.9 -23,13.1 -339.6,193.5 -387.6,220.9 -24.7,14 -44.8,25.7 -44.8,26.1 0.1,0.3 40.9,25 90.7,54.9l90.7,54.3 40,-23c22.1,-12.6 113.2,-64.8 202.5,-116 89.3,-51.2 162.7,-93.1 163.2,-93.1 0.4,-0 64.6,38.3 142.6,85.1 78,46.8 142.3,85.3 142.9,85.6 1.1,0.4 44.5,-25.1 49.5,-29.1 1.4,-1.2 32.1,-19.7 68.1,-41.1 53.6,-31.9 65.2,-39.2 63.9,-40.1 -3,-2 -464.3,-271.6 -465.5,-271.9 -0.6,-0.2 -32.5,17.6 -70.9,39.6z"/>
<path android:fillColor="#ffffff" <path android:fillColor="?attr/colorPrimary"
android:pathData="M99,369.2c0,17.1 -4.4,473.4 -6.2,644l-0.3,26.7 13,7.7c7.2,4.2 72.6,42.9 145.5,85.9 72.9,43 178.9,105.5 235.5,139 56.7,33.4 126.5,74.7 155.2,91.6 28.7,17 52.5,30.9 52.8,30.9 0.3,-0 0.5,-48.5 0.5,-107.8l0,-107.7 -207.5,-117 -207.5,-117 0,-244 0,-244 -88.1,-54c-48.5,-29.7 -89.2,-54.6 -90.5,-55.3l-2.4,-1.3 0,22.3z"/> android:pathData="M99,369.2c0,17.1 -4.4,473.4 -6.2,644l-0.3,26.7 13,7.7c7.2,4.2 72.6,42.9 145.5,85.9 72.9,43 178.9,105.5 235.5,139 56.7,33.4 126.5,74.7 155.2,91.6 28.7,17 52.5,30.9 52.8,30.9 0.3,-0 0.5,-48.5 0.5,-107.8l0,-107.7 -207.5,-117 -207.5,-117 0,-244 0,-244 -88.1,-54c-48.5,-29.7 -89.2,-54.6 -90.5,-55.3l-2.4,-1.3 0,22.3z"/>
<path android:fillColor="#ffffff" <path android:fillColor="?attr/colorPrimary"
android:pathData="M1268.5,378.6c-22,12.9 -154.5,93 -294.5,178.2l-254.5,154.9 -0.3,152.1 -0.2,152.1 6.7,-3.8c9.6,-5.4 164.8,-91.9 213.3,-118.9 22.3,-12.3 41,-23 41.6,-23.6 0.8,-0.7 1.7,-18.8 2.9,-55.6 0.9,-30 1.9,-54.8 2.1,-55.2 0.9,-1.4 137.3,-82.8 138.8,-82.8 1.4,-0 1.6,13.3 1.6,133.2l0,133.3 -43.3,25.1c-38.1,22.2 -114.5,66.5 -308.2,179.1l-55,32 -0.3,106.6c-0.1,58.7 0,106.7 0.2,106.7 0.2,-0 75.2,-42.8 166.7,-95.1 91.5,-52.3 168.2,-95.9 170.4,-96.9 3.8,-1.7 249.3,-141.5 250.5,-142.6 0.4,-0.4 2,-701.7 1.6,-702 -0.1,-0 -18.1,10.4 -40.1,23.2z"/> android:pathData="M1268.5,378.6c-22,12.9 -154.5,93 -294.5,178.2l-254.5,154.9 -0.3,152.1 -0.2,152.1 6.7,-3.8c9.6,-5.4 164.8,-91.9 213.3,-118.9 22.3,-12.3 41,-23 41.6,-23.6 0.8,-0.7 1.7,-18.8 2.9,-55.6 0.9,-30 1.9,-54.8 2.1,-55.2 0.9,-1.4 137.3,-82.8 138.8,-82.8 1.4,-0 1.6,13.3 1.6,133.2l0,133.3 -43.3,25.1c-38.1,22.2 -114.5,66.5 -308.2,179.1l-55,32 -0.3,106.6c-0.1,58.7 0,106.7 0.2,106.7 0.2,-0 75.2,-42.8 166.7,-95.1 91.5,-52.3 168.2,-95.9 170.4,-96.9 3.8,-1.7 249.3,-141.5 250.5,-142.6 0.4,-0.4 2,-701.7 1.6,-702 -0.1,-0 -18.1,10.4 -40.1,23.2z"/>
<path android:fillColor="#ffffff" <path android:fillColor="?attr/colorPrimary"
android:pathData="M576.5,451.1c-74.2,42.4 -135.4,77.4 -135.8,77.9 -0.5,0.4 59.2,36.8 132.7,80.9l133.5,80.2 134.6,-78.3c74,-43 134.2,-78.5 133.8,-78.9 -0.5,-0.4 -59,-35.6 -130.1,-78.3 -71.1,-42.7 -130.3,-78.3 -131.5,-79.1 -2.1,-1.3 -10.4,3.3 -137.2,75.6z"/> android:pathData="M576.5,451.1c-74.2,42.4 -135.4,77.4 -135.8,77.9 -0.5,0.4 59.2,36.8 132.7,80.9l133.5,80.2 134.6,-78.3c74,-43 134.2,-78.5 133.8,-78.9 -0.5,-0.4 -59,-35.6 -130.1,-78.3 -71.1,-42.7 -130.3,-78.3 -131.5,-79.1 -2.1,-1.3 -10.4,3.3 -137.2,75.6z"/>
<path android:fillColor="#ffffff" <path android:fillColor="?attr/colorPrimary"
android:pathData="M428,554.1c0,3 -0.7,59.4 -1.5,125.4 -0.8,66 -1.5,133.3 -1.6,149.5l-0.1,29.5 65.3,37.8c163.7,94.7 202.2,116.9 203.5,117.4 1.2,0.4 1.4,-21.1 1.2,-150.7l-0.3,-151.3 -132,-81c-72.6,-44.5 -132.6,-81.1 -133.2,-81.4 -1,-0.4 -1.3,1 -1.3,4.8z"/> android:pathData="M428,554.1c0,3 -0.7,59.4 -1.5,125.4 -0.8,66 -1.5,133.3 -1.6,149.5l-0.1,29.5 65.3,37.8c163.7,94.7 202.2,116.9 203.5,117.4 1.2,0.4 1.4,-21.1 1.2,-150.7l-0.3,-151.3 -132,-81c-72.6,-44.5 -132.6,-81.1 -133.2,-81.4 -1,-0.4 -1.3,1 -1.3,4.8z"/>
</vector> </vector>

View File

@ -4,6 +4,6 @@
android:viewportWidth="24" android:viewportWidth="24"
android:viewportHeight="24"> android:viewportHeight="24">
<path <path
android:fillColor="@android:color/white" android:fillColor="?attr/colorControlNormal"
android:pathData="M8,5v14l11,-7z"/> android:pathData="M8,5v14l11,-7z"/>
</vector> </vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M8,5v14l11,-7z"/>
</vector>

View File

@ -4,6 +4,6 @@
android:viewportWidth="24" android:viewportWidth="24"
android:viewportHeight="24"> android:viewportHeight="24">
<path <path
android:fillColor="@android:color/white" android:fillColor="?attr/colorControlNormal"
android:pathData="M17.65,6.35C16.2,4.9 14.21,4 12,4c-4.42,0 -7.99,3.58 -7.99,8s3.57,8 7.99,8c3.73,0 6.84,-2.55 7.73,-6h-2.08c-0.82,2.33 -3.04,4 -5.65,4 -3.31,0 -6,-2.69 -6,-6s2.69,-6 6,-6c1.66,0 3.14,0.69 4.22,1.78L13,11h7V4l-2.35,2.35z"/> android:pathData="M17.65,6.35C16.2,4.9 14.21,4 12,4c-4.42,0 -7.99,3.58 -7.99,8s3.57,8 7.99,8c3.73,0 6.84,-2.55 7.73,-6h-2.08c-0.82,2.33 -3.04,4 -5.65,4 -3.31,0 -6,-2.69 -6,-6s2.69,-6 6,-6c1.66,0 3.14,0.69 4.22,1.78L13,11h7V4l-2.35,2.35z"/>
</vector> </vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M17.65,6.35C16.2,4.9 14.21,4 12,4c-4.42,0 -7.99,3.58 -7.99,8s3.57,8 7.99,8c3.73,0 6.84,-2.55 7.73,-6h-2.08c-0.82,2.33 -3.04,4 -5.65,4 -3.31,0 -6,-2.69 -6,-6s2.69,-6 6,-6c1.66,0 3.14,0.69 4.22,1.78L13,11h7V4l-2.35,2.35z"/>
</vector>

View File

@ -1,12 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M12,12m-3.2,0a3.2,3.2 0,1 1,6.4 0a3.2,3.2 0,1 1,-6.4 0"/>
<path
android:fillColor="@android:color/white"
android:pathData="M9,2L7.17,4L4,4c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2L22,6c0,-1.1 -0.9,-2 -2,-2h-3.17L15,2L9,2zM12,17c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5z"/>
</vector>

View File

@ -4,6 +4,6 @@
android:viewportWidth="24" android:viewportWidth="24"
android:viewportHeight="24"> android:viewportHeight="24">
<path <path
android:fillColor="@android:color/white" android:fillColor="?attr/colorControlNormal"
android:pathData="M19.14,12.94c0.04,-0.3 0.06,-0.61 0.06,-0.94c0,-0.32 -0.02,-0.64 -0.07,-0.94l2.03,-1.58c0.18,-0.14 0.23,-0.41 0.12,-0.61l-1.92,-3.32c-0.12,-0.22 -0.37,-0.29 -0.59,-0.22l-2.39,0.96c-0.5,-0.38 -1.03,-0.7 -1.62,-0.94L14.4,2.81c-0.04,-0.24 -0.24,-0.41 -0.48,-0.41h-3.84c-0.24,0 -0.43,0.17 -0.47,0.41L9.25,5.35C8.66,5.59 8.12,5.92 7.63,6.29L5.24,5.33c-0.22,-0.08 -0.47,0 -0.59,0.22L2.74,8.87C2.62,9.08 2.66,9.34 2.86,9.48l2.03,1.58C4.84,11.36 4.8,11.69 4.8,12s0.02,0.64 0.07,0.94l-2.03,1.58c-0.18,0.14 -0.23,0.41 -0.12,0.61l1.92,3.32c0.12,0.22 0.37,0.29 0.59,0.22l2.39,-0.96c0.5,0.38 1.03,0.7 1.62,0.94l0.36,2.54c0.05,0.24 0.24,0.41 0.48,0.41h3.84c0.24,0 0.44,-0.17 0.47,-0.41l0.36,-2.54c0.59,-0.24 1.13,-0.56 1.62,-0.94l2.39,0.96c0.22,0.08 0.47,0 0.59,-0.22l1.92,-3.32c0.12,-0.22 0.07,-0.47 -0.12,-0.61L19.14,12.94zM12,15.6c-1.98,0 -3.6,-1.62 -3.6,-3.6s1.62,-3.6 3.6,-3.6s3.6,1.62 3.6,3.6S13.98,15.6 12,15.6z"/> android:pathData="M19.14,12.94c0.04,-0.3 0.06,-0.61 0.06,-0.94c0,-0.32 -0.02,-0.64 -0.07,-0.94l2.03,-1.58c0.18,-0.14 0.23,-0.41 0.12,-0.61l-1.92,-3.32c-0.12,-0.22 -0.37,-0.29 -0.59,-0.22l-2.39,0.96c-0.5,-0.38 -1.03,-0.7 -1.62,-0.94L14.4,2.81c-0.04,-0.24 -0.24,-0.41 -0.48,-0.41h-3.84c-0.24,0 -0.43,0.17 -0.47,0.41L9.25,5.35C8.66,5.59 8.12,5.92 7.63,6.29L5.24,5.33c-0.22,-0.08 -0.47,0 -0.59,0.22L2.74,8.87C2.62,9.08 2.66,9.34 2.86,9.48l2.03,1.58C4.84,11.36 4.8,11.69 4.8,12s0.02,0.64 0.07,0.94l-2.03,1.58c-0.18,0.14 -0.23,0.41 -0.12,0.61l1.92,3.32c0.12,0.22 0.37,0.29 0.59,0.22l2.39,-0.96c0.5,0.38 1.03,0.7 1.62,0.94l0.36,2.54c0.05,0.24 0.24,0.41 0.48,0.41h3.84c0.24,0 0.44,-0.17 0.47,-0.41l0.36,-2.54c0.59,-0.24 1.13,-0.56 1.62,-0.94l2.39,0.96c0.22,0.08 0.47,0 0.59,-0.22l1.92,-3.32c0.12,-0.22 0.07,-0.47 -0.12,-0.61L19.14,12.94zM12,15.6c-1.98,0 -3.6,-1.62 -3.6,-3.6s1.62,-3.6 3.6,-3.6s3.6,1.62 3.6,3.6S13.98,15.6 12,15.6z"/>
</vector> </vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M19.14,12.94c0.04,-0.3 0.06,-0.61 0.06,-0.94c0,-0.32 -0.02,-0.64 -0.07,-0.94l2.03,-1.58c0.18,-0.14 0.23,-0.41 0.12,-0.61l-1.92,-3.32c-0.12,-0.22 -0.37,-0.29 -0.59,-0.22l-2.39,0.96c-0.5,-0.38 -1.03,-0.7 -1.62,-0.94L14.4,2.81c-0.04,-0.24 -0.24,-0.41 -0.48,-0.41h-3.84c-0.24,0 -0.43,0.17 -0.47,0.41L9.25,5.35C8.66,5.59 8.12,5.92 7.63,6.29L5.24,5.33c-0.22,-0.08 -0.47,0 -0.59,0.22L2.74,8.87C2.62,9.08 2.66,9.34 2.86,9.48l2.03,1.58C4.84,11.36 4.8,11.69 4.8,12s0.02,0.64 0.07,0.94l-2.03,1.58c-0.18,0.14 -0.23,0.41 -0.12,0.61l1.92,3.32c0.12,0.22 0.37,0.29 0.59,0.22l2.39,-0.96c0.5,0.38 1.03,0.7 1.62,0.94l0.36,2.54c0.05,0.24 0.24,0.41 0.48,0.41h3.84c0.24,0 0.44,-0.17 0.47,-0.41l0.36,-2.54c0.59,-0.24 1.13,-0.56 1.62,-0.94l2.39,0.96c0.22,0.08 0.47,0 0.59,-0.22l1.92,-3.32c0.12,-0.22 0.07,-0.47 -0.12,-0.61L19.14,12.94zM12,15.6c-1.98,0 -3.6,-1.62 -3.6,-3.6s1.62,-3.6 3.6,-3.6s3.6,1.62 3.6,3.6S13.98,15.6 12,15.6z"/>
</vector>

View File

@ -4,14 +4,14 @@
android:width="24dp" android:width="24dp"
android:viewportHeight="2157" android:viewportHeight="2157"
android:viewportWidth="2157"> android:viewportWidth="2157">
<path android:fillColor="#ffffff" <path android:fillColor="?attr/colorPrimary"
android:pathData="M1593,564.1c-55.8,6.9 -99.4,51 -105,106.4 -5.7,55.8 33.7,110.3 90.9,125.7 9.6,2.6 35.1,3.6 47.3,1.9 17,-2.5 38,-9.2 50.8,-16.3 18.8,-10.4 35.9,-28.5 45.9,-48.6 15.9,-31.7 16,-73.6 0.4,-104.7 -6.1,-11.9 -17.7,-25.6 -32.4,-37.8 -21.3,-17.7 -45.2,-26.1 -77.9,-27.2 -6.9,-0.2 -15.9,-0 -20,0.6z"/> android:pathData="M1593,564.1c-55.8,6.9 -99.4,51 -105,106.4 -5.7,55.8 33.7,110.3 90.9,125.7 9.6,2.6 35.1,3.6 47.3,1.9 17,-2.5 38,-9.2 50.8,-16.3 18.8,-10.4 35.9,-28.5 45.9,-48.6 15.9,-31.7 16,-73.6 0.4,-104.7 -6.1,-11.9 -17.7,-25.6 -32.4,-37.8 -21.3,-17.7 -45.2,-26.1 -77.9,-27.2 -6.9,-0.2 -15.9,-0 -20,0.6z"/>
<path android:fillColor="#ffffff" <path android:fillColor="?attr/colorPrimary"
android:pathData="M2014.5,564.2c-12.5,1.4 -26,5.4 -38.1,11.2 -53.2,26 -79.8,86.4 -61.8,140.5 13.7,41.4 50.1,73.6 92.2,81.7 4.1,0.8 13.4,1.4 21.2,1.4 40.9,-0 78.8,-15.8 100.6,-41.9 32.4,-38.7 37.2,-94.7 11.7,-136 -5.9,-9.6 -27.8,-31.7 -38.4,-38.7 -21.7,-14.5 -56.5,-21.7 -87.4,-18.2z"/> android:pathData="M2014.5,564.2c-12.5,1.4 -26,5.4 -38.1,11.2 -53.2,26 -79.8,86.4 -61.8,140.5 13.7,41.4 50.1,73.6 92.2,81.7 4.1,0.8 13.4,1.4 21.2,1.4 40.9,-0 78.8,-15.8 100.6,-41.9 32.4,-38.7 37.2,-94.7 11.7,-136 -5.9,-9.6 -27.8,-31.7 -38.4,-38.7 -21.7,-14.5 -56.5,-21.7 -87.4,-18.2z"/>
<path android:fillColor="#ffffff" <path android:fillColor="?attr/colorPrimary"
android:pathData="M677.5,613.6c-19.6,2.7 -27.7,5 -41.5,11.9 -15.9,8.1 -29.9,19.3 -41.1,33.2 -19.9,24.8 -26.1,41.5 -56.3,152.3 -18.2,66.9 -62.7,235.8 -115.2,437.5 -10.9,41.8 -20,76.3 -20.3,76.7 -0.3,0.4 -12.2,-45.1 -26.5,-101 -95.8,-376.4 -151.6,-593.9 -154.1,-600.4 -0.4,-0.9 -1.6,-1.9 -2.8,-2.2 -3,-0.8 -218.7,-0.8 -218.7,-0 0,0.7 4.4,16.5 74.6,268.9 110.9,398.3 151.9,542.4 166.4,585 8.7,25.6 18.4,43 35,62.8 20,23.8 49.2,43.9 74.3,51.1 16.9,4.9 54.5,5.9 76.5,2 16.1,-2.8 35.2,-11 50.2,-21.5 9.7,-6.8 27.9,-25.1 35.4,-35.8 12.9,-18.1 23.4,-39.3 31.8,-64.1 7.1,-20.9 37,-127.4 84.9,-302 38.7,-140.8 63.4,-228.5 68.7,-244l1.9,-5.5 1.1,3.5c1.8,5.7 9.3,33 54.2,197.5 69.4,254.4 85.1,310.1 99.4,352 14.2,41.8 23,57 46.6,80.5 24.3,24.1 41.9,34.1 69.8,39.7 12.3,2.4 51.8,2.5 64.8,-0 52,-9.6 98.8,-53.9 119.4,-113.2 18.9,-54.6 62.3,-206.4 192.9,-676 22,-79.2 42.3,-151.9 45,-161.5 2.7,-9.6 4.5,-17.9 4.1,-18.4 -1.7,-1.7 -38.9,-2.5 -128.7,-2.5 -86.9,-0.1 -92.2,-0 -92.7,1.6 -0.3,1 -19.9,77.8 -43.6,170.8 -76.7,300.5 -110.5,431.6 -126.5,490 -10.1,36.8 -10.5,38.2 -11.5,36.5 -1.1,-2.1 -12.2,-43.8 -59.5,-224.5 -91.7,-350.5 -101.4,-385.3 -113.9,-409.9 -18.6,-36.6 -49.5,-61.4 -86.1,-69.2 -6.7,-1.5 -50.7,-2.8 -58,-1.8z"/> android:pathData="M677.5,613.6c-19.6,2.7 -27.7,5 -41.5,11.9 -15.9,8.1 -29.9,19.3 -41.1,33.2 -19.9,24.8 -26.1,41.5 -56.3,152.3 -18.2,66.9 -62.7,235.8 -115.2,437.5 -10.9,41.8 -20,76.3 -20.3,76.7 -0.3,0.4 -12.2,-45.1 -26.5,-101 -95.8,-376.4 -151.6,-593.9 -154.1,-600.4 -0.4,-0.9 -1.6,-1.9 -2.8,-2.2 -3,-0.8 -218.7,-0.8 -218.7,-0 0,0.7 4.4,16.5 74.6,268.9 110.9,398.3 151.9,542.4 166.4,585 8.7,25.6 18.4,43 35,62.8 20,23.8 49.2,43.9 74.3,51.1 16.9,4.9 54.5,5.9 76.5,2 16.1,-2.8 35.2,-11 50.2,-21.5 9.7,-6.8 27.9,-25.1 35.4,-35.8 12.9,-18.1 23.4,-39.3 31.8,-64.1 7.1,-20.9 37,-127.4 84.9,-302 38.7,-140.8 63.4,-228.5 68.7,-244l1.9,-5.5 1.1,3.5c1.8,5.7 9.3,33 54.2,197.5 69.4,254.4 85.1,310.1 99.4,352 14.2,41.8 23,57 46.6,80.5 24.3,24.1 41.9,34.1 69.8,39.7 12.3,2.4 51.8,2.5 64.8,-0 52,-9.6 98.8,-53.9 119.4,-113.2 18.9,-54.6 62.3,-206.4 192.9,-676 22,-79.2 42.3,-151.9 45,-161.5 2.7,-9.6 4.5,-17.9 4.1,-18.4 -1.7,-1.7 -38.9,-2.5 -128.7,-2.5 -86.9,-0.1 -92.2,-0 -92.7,1.6 -0.3,1 -19.9,77.8 -43.6,170.8 -76.7,300.5 -110.5,431.6 -126.5,490 -10.1,36.8 -10.5,38.2 -11.5,36.5 -1.1,-2.1 -12.2,-43.8 -59.5,-224.5 -91.7,-350.5 -101.4,-385.3 -113.9,-409.9 -18.6,-36.6 -49.5,-61.4 -86.1,-69.2 -6.7,-1.5 -50.7,-2.8 -58,-1.8z"/>
<path android:fillColor="#ffffff" <path android:fillColor="?attr/colorPrimary"
android:pathData="M1509,1250.5l0,336.5 104.5,-0 104.5,-0 0,-336.5 0,-336.5 -104.5,-0 -104.5,-0 0,336.5z"/> android:pathData="M1509,1250.5l0,336.5 104.5,-0 104.5,-0 0,-336.5 0,-336.5 -104.5,-0 -104.5,-0 0,336.5z"/>
<path android:fillColor="#ffffff" <path android:fillColor="?attr/colorPrimary"
android:pathData="M1930,1250.5l0,336.5 104.8,-0.2 104.7,-0.3 0.3,-336.3 0.2,-336.2 -105,-0 -105,-0 0,336.5z"/> android:pathData="M1930,1250.5l0,336.5 104.8,-0.2 104.7,-0.3 0.3,-336.3 0.2,-336.2 -105,-0 -105,-0 0,336.5z"/>
</vector> </vector>

View File

@ -2,7 +2,7 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <selector xmlns:android="http://schemas.android.com/apk/res/android">
<item <item
android:state_selected="true" android:state_selected="true"
android:drawable="@color/dolphin_blue"/> android:drawable="@color/dolphin_primary"/>
<item <item
android:drawable="@color/tv_card_unselected"/> android:drawable="@color/tv_card_unselected"/>
</selector> </selector>

View File

@ -1,22 +1,39 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar_user_data"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar_user_data"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorSurface" />
</com.google.android.material.appbar.AppBarLayout>
<TextView <TextView
android:id="@+id/text_type" android:id="@+id/text_type"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="@dimen/spacing_medlarge" android:layout_margin="@dimen/spacing_medlarge"
tools:text="@string/user_data_new_location"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@id/divider"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@id/text_path" app:layout_constraintBottom_toTopOf="@id/text_path"
app:layout_constraintEnd_toStartOf="@id/divider"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/appbar_user_data"
app:layout_constraintVertical_chainStyle="packed" app:layout_constraintVertical_chainStyle="packed"
app:layout_constraintWidth_max="400dp" /> app:layout_constraintWidth_max="400dp"
tools:text="@string/user_data_new_location" />
<TextView <TextView
android:id="@+id/text_path" android:id="@+id/text_path"
@ -74,11 +91,10 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="@dimen/spacing_small" android:layout_margin="@dimen/spacing_small"
android:text="@string/user_data_open_system_file_manager" android:text="@string/user_data_open_system_file_manager"
android:textColor="@color/dolphin_white"
app:layout_constraintStart_toEndOf="@id/divider"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@id/button_import_user_data" app:layout_constraintBottom_toTopOf="@id/button_import_user_data"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/barrier_text"
app:layout_constraintTop_toBottomOf="@+id/appbar_user_data"
app:layout_constraintVertical_chainStyle="packed" app:layout_constraintVertical_chainStyle="packed"
app:layout_constraintWidth_max="400dp" /> app:layout_constraintWidth_max="400dp" />
@ -88,8 +104,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="@dimen/spacing_small" android:layout_margin="@dimen/spacing_small"
android:text="@string/user_data_import" android:text="@string/user_data_import"
android:textColor="@color/dolphin_white" app:layout_constraintStart_toEndOf="@id/barrier_text"
app:layout_constraintStart_toEndOf="@id/divider"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/button_open_system_file_manager" app:layout_constraintTop_toBottomOf="@id/button_open_system_file_manager"
app:layout_constraintBottom_toTopOf="@id/button_export_user_data" app:layout_constraintBottom_toTopOf="@id/button_export_user_data"
@ -101,8 +116,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="@dimen/spacing_small" android:layout_margin="@dimen/spacing_small"
android:text="@string/user_data_export" android:text="@string/user_data_export"
android:textColor="@color/dolphin_white" app:layout_constraintStart_toEndOf="@id/barrier_text"
app:layout_constraintStart_toEndOf="@id/divider"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/button_import_user_data" app:layout_constraintTop_toBottomOf="@id/button_import_user_data"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"

View File

@ -29,7 +29,6 @@
android:focusable="true" android:focusable="true"
android:gravity="center" android:gravity="center"
android:nextFocusRight="@id/root" android:nextFocusRight="@id/root"
android:buttonTint="@color/dolphin_blue"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/text_name" app:layout_constraintStart_toEndOf="@id/text_name"

View File

@ -38,8 +38,6 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:padding="@dimen/spacing_small" android:padding="@dimen/spacing_small"
android:background="@color/dolphin_blue"
android:textColor="@color/lb_tv_white"
android:text="@string/emulation_done" android:text="@string/emulation_done"
android:visibility="gone"/> android:visibility="gone"/>

View File

@ -1,22 +1,42 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.slidingpanelayout.widget.SlidingPaneLayout <androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/sliding_pane_layout" android:id="@+id/coordinator_main"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<androidx.fragment.app.FragmentContainerView <com.google.android.material.appbar.AppBarLayout
android:layout_width="320dp" android:id="@+id/appbar_cheats"
android:layout_height="match_parent" android:layout_width="match_parent"
android:layout_weight="1" android:layout_height="wrap_content"
android:id="@+id/cheat_list" android:layout_alignParentTop="true">
android:name="org.dolphinemu.dolphinemu.features.cheats.ui.CheatListFragment" />
<androidx.fragment.app.FragmentContainerView <com.google.android.material.appbar.MaterialToolbar
android:layout_width="320dp" android:id="@+id/toolbar_cheats"
android:layout_height="match_parent" android:layout_width="match_parent"
android:layout_weight="1" android:layout_height="wrap_content"
android:id="@+id/cheat_details" android:background="?attr/colorSurface"/>
android:name="org.dolphinemu.dolphinemu.features.cheats.ui.CheatDetailsFragment" />
</androidx.slidingpanelayout.widget.SlidingPaneLayout> </com.google.android.material.appbar.AppBarLayout>
<androidx.slidingpanelayout.widget.SlidingPaneLayout
android:id="@+id/sliding_pane_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="56dp">
<androidx.fragment.app.FragmentContainerView
android:id="@+id/cheat_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:name="org.dolphinemu.dolphinemu.features.cheats.ui.CheatListFragment" />
<androidx.fragment.app.FragmentContainerView
android:id="@+id/cheat_details"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:name="org.dolphinemu.dolphinemu.features.cheats.ui.CheatDetailsFragment" />
</androidx.slidingpanelayout.widget.SlidingPaneLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -1,35 +1,34 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/coordinator_main" android:id="@+id/coordinator_main"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<com.google.android.material.appbar.AppBarLayout <com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar" android:id="@+id/appbar_main"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content">
android:theme="@style/ThemeOverlay.MaterialComponents.Dark.ActionBar">
<androidx.appcompat.widget.Toolbar <com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar_main" android:id="@+id/toolbar_main"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize" android:layout_height="?attr/actionBarSize"
android:background="@color/dolphin_blue" android:background="?attr/colorSurface"
app:layout_scrollFlags="scroll|enterAlways" app:layout_scrollFlags="scroll|enterAlways|snap"
app:popupTheme="@style/Theme.MaterialComponents.DayNight" /> app:subtitleTextColor="?attr/colorOnSurface"
app:titleTextColor="?attr/colorOnSurface" />
<com.google.android.material.tabs.TabLayout <com.google.android.material.tabs.TabLayout
android:id="@+id/tabs_platforms" android:id="@+id/tabs_platforms"
style="@style/Widget.Design.TabLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/dolphin_blue" android:background="?attr/colorSurface"
app:tabGravity="fill" app:tabGravity="fill"
app:tabIndicatorColor="@color/dolphin_white" app:tabIndicatorColor="?attr/colorPrimary"
app:tabIndicatorHeight="3dp" app:tabIndicatorHeight="3dp"
app:tabMode="fixed" app:tabMode="fixed" />
app:tabTextAppearance="@style/MyCustomTextAppearance" />
</com.google.android.material.appbar.AppBarLayout> </com.google.android.material.appbar.AppBarLayout>
@ -37,6 +36,7 @@
android:id="@+id/pager_platforms" android:id="@+id/pager_platforms"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="?attr/colorSurface"
app:layout_behavior="@string/appbar_scrolling_view_behavior" /> app:layout_behavior="@string/appbar_scrolling_view_behavior" />
<com.google.android.material.floatingactionbutton.FloatingActionButton <com.google.android.material.floatingactionbutton.FloatingActionButton
@ -44,12 +44,8 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="16dp" android:layout_margin="16dp"
android:backgroundTint="@color/dolphin_blue"
android:minHeight="48dp"
android:src="@drawable/ic_add" android:src="@drawable/ic_add"
app:borderWidth="0dp"
app:layout_anchor="@+id/pager_platforms" app:layout_anchor="@+id/pager_platforms"
app:layout_anchorGravity="bottom|right|end" app:layout_anchorGravity="bottom|right|end" />
app:tint="@android:color/white" />
</androidx.coordinatorlayout.widget.CoordinatorLayout> </androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -1,5 +1,39 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent" xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="match_parent" xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/frame_content"/> android:id="@+id/coordinator_main"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar_settings"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true">
<com.google.android.material.appbar.CollapsingToolbarLayout
style="?attr/collapsingToolbarLayoutMediumStyle"
android:id="@+id/toolbar_settings_layout"
android:layout_width="match_parent"
android:layout_height="?attr/collapsingToolbarLayoutMediumSize"
app:layout_scrollFlags="scroll|exitUntilCollapsed|snap">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar_settings"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorSurface"
app:layout_collapseMode="pin" />
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
<FrameLayout
android:id="@+id/frame_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -1,22 +1,39 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar_user_data"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar_user_data"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorSurface" />
</com.google.android.material.appbar.AppBarLayout>
<TextView <TextView
android:id="@+id/text_type" android:id="@+id/text_type"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="@dimen/spacing_medlarge" android:layout_margin="@dimen/spacing_medlarge"
tools:text="@string/user_data_new_location"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@id/text_path" app:layout_constraintBottom_toTopOf="@id/text_path"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/appbar_user_data"
app:layout_constraintVertical_chainStyle="packed" app:layout_constraintVertical_chainStyle="packed"
app:layout_constraintWidth_max="400dp" /> app:layout_constraintWidth_max="400dp"
tools:text="@string/user_data_new_location" />
<TextView <TextView
android:id="@+id/text_path" android:id="@+id/text_path"
@ -50,7 +67,6 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="@dimen/spacing_small" android:layout_margin="@dimen/spacing_small"
android:text="@string/user_data_open_system_file_manager" android:text="@string/user_data_open_system_file_manager"
android:textColor="@color/dolphin_white"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/text_android_11" app:layout_constraintTop_toBottomOf="@id/text_android_11"
@ -62,7 +78,6 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="@dimen/spacing_small" android:layout_margin="@dimen/spacing_small"
android:text="@string/user_data_import" android:text="@string/user_data_import"
android:textColor="@color/dolphin_white"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/button_open_system_file_manager" app:layout_constraintTop_toBottomOf="@id/button_open_system_file_manager"
@ -74,7 +89,6 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="@dimen/spacing_small" android:layout_margin="@dimen/spacing_small"
android:text="@string/user_data_export" android:text="@string/user_data_export"
android:textColor="@color/dolphin_white"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/button_import_user_data" app:layout_constraintTop_toBottomOf="@id/button_import_user_data"

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.material.progressindicator.CircularProgressIndicator
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_margin="16dp"
android:indeterminate="true"
app:trackCornerRadius="2dp" />
</RelativeLayout>

View File

@ -1,102 +1,91 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical" android:orientation="vertical"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<RelativeLayout <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/input_scale" android:id="@+id/input_scale"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content">
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:clickable="false">
<TextView <TextView
android:id="@+id/input_scale_name" android:id="@+id/input_scale_name"
style="@style/TextAppearance.MaterialComponents.Headline5" android:layout_width="56dp"
android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentStart="true" android:layout_marginStart="24dp"
android:layout_alignParentTop="true" android:layout_marginEnd="@dimen/spacing_medlarge"
android:layout_marginStart="@dimen/spacing_large"
android:layout_marginTop="@dimen/spacing_large"
android:layout_marginEnd="@dimen/spacing_large"
android:text="@string/emulation_control_scale" android:text="@string/emulation_control_scale"
android:textSize="16sp" android:textSize="16sp"
tools:text="@string/overclock_enable" /> app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/input_scale_slider"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.google.android.material.slider.Slider
android:id="@+id/input_scale_slider"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintStart_toEndOf="@id/input_scale_name"
app:layout_constraintEnd_toStartOf="@id/input_scale_value"
app:layout_constraintTop_toTopOf="parent" />
<TextView <TextView
android:id="@+id/input_scale_value" android:id="@+id/input_scale_value"
android:layout_width="40dp" android:layout_width="40dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/input_scale_name" android:layout_marginStart="@dimen/spacing_medlarge"
android:layout_alignParentEnd="true" android:layout_marginEnd="24dp"
android:layout_marginStart="@dimen/spacing_small" android:gravity="end"
android:layout_marginTop="@dimen/spacing_medlarge" app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginEnd="@dimen/spacing_large" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginBottom="@dimen/spacing_large" app:layout_constraintStart_toEndOf="@id/input_scale_slider"
tools:text="99%" app:layout_constraintTop_toTopOf="parent"
android:textAlignment="textEnd"/> tools:text="100%" />
<SeekBar </androidx.constraintlayout.widget.ConstraintLayout>
android:id="@+id/input_scale_seekbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/input_scale_name"
android:layout_alignParentStart="true"
android:layout_marginTop="@dimen/spacing_medlarge"
android:layout_marginBottom="@dimen/spacing_large"
android:layout_toStartOf="@id/input_scale_value" />
</RelativeLayout> <androidx.constraintlayout.widget.ConstraintLayout
<RelativeLayout
android:id="@+id/input_opacity" android:id="@+id/input_opacity"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content">
android:layout_below="@id/input_scale"
android:layout_alignParentStart="true"
android:clickable="false">
<TextView <TextView
android:id="@+id/input_opacity_name" android:id="@+id/input_opacity_name"
style="@style/TextAppearance.MaterialComponents.Headline5" android:layout_width="56dp"
android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentStart="true" android:layout_marginStart="24dp"
android:layout_alignParentTop="true" android:layout_marginEnd="@dimen/spacing_medlarge"
android:layout_marginStart="@dimen/spacing_large"
android:layout_marginTop="@dimen/spacing_large"
android:layout_marginEnd="@dimen/spacing_large"
android:text="@string/emulation_control_opacity" android:text="@string/emulation_control_opacity"
android:textSize="16sp" android:textSize="16sp"
tools:text="@string/overclock_enable" /> app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/input_opacity_slider"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.google.android.material.slider.Slider
android:id="@+id/input_opacity_slider"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintStart_toEndOf="@id/input_opacity_name"
app:layout_constraintEnd_toStartOf="@id/input_opacity_value"
app:layout_constraintTop_toTopOf="parent" />
<TextView <TextView
android:id="@+id/input_opacity_value" android:id="@+id/input_opacity_value"
android:layout_width="40dp" android:layout_width="40dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/input_opacity_name" android:layout_marginStart="@dimen/spacing_medlarge"
android:layout_alignParentEnd="true" android:layout_marginEnd="24dp"
android:layout_marginStart="@dimen/spacing_small" android:gravity="end"
android:layout_marginTop="@dimen/spacing_medlarge" app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginEnd="@dimen/spacing_large" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginBottom="@dimen/spacing_large" app:layout_constraintStart_toEndOf="@id/input_opacity_slider"
tools:text="99%" app:layout_constraintTop_toTopOf="parent"
android:textAlignment="textEnd"/> tools:text="100%" />
<SeekBar </androidx.constraintlayout.widget.ConstraintLayout>
android:id="@+id/input_opacity_seekbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/input_opacity_name"
android:layout_alignParentStart="true"
android:layout_marginTop="@dimen/spacing_medlarge"
android:layout_marginBottom="@dimen/spacing_large"
android:layout_toStartOf="@id/input_opacity_value" />
</RelativeLayout> </androidx.appcompat.widget.LinearLayoutCompat>
</RelativeLayout>

View File

@ -1,19 +1,27 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
<EditText <com.google.android.material.textfield.TextInputLayout
android:id="@+id/input" android:id="@+id/input_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:layout_marginStart="20dp" android:hint="@string/cheats_name"
android:layout_marginEnd="20dp" android:paddingTop="@dimen/spacing_medlarge"
android:ems="10" android:layout_marginHorizontal="@dimen/spacing_large"
android:inputType="text" android:layout_marginVertical="@dimen/spacing_small">
android:importantForAutofill="no" />
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/input"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="48dp"
android:importantForAutofill="no"
android:inputType="text"/>
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout> </LinearLayout>

View File

@ -1,115 +1,132 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" xmlns:tools="http://schemas.android.com/tools"
android:layout_height="wrap_content" android:layout_width="match_parent"
android:orientation="vertical"> android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="1"> android:layout_weight="1">
<SeekBar <com.google.android.material.slider.Slider
android:id="@+id/seekbar_width" android:id="@+id/slider_width"
android:layout_width="match_parent" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentEnd="true" app:layout_constraintEnd_toStartOf="@id/text_ir_yaw"
android:layout_alignParentStart="true" app:layout_constraintStart_toEndOf="@id/text_ir_yaw_units"
android:layout_below="@+id/text_ir_yaw" app:layout_constraintTop_toTopOf="parent" />
android:layout_marginBottom="@dimen/spacing_medlarge"
android:layout_marginLeft="@dimen/spacing_large"
android:layout_marginRight="@dimen/spacing_large"/>
<TextView <TextView
android:id="@+id/text_ir_yaw" android:id="@+id/text_ir_yaw"
android:layout_width="wrap_content" android:layout_width="26dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentTop="true" android:layout_marginEnd="24dp"
android:layout_centerHorizontal="true" android:layout_marginStart="@dimen/spacing_medlarge"
android:layout_marginBottom="@dimen/spacing_medlarge" android:gravity="end"
android:layout_marginTop="@dimen/spacing_medlarge" app:layout_constraintBottom_toBottomOf="@+id/slider_width"
tools:text="75"/> app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/slider_width"
app:layout_constraintTop_toTopOf="@+id/slider_width"
tools:text="100" />
<TextView <TextView
android:id="@+id/text_ir_yaw_units" android:id="@+id/text_ir_yaw_units"
android:layout_width="wrap_content" android:layout_width="92dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignTop="@+id/text_ir_yaw" android:gravity="start"
android:layout_toEndOf="@+id/text_ir_yaw" android:layout_marginStart="24dp"
tools:text="%"/> android:layout_marginEnd="@dimen/spacing_medlarge"
</RelativeLayout> app:layout_constraintBottom_toBottomOf="@+id/slider_width"
app:layout_constraintEnd_toStartOf="@id/slider_width"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/slider_width"
tools:text="Total Yaw" />
<RelativeLayout </androidx.constraintlayout.widget.ConstraintLayout>
android:layout_width="wrap_content"
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="1"> android:layout_weight="1">
<SeekBar <com.google.android.material.slider.Slider
android:id="@+id/seekbar_pitch" android:id="@+id/slider_pitch"
android:layout_width="match_parent" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentEnd="true" app:layout_constraintEnd_toStartOf="@id/text_ir_pitch"
android:layout_alignParentStart="true" app:layout_constraintStart_toEndOf="@id/text_ir_pitch_units"
android:layout_below="@+id/text_ir_pitch" app:layout_constraintTop_toTopOf="parent" />
android:layout_marginBottom="@dimen/spacing_medlarge"
android:layout_marginLeft="@dimen/spacing_large"
android:layout_marginRight="@dimen/spacing_large"/>
<TextView <TextView
android:id="@+id/text_ir_pitch" android:id="@+id/text_ir_pitch"
android:layout_width="wrap_content" android:layout_width="26dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentTop="true" android:layout_marginEnd="24dp"
android:layout_centerHorizontal="true" android:layout_marginStart="@dimen/spacing_medlarge"
android:layout_marginBottom="@dimen/spacing_medlarge" android:gravity="end"
android:layout_marginTop="@dimen/spacing_medlarge" app:layout_constraintBottom_toBottomOf="@+id/slider_pitch"
tools:text="75"/> app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/slider_pitch"
app:layout_constraintTop_toTopOf="@+id/slider_pitch"
tools:text="100" />
<TextView <TextView
android:id="@+id/text_ir_pitch_units" android:id="@+id/text_ir_pitch_units"
android:layout_width="wrap_content" android:layout_width="92dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignTop="@+id/text_ir_pitch" android:gravity="start"
android:layout_toEndOf="@+id/text_ir_pitch" android:layout_marginStart="24dp"
tools:text="%"/> android:layout_marginEnd="@dimen/spacing_medlarge"
app:layout_constraintBottom_toBottomOf="@+id/slider_pitch"
app:layout_constraintEnd_toStartOf="@id/slider_pitch"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/slider_pitch"
tools:text="Total Pitch" />
</RelativeLayout> </androidx.constraintlayout.widget.ConstraintLayout>
<RelativeLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="1"> android:layout_weight="1">
<SeekBar <com.google.android.material.slider.Slider
android:id="@+id/seekbar_vertical_offset" android:id="@+id/slider_vertical_offset"
android:layout_width="match_parent" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentEnd="true" app:layout_constraintEnd_toStartOf="@id/text_ir_vertical_offset"
android:layout_alignParentStart="true" app:layout_constraintStart_toEndOf="@id/text_ir_vertical_offset_units"
android:layout_below="@+id/text_ir_vertical_offset" app:layout_constraintTop_toTopOf="parent" />
android:layout_marginBottom="@dimen/spacing_medlarge"
android:layout_marginLeft="@dimen/spacing_large"
android:layout_marginRight="@dimen/spacing_large"/>
<TextView <TextView
android:id="@+id/text_ir_vertical_offset" android:id="@+id/text_ir_vertical_offset"
android:layout_width="wrap_content" android:layout_width="26dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentTop="true" android:layout_marginEnd="24dp"
android:layout_centerHorizontal="true" android:layout_marginStart="@dimen/spacing_medlarge"
android:layout_marginBottom="@dimen/spacing_medlarge" android:gravity="end"
android:layout_marginTop="@dimen/spacing_medlarge" app:layout_constraintBottom_toBottomOf="@+id/slider_vertical_offset"
tools:text="75"/> app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/slider_vertical_offset"
app:layout_constraintTop_toTopOf="@+id/slider_vertical_offset"
tools:text="100" />
<TextView <TextView
android:id="@+id/text_ir_vertical_offset_units" android:id="@+id/text_ir_vertical_offset_units"
android:layout_width="wrap_content" android:layout_width="92dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignTop="@+id/text_ir_vertical_offset" android:gravity="start"
android:layout_toEndOf="@+id/text_ir_vertical_offset" android:layout_marginStart="24dp"
tools:text="%"/> android:layout_marginEnd="@dimen/spacing_medlarge"
app:layout_constraintBottom_toBottomOf="@+id/slider_vertical_offset"
app:layout_constraintEnd_toStartOf="@id/slider_vertical_offset"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/slider_vertical_offset"
tools:text="Vertical Offset" />
</RelativeLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout> </LinearLayout>

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/dialog_progress"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.material.progressindicator.LinearProgressIndicator
android:id="@+id/update_progress"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:layout_marginEnd="24dp"
android:layout_marginStart="24dp"
android:layout_marginTop="24dp"
app:trackCornerRadius="2dp" />
</androidx.appcompat.widget.LinearLayoutCompat>

View File

@ -1,37 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<SeekBar
android:id="@+id/seekbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/spacing_large"
android:layout_marginRight="@dimen/spacing_large"
android:layout_alignParentEnd="true"
android:layout_alignParentStart="true"
android:layout_below="@+id/text_value"
android:layout_marginBottom="@dimen/spacing_medlarge"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="75"
android:id="@+id/text_value"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/spacing_medlarge"
android:layout_marginBottom="@dimen/spacing_medlarge"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="%"
android:id="@+id/text_units"
android:layout_alignTop="@+id/text_value"
android:layout_toEndOf="@+id/text_value"/>
</RelativeLayout>

View File

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.slider.Slider
android:id="@+id/slider"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
app:layout_constraintEnd_toStartOf="@id/text_value"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/text_value"
android:layout_width="26dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/spacing_medlarge"
android:gravity="end"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/text_units"
app:layout_constraintStart_toEndOf="@id/slider"
app:layout_constraintTop_toTopOf="parent"
tools:text="100" />
<TextView
android:id="@+id/text_units"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="24dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/text_value"
app:layout_constraintTop_toTopOf="parent"
tools:text="%" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -20,117 +20,100 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<TextView <com.google.android.material.textfield.TextInputLayout
android:id="@+id/label_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/TextAppearance.MaterialComponents.Headline5"
android:textSize="18sp"
android:text="@string/cheats_name"
android:layout_margin="@dimen/spacing_large"
android:labelFor="@id/edit_name"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@id/edit_name" />
<EditText
android:id="@+id/edit_name" android:id="@+id/edit_name"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:minHeight="48dp" android:hint="@string/cheats_name"
android:paddingTop="@dimen/spacing_medlarge"
android:layout_marginHorizontal="@dimen/spacing_large" android:layout_marginHorizontal="@dimen/spacing_large"
android:importantForAutofill="no" android:layout_marginVertical="@dimen/spacing_small"
android:inputType="text" app:errorEnabled="true"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/label_name" app:layout_constraintTop_toBottomOf="parent"
app:layout_constraintBottom_toTopOf="@id/label_creator" app:layout_constraintBottom_toTopOf="@id/edit_creator">
tools:text="Hyrule Field Speed Hack" />
<TextView <com.google.android.material.textfield.TextInputEditText
android:id="@+id/label_creator" android:id="@+id/edit_name_input"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
style="@style/TextAppearance.MaterialComponents.Headline5" android:minHeight="48dp"
android:textSize="18sp" android:importantForAutofill="no"
android:text="@string/cheats_creator" android:inputType="text"
android:layout_margin="@dimen/spacing_large" tools:text="Hyrule Field Speed Hack"/>
android:labelFor="@id/edit_creator"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/edit_name"
app:layout_constraintBottom_toTopOf="@id/edit_creator" />
<EditText </com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/edit_creator" android:id="@+id/edit_creator"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:minHeight="48dp" android:hint="@string/cheats_creator"
android:layout_marginHorizontal="@dimen/spacing_large" android:layout_marginHorizontal="@dimen/spacing_large"
android:importantForAutofill="no" android:layout_marginBottom="24dp"
android:inputType="text"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/label_creator" app:layout_constraintTop_toBottomOf="@id/edit_name"
app:layout_constraintBottom_toTopOf="@id/label_notes" /> app:layout_constraintBottom_toTopOf="@id/edit_notes">
<TextView <com.google.android.material.textfield.TextInputEditText
android:id="@+id/label_notes" android:id="@+id/edit_creator_input"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
style="@style/TextAppearance.MaterialComponents.Headline5" android:minHeight="48dp"
android:textSize="18sp" android:importantForAutofill="no"
android:text="@string/cheats_notes" android:inputType="text"/>
android:layout_margin="@dimen/spacing_large"
android:labelFor="@id/edit_notes"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/edit_creator"
app:layout_constraintBottom_toTopOf="@id/edit_notes" />
<EditText </com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/edit_notes" android:id="@+id/edit_notes"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:minHeight="48dp" android:hint="@string/cheats_notes"
android:layout_marginHorizontal="@dimen/spacing_large" android:layout_marginHorizontal="@dimen/spacing_large"
android:importantForAutofill="no" android:layout_marginBottom="24dp"
android:inputType="textMultiLine"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/label_notes" app:layout_constraintTop_toBottomOf="@id/edit_creator"
app:layout_constraintBottom_toTopOf="@id/label_code" /> app:layout_constraintBottom_toTopOf="@id/edit_code">
<TextView <com.google.android.material.textfield.TextInputEditText
android:id="@+id/label_code" android:id="@+id/edit_notes_input"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
style="@style/TextAppearance.MaterialComponents.Headline5" android:minHeight="48dp"
android:textSize="18sp" android:importantForAutofill="no"
android:text="@string/cheats_code" android:inputType="textMultiLine" />
android:layout_margin="@dimen/spacing_large"
android:labelFor="@id/edit_code"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/edit_notes"
app:layout_constraintBottom_toTopOf="@id/edit_code" />
<EditText </com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/edit_code" android:id="@+id/edit_code"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:minHeight="108sp"
android:layout_marginHorizontal="@dimen/spacing_large" android:layout_marginHorizontal="@dimen/spacing_large"
android:importantForAutofill="no" android:layout_marginVertical="@dimen/spacing_small"
android:inputType="textMultiLine" android:hint="@string/cheats_code"
android:typeface="monospace" app:errorEnabled="true"
android:gravity="start"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/label_code"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
tools:text="0x8003d63c:dword:0x60000000\n0x8003d658:dword:0x60000000" /> app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/edit_notes">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/edit_code_input"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="108sp"
android:gravity="start"
android:importantForAutofill="no"
android:inputType="textMultiLine"
android:typeface="monospace"
tools:text="0x8003d63c:dword:0x60000000\n0x8003d658:dword:0x60000000" />
</com.google.android.material.textfield.TextInputLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -23,7 +23,6 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="@dimen/spacing_small" android:layout_margin="@dimen/spacing_small"
android:text="@string/cheats_open_settings" android:text="@string/cheats_open_settings"
android:textColor="@color/dolphin_white"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/text_warning" app:layout_constraintStart_toEndOf="@id/text_warning"

View File

@ -27,8 +27,6 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:padding="@dimen/spacing_small" android:padding="@dimen/spacing_small"
android:background="@color/dolphin_blue"
android:textColor="@color/lb_tv_white"
android:text="@string/emulation_done" android:text="@string/emulation_done"
android:visibility="gone"/> android:visibility="gone"/>

View File

@ -5,7 +5,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:paddingBottom="16dp" android:paddingBottom="16dp"
android:background="@color/dolphin_blue" android:background="?attr/colorSurface"
tools:layout_width="250dp"> tools:layout_width="250dp">
<TextView <TextView
@ -18,8 +18,8 @@
android:ellipsize="end" android:ellipsize="end"
android:letterSpacing="0" android:letterSpacing="0"
android:maxLines="@integer/game_title_lines" android:maxLines="@integer/game_title_lines"
android:textColor="@android:color/white"
android:textSize="20sp" android:textSize="20sp"
android:textColor="?attr/colorOnSurface"
tools:text="The Legend of Zelda: The Wind Waker" /> tools:text="The Legend of Zelda: The Wind Waker" />
<ScrollView <ScrollView
@ -114,7 +114,7 @@
android:id="@+id/divider" android:id="@+id/divider"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="1dp" android:layout_height="1dp"
android:background="#FFFFFF" android:background="?attr/colorOnSurfaceVariant"
android:layout_marginTop="24dp" android:layout_marginTop="24dp"
android:layout_marginBottom="16dp"/> android:layout_marginBottom="16dp"/>

View File

@ -29,7 +29,6 @@
android:focusable="true" android:focusable="true"
android:gravity="center" android:gravity="center"
android:nextFocusRight="@id/root" android:nextFocusRight="@id/root"
android:buttonTint="@color/dolphin_blue"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/text_name" app:layout_constraintStart_toEndOf="@id/text_name"

View File

@ -12,7 +12,7 @@
tools:text="CPU Settings" tools:text="CPU Settings"
android:layout_marginStart="@dimen/spacing_large" android:layout_marginStart="@dimen/spacing_large"
android:layout_marginBottom="@dimen/spacing_small" android:layout_marginBottom="@dimen/spacing_small"
android:textColor="@color/dolphin_blue" android:textColor="?attr/colorPrimary"
android:textStyle="bold" android:textStyle="bold"
android:layout_gravity="start|bottom"/> android:layout_gravity="start|bottom"/>

View File

@ -43,7 +43,6 @@
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginEnd="@dimen/spacing_large" android:layout_marginEnd="@dimen/spacing_large"
android:buttonTint="@color/dolphin_blue"
android:clickable="false" android:clickable="false"
android:focusable="false" android:focusable="false"
android:minHeight="0dp" android:minHeight="0dp"

View File

@ -16,7 +16,7 @@
<item <item
android:id="@+id/menu_open_file" android:id="@+id/menu_open_file"
android:icon="@android:drawable/ic_media_play" android:icon="@drawable/ic_play"
android:title="@string/grid_menu_open_file" android:title="@string/grid_menu_open_file"
app:showAsAction="ifRoom"/> app:showAsAction="ifRoom"/>

View File

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.Dolphin.Main.MaterialYou" parent="Theme.Dolphin.Main">
<item name="colorPrimary">@color/m3_sys_color_dynamic_dark_primary</item>
<item name="colorOnPrimary">@color/m3_sys_color_dynamic_dark_on_primary</item>
<item name="colorPrimaryContainer">@color/m3_sys_color_dynamic_dark_primary_container</item>
<item name="colorOnPrimaryContainer">@color/m3_sys_color_dynamic_dark_on_primary_container</item>
<item name="colorSecondary">@color/m3_sys_color_dynamic_dark_secondary</item>
<item name="colorOnSecondary">@color/m3_sys_color_dynamic_dark_on_secondary</item>
<item name="colorSecondaryContainer">@color/m3_sys_color_dynamic_dark_secondary_container</item>
<item name="colorOnSecondaryContainer">@color/m3_sys_color_dynamic_dark_on_secondary_container</item>
<item name="colorTertiary">@color/m3_sys_color_dynamic_dark_tertiary</item>
<item name="colorOnTertiary">@color/m3_sys_color_dynamic_dark_on_tertiary</item>
<item name="colorTertiaryContainer">@color/m3_sys_color_dynamic_dark_tertiary_container</item>
<item name="colorOnTertiaryContainer">@color/m3_sys_color_dynamic_dark_on_tertiary_container</item>
<item name="android:colorBackground">@color/m3_sys_color_dynamic_dark_background</item>
<item name="colorOnBackground">@color/m3_sys_color_dynamic_dark_on_background</item>
<item name="colorSurface">@color/m3_sys_color_dynamic_dark_surface</item>
<item name="colorOnSurface">@color/m3_sys_color_dynamic_dark_on_surface</item>
<item name="colorSurfaceVariant">@color/m3_sys_color_dynamic_dark_surface_variant</item>
<item name="colorOnSurfaceVariant">@color/m3_sys_color_dynamic_dark_on_surface_variant</item>
<item name="colorOutline">@color/m3_sys_color_dynamic_dark_outline</item>
<item name="colorOnSurfaceInverse">@color/m3_sys_color_dynamic_dark_on_surface_variant</item>
<item name="colorSurfaceInverse">@color/m3_sys_color_dynamic_dark_surface_variant</item>
<item name="colorPrimaryInverse">@color/m3_sys_color_dynamic_dark_inverse_primary</item>
<item name="android:colorControlHighlight">@color/m3_sys_color_dynamic_dark_on_surface_variant</item>
<item name="android:colorEdgeEffect">@color/m3_sys_color_dynamic_dark_secondary</item>
<item name="materialAlertDialogTheme">@style/ThemeOverlay.Material3.MaterialAlertDialog</item>
<item name="popupTheme">@style/ThemeOverlay.Material3</item>
</style>
</resources>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<bool name="lightStatusBar">false</bool>
</resources>

View File

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="dolphin_blue">#1976d2</color>
<color name="dolphin_blue_secondary">#2196f3</color>
<color name="dolphin_white">#FFFFFF</color>
<color name="dolphin_surface">#1A1C1E</color>
<color name="tv_card_unselected">#444444</color>
<color name="invalid_setting_overlay">#36ff0000</color>
</resources>

View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Generated by https://material-foundation.github.io/material-theme-builder/ -->
<color name="dolphin_primary">#9ECAFF</color>
<color name="dolphin_onPrimary">#003258</color>
<color name="dolphin_primaryContainer">#00497D</color>
<color name="dolphin_onPrimaryContainer">#D1E4FF</color>
<color name="dolphin_secondary">#BBC7DB</color>
<color name="dolphin_onSecondary">#253140</color>
<color name="dolphin_secondaryContainer">#3B4858</color>
<color name="dolphin_onSecondaryContainer">#D7E3F7</color>
<color name="dolphin_tertiary">#D6BEE4</color>
<color name="dolphin_onTertiary">#3B2948</color>
<color name="dolphin_tertiaryContainer">#523F5F</color>
<color name="dolphin_onTertiaryContainer">#F2DAFF</color>
<color name="dolphin_error">#FFB4AB</color>
<color name="dolphin_errorContainer">#93000A</color>
<color name="dolphin_onError">#690005</color>
<color name="dolphin_onErrorContainer">#FFDAD6</color>
<color name="dolphin_background">#1A1C1E</color>
<color name="dolphin_onBackground">#E2E2E6</color>
<color name="dolphin_surface">#1A1C1E</color>
<color name="dolphin_onSurface">#E2E2E6</color>
<color name="dolphin_surfaceVariant">#43474E</color>
<color name="dolphin_onSurfaceVariant">#C3C7CF</color>
<color name="dolphin_outline">#8D9199</color>
<color name="dolphin_inverseOnSurface">#1A1C1E</color>
<color name="dolphin_inverseSurface">#E2E2E6</color>
<color name="dolphin_inversePrimary">#0061A4</color>
<color name="dolphin_shadow">#000000</color>
</resources>

View File

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Generated by https://material-foundation.github.io/material-theme-builder/ -->
<color name="green_primary">#70DBA8</color>
<color name="green_onPrimary">#003824</color>
<color name="green_primaryContainer">#005236</color>
<color name="green_onPrimaryContainer">#8CF7C3</color>
<color name="green_secondary">#B4CCBC</color>
<color name="green_onSecondary">#20352A</color>
<color name="green_secondaryContainer">#364B3F</color>
<color name="green_onSecondaryContainer">#D0E8D8</color>
<color name="green_tertiary">#A4CDDE</color>
<color name="green_onTertiary">#063543</color>
<color name="green_tertiaryContainer">#234C5A</color>
<color name="green_onTertiaryContainer">#C0E9FA</color>
<color name="green_errorContainer">#93000A</color>
<color name="green_onError">#690005</color>
<color name="green_onErrorContainer">#FFDAD6</color>
<color name="green_background">#191C1A</color>
<color name="green_onBackground">#E1E3DF</color>
<color name="green_surface">#191C1A</color>
<color name="green_onSurface">#E1E3DF</color>
<color name="green_surfaceVariant">#404943</color>
<color name="green_onSurfaceVariant">#C0C9C1</color>
<color name="green_outline">#8A938C</color>
<color name="green_inverseOnSurface">#191C1A</color>
<color name="green_inverseSurface">#E1E3DF</color>
<color name="green_inversePrimary">#006C49</color>
</resources>

View File

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Generated by https://material-foundation.github.io/material-theme-builder/ -->
<color name="pink_primary">#FFB1C4</color>
<color name="pink_onPrimary">#65002E</color>
<color name="pink_primaryContainer">#8F0044</color>
<color name="pink_onPrimaryContainer">#FFD9E1</color>
<color name="pink_secondary">#E3BDC5</color>
<color name="pink_onSecondary">#422930</color>
<color name="pink_secondaryContainer">#5B3F46</color>
<color name="pink_onSecondaryContainer">#FFD9E1</color>
<color name="pink_tertiary">#EDBD92</color>
<color name="pink_onTertiary">#472A0A</color>
<color name="pink_tertiaryContainer">#61401E</color>
<color name="pink_onTertiaryContainer">#FFDCBF</color>
<color name="pink_errorContainer">#93000A</color>
<color name="pink_onError">#690005</color>
<color name="pink_onErrorContainer">#FFDAD6</color>
<color name="pink_background">#201A1B</color>
<color name="pink_onBackground">#ECE0E1</color>
<color name="pink_surface">#201A1B</color>
<color name="pink_onSurface">#ECE0E1</color>
<color name="pink_surfaceVariant">#514346</color>
<color name="pink_onSurfaceVariant">#D6C2C5</color>
<color name="pink_outline">#9E8C8F</color>
<color name="pink_inverseOnSurface">#201A1B</color>
<color name="pink_inverseSurface">#ECE0E1</color>
<color name="pink_inversePrimary">#B5195B</color>
</resources>

View File

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.Dolphin.Main.MaterialYou" parent="Theme.Dolphin.Main">
<item name="colorPrimary">@color/m3_sys_color_dynamic_light_primary</item>
<item name="colorOnPrimary">@color/m3_sys_color_dynamic_light_on_primary</item>
<item name="colorPrimaryContainer">@color/m3_sys_color_dynamic_light_primary_container</item>
<item name="colorOnPrimaryContainer">@color/m3_sys_color_dynamic_light_on_primary_container</item>
<item name="colorSecondary">@color/m3_sys_color_dynamic_light_secondary</item>
<item name="colorOnSecondary">@color/m3_sys_color_dynamic_light_on_secondary</item>
<item name="colorSecondaryContainer">@color/m3_sys_color_dynamic_light_secondary_container</item>
<item name="colorOnSecondaryContainer">@color/m3_sys_color_dynamic_light_on_secondary_container</item>
<item name="colorTertiary">@color/m3_sys_color_dynamic_light_tertiary</item>
<item name="colorOnTertiary">@color/m3_sys_color_dynamic_light_on_tertiary</item>
<item name="colorTertiaryContainer">@color/m3_sys_color_dynamic_light_tertiary_container</item>
<item name="colorOnTertiaryContainer">@color/m3_sys_color_dynamic_light_on_tertiary_container</item>
<item name="android:colorBackground">@color/m3_sys_color_dynamic_light_background</item>
<item name="colorOnBackground">@color/m3_sys_color_dynamic_light_on_background</item>
<item name="colorSurface">@color/m3_sys_color_dynamic_light_surface</item>
<item name="colorOnSurface">@color/m3_sys_color_dynamic_light_on_surface</item>
<item name="colorSurfaceVariant">@color/m3_sys_color_dynamic_light_surface_variant</item>
<item name="colorOnSurfaceVariant">@color/m3_sys_color_dynamic_light_on_surface_variant</item>
<item name="colorOutline">@color/m3_sys_color_dynamic_light_outline</item>
<item name="colorOnSurfaceInverse">@color/m3_sys_color_dynamic_light_on_surface_variant</item>
<item name="colorSurfaceInverse">@color/m3_sys_color_dynamic_light_surface_variant</item>
<item name="colorPrimaryInverse">@color/m3_sys_color_dynamic_light_inverse_primary</item>
<item name="android:colorControlHighlight">@color/m3_sys_color_dynamic_light_on_surface_variant</item>
<item name="android:colorEdgeEffect">@color/m3_sys_color_dynamic_light_secondary</item>
<item name="materialAlertDialogTheme">@style/ThemeOverlay.Material3.MaterialAlertDialog</item>
<item name="popupTheme">@style/ThemeOverlay.Material3</item>
</style>
</resources>

View File

@ -479,6 +479,34 @@
<item>-1</item> <item>-1</item>
</integer-array> </integer-array>
<!-- Monet must always have a value exclusive to >= API 31 -->
<string-array name="themeEntries">
<item>Default</item>
<item>Material Default</item>
<item>Green</item>
<item>Pink</item>
</string-array>
<integer-array name="themeValues">
<item>0</item>
<item>2</item>
<item>3</item>
<item>4</item>
</integer-array>
<string-array name="themeEntriesA12">
<item>Default</item>
<item>Material You</item>
<item>Material Default</item>
<item>Green</item>
<item>Pink</item>
</string-array>
<integer-array name="themeValuesA12">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
</integer-array>
<string-array name="synchronizeGpuThreadEntries"> <string-array name="synchronizeGpuThreadEntries">
<item>Never</item> <item>Never</item>
<item>On Idle Skipping</item> <item>On Idle Skipping</item>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<bool name="lightStatusBar">true</bool>
</resources>

View File

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="dolphin_blue">#2196f3</color>
<color name="dolphin_blue_secondary">#21b0f3</color>
<color name="dolphin_white">#ffffff</color>
<color name="dolphin_surface">#FDFCFF</color>
<color name="tv_card_unselected">#444444</color>
<color name="invalid_setting_overlay">#36ff0000</color>
</resources>

View File

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Generated by https://material-foundation.github.io/material-theme-builder/ -->
<color name="dolphin_primary">#2196f3</color>
<color name="dolphin_onPrimary">#FFFFFF</color>
<color name="dolphin_primaryContainer">#D1E4FF</color>
<color name="dolphin_onPrimaryContainer">#001D36</color>
<color name="dolphin_secondary">#535F70</color>
<color name="dolphin_onSecondary">#FFFFFF</color>
<color name="dolphin_secondaryContainer">#D7E3F7</color>
<color name="dolphin_onSecondaryContainer">#101C2B</color>
<color name="dolphin_tertiary">#6B5778</color>
<color name="dolphin_onTertiary">#FFFFFF</color>
<color name="dolphin_tertiaryContainer">#F2DAFF</color>
<color name="dolphin_onTertiaryContainer">#251431</color>
<color name="dolphin_error">#BA1A1A</color>
<color name="dolphin_errorContainer">#FFDAD6</color>
<color name="dolphin_onError">#FFFFFF</color>
<color name="dolphin_onErrorContainer">#410002</color>
<color name="dolphin_background">#FDFCFF</color>
<color name="dolphin_onBackground">#1A1C1E</color>
<color name="dolphin_surface">#FDFCFF</color>
<color name="dolphin_onSurface">#1A1C1E</color>
<color name="dolphin_surfaceVariant">#DFE2EB</color>
<color name="dolphin_onSurfaceVariant">#43474E</color>
<color name="dolphin_outline">#73777F</color>
<color name="dolphin_inverseOnSurface">#F1F0F4</color>
<color name="dolphin_inverseSurface">#2F3033</color>
<color name="dolphin_inversePrimary">#9ECAFF</color>
<color name="dolphin_shadow">#000000</color>
<color name="dolphin_blue">#2196f3</color>
<color name="dolphin_filepicker">#2196f3</color>
<color name="dolphin_accent_wii">#9e9e9e</color>
<color name="dolphin_accent_wiiware">#2979ff</color>
<color name="tv_card_unselected">#444444</color>
<color name="invalid_setting_overlay">#36ff0000</color>
</resources>

View File

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Generated by https://material-foundation.github.io/material-theme-builder/ -->
<color name="green_primary">#006C49</color>
<color name="green_onPrimary">#FFFFFF</color>
<color name="green_primaryContainer">#8CF7C3</color>
<color name="green_onPrimaryContainer">#002113</color>
<color name="green_secondary">#4D6356</color>
<color name="green_onSecondary">#FFFFFF</color>
<color name="green_secondaryContainer">#D0E8D8</color>
<color name="green_onSecondaryContainer">#0A1F15</color>
<color name="green_tertiary">#3D6472</color>
<color name="green_onTertiary">#FFFFFF</color>
<color name="green_tertiaryContainer">#C0E9FA</color>
<color name="green_onTertiaryContainer">#001F28</color>
<color name="green_errorContainer">#FFDAD6</color>
<color name="green_onError">#FFFFFF</color>
<color name="green_onErrorContainer">#410002</color>
<color name="green_background">#FBFDF8</color>
<color name="green_onBackground">#191C1A</color>
<color name="green_surface">#FBFDF8</color>
<color name="green_onSurface">#191C1A</color>
<color name="green_surfaceVariant">#DCE5DD</color>
<color name="green_onSurfaceVariant">#404943</color>
<color name="green_outline">#707973</color>
<color name="green_inverseOnSurface">#EFF1ED</color>
<color name="green_inverseSurface">#2E312F</color>
<color name="green_inversePrimary">#70DBA8</color>
</resources>

View File

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Generated by https://material-foundation.github.io/material-theme-builder/ -->
<color name="pink_primary">#B5195B</color>
<color name="pink_onPrimary">#FFFFFF</color>
<color name="pink_primaryContainer">#FFD9E1</color>
<color name="pink_onPrimaryContainer">#3F001A</color>
<color name="pink_secondary">#75565D</color>
<color name="pink_onSecondary">#FFFFFF</color>
<color name="pink_secondaryContainer">#FFD9E1</color>
<color name="pink_onSecondaryContainer">#2B151B</color>
<color name="pink_tertiary">#7B5733</color>
<color name="pink_onTertiary">#FFFFFF</color>
<color name="pink_tertiaryContainer">#FFDCBF</color>
<color name="pink_onTertiaryContainer">#2D1600</color>
<color name="pink_errorContainer">#FFDAD6</color>
<color name="pink_onError">#FFFFFF</color>
<color name="pink_onErrorContainer">#410002</color>
<color name="pink_background">#FFFBFF</color>
<color name="pink_onBackground">#201A1B</color>
<color name="pink_surface">#FFFBFF</color>
<color name="pink_onSurface">#201A1B</color>
<color name="pink_surfaceVariant">#F3DDE1</color>
<color name="pink_onSurfaceVariant">#514346</color>
<color name="pink_outline">#847376</color>
<color name="pink_inverseOnSurface">#FAEEEF</color>
<color name="pink_inverseSurface">#352F30</color>
<color name="pink_inversePrimary">#FFB1C4</color>
</resources>

View File

@ -195,6 +195,7 @@
<string name="download_game_covers">Download Game Covers from GameTDB.com</string> <string name="download_game_covers">Download Game Covers from GameTDB.com</string>
<string name="show_titles_in_game_list">Show Titles in Game List</string> <string name="show_titles_in_game_list">Show Titles in Game List</string>
<string name="show_titles_in_game_list_description">Show the title and creator below each game cover.</string> <string name="show_titles_in_game_list_description">Show the title and creator below each game cover.</string>
<string name="change_theme">Change App Theme</string>
<!-- Online Update Region Select Fragment --> <!-- Online Update Region Select Fragment -->
<string name="region_select_title">Please select a region</string> <string name="region_select_title">Please select a region</string>
@ -563,8 +564,8 @@ It can efficiently compress both junk data and encrypted Wii data.
<string name="emulation_done">Done</string> <string name="emulation_done">Done</string>
<string name="emulation_toggle_controls">Toggle Controls</string> <string name="emulation_toggle_controls">Toggle Controls</string>
<string name="emulation_toggle_all">Toggle All</string> <string name="emulation_toggle_all">Toggle All</string>
<string name="emulation_control_scale">Adjust Scale</string> <string name="emulation_control_scale">Scale</string>
<string name="emulation_control_opacity">Adjust Opacity</string> <string name="emulation_control_opacity">Opacity</string>
<string name="emulation_control_adjustments">Adjust Controls</string> <string name="emulation_control_adjustments">Adjust Controls</string>
<string name="emulation_control_joystick_rel_center">Relative Stick Center</string> <string name="emulation_control_joystick_rel_center">Relative Stick Center</string>
<string name="emulation_control_rumble">Rumble</string> <string name="emulation_control_rumble">Rumble</string>

View File

@ -1,12 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<style name="DolphinDialogBase" parent="Theme.Material3.DayNight.Dialog.Alert">
<item name="colorSurface">@color/dolphin_blue</item>
<item name="colorPrimary">@color/dolphin_blue</item>
<item name="colorPrimaryDark">@color/dolphin_blue</item>
<item name="colorAccent">@color/dolphin_blue_secondary</item>
</style>
<!-- Hax to make Tablayout render icons --> <!-- Hax to make Tablayout render icons -->
<style name="MyCustomTextAppearance" parent="TextAppearance.Design.Tab"> <style name="MyCustomTextAppearance" parent="TextAppearance.Design.Tab">
<item name="textAllCaps">false</item> <item name="textAllCaps">false</item>
@ -14,9 +7,9 @@
<!-- Custom button styles --> <!-- Custom button styles -->
<style name="InGameMenuOption" parent="Widget.Material3.Button.TextButton"> <style name="InGameMenuOption" parent="Widget.Material3.Button.TextButton">
<item name="android:textColor">?attr/colorOnSurface</item>
<item name="android:textSize">16sp</item> <item name="android:textSize">16sp</item>
<item name="android:fontFamily">sans-serif-condensed</item> <item name="android:fontFamily">sans-serif-condensed</item>
<item name="android:textColor">@android:color/white</item>
<item name="android:textAllCaps">false</item> <item name="android:textAllCaps">false</item>
<item name="android:layout_width">match_parent</item> <item name="android:layout_width">match_parent</item>
<item name="android:layout_height">48dp</item> <item name="android:layout_height">48dp</item>
@ -24,13 +17,39 @@
<item name="android:paddingLeft">32dp</item> <item name="android:paddingLeft">32dp</item>
<item name="android:paddingRight">32dp</item> <item name="android:paddingRight">32dp</item>
<item name="android:layout_margin">0dp</item> <item name="android:layout_margin">0dp</item>
<item name="rippleColor">@color/dolphin_blue_secondary</item>
</style> </style>
<style name="OverlayInGameMenuOption" parent="InGameMenuOption"> <style name="OverlayInGameMenuOption" parent="InGameMenuOption">
<item name="android:textColor">@color/button_text_color</item>
<item name="android:padding">8dp</item> <item name="android:padding">8dp</item>
<item name="android:gravity">center</item> <item name="android:gravity">center</item>
<item name="android:layout_gravity">center</item> <item name="android:layout_gravity">center</item>
</style> </style>
<style name="DolphinMaterialDialog" parent="ThemeOverlay.Material3.MaterialAlertDialog">
<item name="colorPrimary">@color/dolphin_surface</item>
<item name="colorSurface">@color/dolphin_surface</item>
<item name="colorSecondary">@color/dolphin_primary</item>
<item name="buttonBarPositiveButtonStyle">@style/DolphinButton</item>
<item name="buttonBarNegativeButtonStyle">@style/DolphinButton</item>
<item name="buttonBarNeutralButtonStyle">@style/DolphinButton</item>
</style>
<style name="DolphinTVDialog" parent="Theme.Material3.DayNight.Dialog.Alert">
<item name="colorSurface">@color/dolphin_inverseOnSurface</item>
<item name="colorPrimary">@color/dolphin_primary</item>
</style>
<style name="DolphinButton" parent="Widget.Material3.Button.TextButton.Dialog">
<item name="android:textColor">@color/dolphin_primary</item>
<item name="rippleColor">@color/dolphin_secondary</item>
</style>
<style name="DolphinPopup" parent="ThemeOverlay.Material3">
<item name="colorPrimary">@color/dolphin_surface</item>
</style>
<style name="DolphinSlider" parent="Widget.Material3.Slider">
<item name="tickVisible">false</item>
<item name="labelBehavior">gone</item>
</style>
</resources> </resources>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources xmlns:tools="http://schemas.android.com/tools">
<style name="Theme.Dolphin.Splash.Main" parent="Theme.SplashScreen"> <style name="Theme.Dolphin.Splash.Main" parent="Theme.SplashScreen">
<item name="windowSplashScreenBackground">@color/dolphin_surface</item> <item name="windowSplashScreenBackground">@color/dolphin_surface</item>
<item name="windowSplashScreenAnimatedIcon">@drawable/ic_dolphin</item> <item name="windowSplashScreenAnimatedIcon">@drawable/ic_dolphin</item>
@ -14,55 +14,138 @@
<!-- Base theme --> <!-- Base theme -->
<style name="Theme.Dolphin.Main" parent="Theme.Material3.DayNight.NoActionBar"> <style name="Theme.Dolphin.Main" parent="Theme.Material3.DayNight.NoActionBar">
<item name="colorSurface">@color/dolphin_blue</item> <item name="colorPrimary">@color/dolphin_primary</item>
<item name="colorPrimary">@color/dolphin_blue</item> <item name="colorOnPrimary">@color/dolphin_onPrimary</item>
<item name="colorPrimaryDark">@color/dolphin_blue</item> <item name="colorPrimaryContainer">@color/dolphin_primary</item>
<item name="colorAccent">@color/dolphin_blue_secondary</item> <item name="colorOnPrimaryContainer">@color/dolphin_onPrimary</item>
<item name="colorSecondary">@color/dolphin_secondary</item>
<item name="colorOnSecondary">@color/dolphin_onSecondary</item>
<item name="colorSecondaryContainer">@color/dolphin_secondaryContainer</item>
<item name="colorOnSecondaryContainer">@color/dolphin_onSecondaryContainer</item>
<item name="colorTertiary">@color/dolphin_tertiary</item>
<item name="colorOnTertiary">@color/dolphin_onTertiary</item>
<item name="colorTertiaryContainer">@color/dolphin_tertiaryContainer</item>
<item name="colorOnTertiaryContainer">@color/dolphin_onTertiaryContainer</item>
<item name="colorError">@color/dolphin_error</item>
<item name="colorErrorContainer">@color/dolphin_errorContainer</item>
<item name="colorOnError">@color/dolphin_onError</item>
<item name="colorOnErrorContainer">@color/dolphin_onErrorContainer</item>
<item name="android:colorBackground">@color/dolphin_background</item>
<item name="colorOnBackground">@color/dolphin_onBackground</item>
<item name="colorSurface">@color/dolphin_surface</item>
<item name="colorOnSurface">@color/dolphin_onSurface</item>
<item name="colorSurfaceVariant">@color/dolphin_surfaceVariant</item>
<item name="colorOnSurfaceVariant">@color/dolphin_onSurfaceVariant</item>
<item name="colorOutline">@color/dolphin_outline</item>
<item name="colorOnSurfaceInverse">@color/dolphin_inverseOnSurface</item>
<item name="colorSurfaceInverse">@color/dolphin_inverseSurface</item>
<item name="colorPrimaryInverse">@color/dolphin_inversePrimary</item>
<item name="android:shadowColor">@color/dolphin_shadow</item>
<item name="android:colorControlHighlight">?attr/colorAccent</item> <item name="android:colorControlHighlight">@color/dolphin_secondary</item>
<item name="android:colorEdgeEffect">@color/dolphin_onSurfaceVariant</item>
<item name="android:colorEdgeEffect">@color/dolphin_blue_secondary</item>
<!-- Enable window content transitions --> <!-- Enable window content transitions -->
<item name="android:windowContentTransitions">true</item> <item name="android:windowContentTransitions">true</item>
<item name="android:windowAllowEnterTransitionOverlap">true</item> <item name="android:windowAllowEnterTransitionOverlap">true</item>
<item name="android:windowAllowReturnTransitionOverlap">true</item> <item name="android:windowAllowReturnTransitionOverlap">true</item>
<!-- Global alert dialog style -->
<item name="alertDialogTheme">@style/DolphinDialogBase</item>
</style>
<style name="Theme.Dolphin.Settings" parent="Theme.Material3.DayNight">
<item name="colorSurface">@color/dolphin_blue</item>
<item name="colorPrimary">@color/dolphin_blue</item>
<item name="colorPrimaryDark">@color/dolphin_blue</item>
<item name="colorAccent">@color/dolphin_blue_secondary</item>
<item name="titleTextColor">@android:color/white</item>
<item name="homeAsUpIndicator">@drawable/ic_back</item> <item name="homeAsUpIndicator">@drawable/ic_back</item>
<!-- Global alert dialog style --> <item name="android:windowLightStatusBar" tools:targetApi="m">@bool/lightStatusBar</item>
<item name="alertDialogTheme">@style/DolphinDialogBase</item>
<item name="materialAlertDialogTheme">@style/DolphinMaterialDialog</item>
<item name="popupTheme">@style/DolphinPopup</item>
<item name="sliderStyle">@style/DolphinSlider</item>
</style> </style>
<style name="Theme.Dolphin.Main.Emulation" parent="Theme.Dolphin.Main"> <style name="Theme.Dolphin.Main.Material" parent="Theme.Dolphin.Main">
<item name="android:windowBackground">@android:color/black</item> <item name="colorPrimaryContainer">@color/dolphin_primaryContainer</item>
<item name="colorOnPrimaryContainer">@color/dolphin_onPrimaryContainer</item>
<item name="materialAlertDialogTheme">@style/ThemeOverlay.Material3.MaterialAlertDialog</item>
<item name="popupTheme">@style/ThemeOverlay.Material3</item>
</style>
<style name="Theme.Dolphin.Main.Green" parent="Theme.Dolphin.Main">
<item name="colorPrimary">@color/green_primary</item>
<item name="colorOnPrimary">@color/green_onPrimary</item>
<item name="colorPrimaryContainer">@color/green_primaryContainer</item>
<item name="colorOnPrimaryContainer">@color/green_onPrimaryContainer</item>
<item name="colorSecondary">@color/green_secondary</item>
<item name="colorOnSecondary">@color/green_onSecondary</item>
<item name="colorSecondaryContainer">@color/green_secondaryContainer</item>
<item name="colorOnSecondaryContainer">@color/green_onSecondaryContainer</item>
<item name="colorTertiary">@color/green_tertiary</item>
<item name="colorOnTertiary">@color/green_onTertiary</item>
<item name="colorTertiaryContainer">@color/green_tertiaryContainer</item>
<item name="colorOnTertiaryContainer">@color/green_onTertiaryContainer</item>
<item name="colorErrorContainer">@color/green_errorContainer</item>
<item name="colorOnError">@color/green_onError</item>
<item name="colorOnErrorContainer">@color/green_onErrorContainer</item>
<item name="android:colorBackground">@color/green_background</item>
<item name="colorOnBackground">@color/green_onBackground</item>
<item name="colorSurface">@color/green_surface</item>
<item name="colorOnSurface">@color/green_onSurface</item>
<item name="colorSurfaceVariant">@color/green_surfaceVariant</item>
<item name="colorOnSurfaceVariant">@color/green_onSurfaceVariant</item>
<item name="colorOutline">@color/green_outline</item>
<item name="colorOnSurfaceInverse">@color/green_inverseOnSurface</item>
<item name="colorSurfaceInverse">@color/green_inverseSurface</item>
<item name="colorPrimaryInverse">@color/green_inversePrimary</item>
<item name="android:colorControlHighlight">@color/green_onSurfaceVariant</item>
<item name="android:colorEdgeEffect">@color/green_secondary</item>
<item name="materialAlertDialogTheme">@style/ThemeOverlay.Material3.MaterialAlertDialog</item>
<item name="popupTheme">@style/ThemeOverlay.Material3</item>
</style>
<style name="Theme.Dolphin.Main.Pink" parent="Theme.Dolphin.Main">
<item name="colorPrimary">@color/pink_primary</item>
<item name="colorOnPrimary">@color/pink_onPrimary</item>
<item name="colorPrimaryContainer">@color/pink_primaryContainer</item>
<item name="colorOnPrimaryContainer">@color/pink_onPrimaryContainer</item>
<item name="colorSecondary">@color/pink_secondary</item>
<item name="colorOnSecondary">@color/pink_onSecondary</item>
<item name="colorSecondaryContainer">@color/pink_secondaryContainer</item>
<item name="colorOnSecondaryContainer">@color/pink_onSecondaryContainer</item>
<item name="colorTertiary">@color/pink_tertiary</item>
<item name="colorOnTertiary">@color/pink_onTertiary</item>
<item name="colorTertiaryContainer">@color/pink_tertiaryContainer</item>
<item name="colorOnTertiaryContainer">@color/pink_onTertiaryContainer</item>
<item name="colorErrorContainer">@color/pink_errorContainer</item>
<item name="colorOnError">@color/pink_onError</item>
<item name="colorOnErrorContainer">@color/pink_onErrorContainer</item>
<item name="android:colorBackground">@color/pink_background</item>
<item name="colorOnBackground">@color/pink_onBackground</item>
<item name="colorSurface">@color/pink_surface</item>
<item name="colorOnSurface">@color/pink_onSurface</item>
<item name="colorSurfaceVariant">@color/pink_surfaceVariant</item>
<item name="colorOnSurfaceVariant">@color/pink_onSurfaceVariant</item>
<item name="colorOutline">@color/pink_outline</item>
<item name="colorOnSurfaceInverse">@color/pink_inverseOnSurface</item>
<item name="colorSurfaceInverse">@color/pink_inverseSurface</item>
<item name="colorPrimaryInverse">@color/pink_inversePrimary</item>
<item name="android:colorControlHighlight">@color/pink_onSurfaceVariant</item>
<item name="android:colorEdgeEffect">@color/pink_secondary</item>
<item name="materialAlertDialogTheme">@style/ThemeOverlay.Material3.MaterialAlertDialog</item>
<item name="popupTheme">@style/ThemeOverlay.Material3</item>
</style> </style>
<!-- Inherit from a base file picker theme that handles day/night --> <!-- Inherit from a base file picker theme that handles day/night -->
<style name="Theme.Dolphin.FilePicker" parent="FilePickerBaseTheme"> <style name="Theme.Dolphin.FilePicker" parent="FilePickerBaseTheme">
<item name="colorPrimary">@color/dolphin_blue</item> <item name="colorPrimary">@color/dolphin_filepicker</item>
<item name="colorPrimaryDark">@color/dolphin_blue</item> <item name="colorPrimaryDark">@color/dolphin_filepicker</item>
<item name="colorAccent">@color/dolphin_blue_secondary</item> <item name="colorAccent">@color/dolphin_filepicker</item>
<!-- Setting a divider is entirely optional --> <!-- Setting a divider is entirely optional -->
<item name="nnf_list_item_divider">?android:attr/listDivider</item> <item name="nnf_list_item_divider">?android:attr/listDivider</item>
<!-- If you want to set a specific toolbar theme, do it here --> <!-- If you want to set a specific toolbar theme, do it here -->
<item name="nnf_toolbarTheme">@style/ThemeOverlay.Material3.Dark.ActionBar</item> <item name="nnf_toolbarTheme">@style/ThemeOverlay.Material3.Dark.ActionBar</item>
<!-- Global alert dialog style -->
<item name="alertDialogTheme">@style/DolphinDialogBase</item>
</style> </style>
<style name="Theme.Dolphin.TV" parent="Theme.Leanback.Browse"> <style name="Theme.Dolphin.TV" parent="Theme.Leanback.Browse">
@ -74,7 +157,7 @@
<!-- Use CustomTitleView as the leanback title view. --> <!-- Use CustomTitleView as the leanback title view. -->
<item name="browseTitleViewLayout">@layout/titleview</item> <item name="browseTitleViewLayout">@layout/titleview</item>
<!-- Global alert dialog style --> <!-- Global AlertDialog Theme -->
<item name="alertDialogTheme">@style/DolphinDialogBase</item> <item name="alertDialogTheme">@style/DolphinTVDialog</item>
</style> </style>
</resources> </resources>

View File

@ -39,10 +39,10 @@ bool IsSettingSaveable(const Config::Location& config_location)
// TODO: Kill the current Android controller mappings system // TODO: Kill the current Android controller mappings system
if (config_location.section == "Android") if (config_location.section == "Android")
{ {
static constexpr std::array<const char*, 11> android_setting_saveable = { static constexpr std::array<const char*, 12> android_setting_saveable = {
"ControlScale", "ControlOpacity", "EmulationOrientation", "JoystickRelCenter", "ControlScale", "ControlOpacity", "EmulationOrientation", "JoystickRelCenter",
"LastPlatformTab", "MotionControls", "PhoneRumble", "ShowInputOverlay", "LastPlatformTab", "MotionControls", "PhoneRumble", "ShowInputOverlay",
"IRMode", "IRAlwaysRecenter", "ShowGameTitles"}; "IRMode", "IRAlwaysRecenter", "ShowGameTitles", "InterfaceTheme"};
return std::any_of( return std::any_of(
android_setting_saveable.cbegin(), android_setting_saveable.cend(), android_setting_saveable.cbegin(), android_setting_saveable.cend(),