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:exported="false"
android:configChanges="orientation|screenSize"
android:theme="@style/Theme.Dolphin.Settings"
android:theme="@style/Theme.Dolphin.Main"
android:label="@string/settings"/>
<activity
android:name=".features.cheats.ui.CheatsActivity"
android:exported="false"
android:theme="@style/Theme.Dolphin.Settings"
android:theme="@style/Theme.Dolphin.Main"
android:label="@string/cheats"/>
<activity
android:name=".activities.EmulationActivity"
android:exported="false"
android:theme="@style/Theme.Dolphin.Main.Emulation"
android:theme="@style/Theme.Dolphin.Main"
android:preferMinimalPostProcessing="true"/>
<activity
@ -125,7 +125,7 @@
android:name=".activities.UserDataActivity"
android:exported="false"
android:label="@string/user_data_submenu"
android:theme="@style/Theme.Dolphin.Settings" />
android:theme="@style/Theme.Dolphin.Main" />
<activity
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.fragments.ConvertFragment;
import org.dolphinemu.dolphinemu.utils.ThemeHelper;
public class ConvertActivity extends AppCompatActivity
{
@ -25,6 +26,8 @@ public class ConvertActivity extends AppCompatActivity
@Override
protected void onCreate(Bundle savedInstanceState)
{
ThemeHelper.setTheme(this);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_convert);

View File

@ -19,14 +19,12 @@ import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View;
import android.view.WindowManager;
import android.widget.SeekBar;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.IntDef;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.PopupMenu;
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.InputOverlayPointer;
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.ControllerMappingHelper;
import org.dolphinemu.dolphinemu.utils.FileBrowserHelper;
import org.dolphinemu.dolphinemu.utils.IniFile;
import org.dolphinemu.dolphinemu.utils.MotionListener;
import org.dolphinemu.dolphinemu.utils.Rumble;
import org.dolphinemu.dolphinemu.utils.ThemeHelper;
import java.io.File;
import java.lang.annotation.Retention;
@ -61,7 +61,11 @@ import java.util.List;
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_SUBMENU = "submenu";
@ -74,6 +78,8 @@ public final class EmulationActivity extends AppCompatActivity
private Settings mSettings;
private int mThemeId;
private boolean mMenuVisible;
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_RESOURCEPACK_PATH))
{
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
builder.setMessage(R.string.unavailable_paths);
builder.setPositiveButton(R.string.yes, (dialogInterface, i) ->
SettingsActivity.launch(activity, MenuTag.CONFIG_PATHS));
builder.setNeutralButton(R.string.continue_anyway, (dialogInterface, i) ->
continueCallback.run());
builder.show();
new MaterialAlertDialogBuilder(activity)
.setMessage(R.string.unavailable_paths)
.setPositiveButton(R.string.yes,
(dialogInterface, i) -> SettingsActivity.launch(activity,
MenuTag.CONFIG_PATHS))
.setNeutralButton(R.string.continue_anyway,
(dialogInterface, i) -> continueCallback.run())
.show();
}
else if (!FileBrowserHelper.isPathEmptyOrValid(StringSetting.MAIN_WII_SD_CARD_IMAGE_PATH) ||
!FileBrowserHelper.isPathEmptyOrValid(
StringSetting.MAIN_WII_SD_CARD_SYNC_FOLDER_PATH))
{
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
builder.setMessage(R.string.unavailable_paths);
builder.setPositiveButton(R.string.yes, (dialogInterface, i) ->
SettingsActivity.launch(activity, MenuTag.CONFIG_WII));
builder.setNeutralButton(R.string.continue_anyway, (dialogInterface, i) ->
continueCallback.run());
builder.show();
new MaterialAlertDialogBuilder(activity)
.setMessage(R.string.unavailable_paths)
.setPositiveButton(R.string.yes,
(dialogInterface, i) -> SettingsActivity.launch(activity,
MenuTag.CONFIG_WII))
.setNeutralButton(R.string.continue_anyway,
(dialogInterface, i) -> continueCallback.run())
.show();
}
else
{
@ -295,6 +303,8 @@ public final class EmulationActivity extends AppCompatActivity
@Override
protected void onCreate(Bundle savedInstanceState)
{
ThemeHelper.setTheme(this);
super.onCreate(savedInstanceState);
MainPresenter.skipRescanningLibrary();
@ -382,6 +392,8 @@ public final class EmulationActivity extends AppCompatActivity
@Override
protected void onResume()
{
ThemeHelper.setCorrectTheme(this);
super.onResume();
// Only android 9+ support this feature.
@ -816,8 +828,8 @@ public final class EmulationActivity extends AppCompatActivity
private void toggleControls()
{
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(R.string.emulation_toggle_controls);
MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(this)
.setTitle(R.string.emulation_toggle_controls);
int currentController = InputOverlay.getConfiguredControllerType(this);
@ -873,17 +885,14 @@ public final class EmulationActivity extends AppCompatActivity
}
builder.setNeutralButton(R.string.emulation_toggle_all,
(dialogInterface, i) -> mEmulationFragment.toggleInputOverlayVisibility(mSettings));
builder.setPositiveButton(R.string.ok, (dialogInterface, i) ->
mEmulationFragment.refreshInputOverlay());
builder.show();
(dialogInterface, i) -> mEmulationFragment.toggleInputOverlayVisibility(mSettings))
.setPositiveButton(R.string.ok, (dialogInterface, i) ->
mEmulationFragment.refreshInputOverlay())
.show();
}
public void chooseDoubleTapButton()
{
AlertDialog.Builder builder = new AlertDialog.Builder(this);
int currentValue = IntSetting.MAIN_DOUBLE_TAP_BUTTON.getInt(mSettings);
int buttonList = InputOverlay.getConfiguredControllerType(this) ==
@ -900,14 +909,13 @@ public final class EmulationActivity extends AppCompatActivity
}
}
builder.setSingleChoiceItems(buttonList, checkedItem,
(DialogInterface dialog, int which) -> IntSetting.MAIN_DOUBLE_TAP_BUTTON
.setInt(mSettings, InputOverlayPointer.DOUBLE_TAP_OPTIONS.get(which)));
builder.setPositiveButton(R.string.ok, (dialogInterface, i) ->
mEmulationFragment.initInputPointer());
builder.show();
new MaterialAlertDialogBuilder(this)
.setSingleChoiceItems(buttonList, checkedItem,
(DialogInterface dialog, int which) -> IntSetting.MAIN_DOUBLE_TAP_BUTTON.setInt(
mSettings, InputOverlayPointer.DOUBLE_TAP_OPTIONS.get(which)))
.setPositiveButton(R.string.ok,
(dialogInterface, i) -> mEmulationFragment.initInputPointer())
.show();
}
private void adjustScale()
@ -915,130 +923,96 @@ public final class EmulationActivity extends AppCompatActivity
LayoutInflater inflater = LayoutInflater.from(this);
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);
scaleSeekbar.setMax(150);
scaleSeekbar.setProgress(IntSetting.MAIN_CONTROL_SCALE.getInt(mSettings));
scaleSeekbar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener()
{
public void onStartTrackingTouch(SeekBar seekBar)
{
// 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) + "%");
scaleSlider.setValueTo(150);
scaleSlider.setValue(IntSetting.MAIN_CONTROL_SCALE.getInt(mSettings));
scaleSlider.setStepSize(1);
scaleSlider.addOnChangeListener(
(slider, progress, fromUser) -> scaleValue.setText(((int) progress + 50) + "%"));
scaleValue.setText(((int) scaleSlider.getValue() + 50) + "%");
// 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);
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)
{
valueOpacity.setText(progress + "%");
}
public void onStopTrackingTouch(SeekBar seekBar)
{
// Do nothing
}
});
valueOpacity.setText(seekbarOpacity.getProgress() + "%");
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(R.string.emulation_control_adjustments);
builder.setView(view);
builder.setPositiveButton(R.string.ok, (dialogInterface, i) ->
{
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();
new MaterialAlertDialogBuilder(this)
.setTitle(R.string.emulation_control_adjustments)
.setView(view)
.setPositiveButton(R.string.ok, (dialog, which) ->
{
IntSetting.MAIN_CONTROL_SCALE.setInt(mSettings, (int) scaleSlider.getValue());
IntSetting.MAIN_CONTROL_OPACITY.setInt(mSettings, (int) sliderOpacity.getValue());
mEmulationFragment.refreshInputOverlay();
})
.setNeutralButton(R.string.default_values, (dialog, which) ->
{
IntSetting.MAIN_CONTROL_SCALE.delete(mSettings);
IntSetting.MAIN_CONTROL_OPACITY.delete(mSettings);
mEmulationFragment.refreshInputOverlay();
})
.show();
}
private void chooseController()
{
final SharedPreferences.Editor editor = mPreferences.edit();
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(R.string.emulation_choose_controller);
builder.setSingleChoiceItems(R.array.controllersEntries,
InputOverlay.getConfiguredControllerType(this),
(dialog, indexSelected) ->
new MaterialAlertDialogBuilder(this)
.setTitle(R.string.emulation_choose_controller)
.setSingleChoiceItems(R.array.controllersEntries,
InputOverlay.getConfiguredControllerType(this),
(dialog, indexSelected) ->
{
editor.putInt("wiiController", indexSelected);
updateWiimoteNewController(indexSelected, this);
NativeLibrary.ReloadWiimoteConfig();
})
.setPositiveButton(R.string.ok, (dialogInterface, i) ->
{
editor.putInt("wiiController", indexSelected);
updateWiimoteNewController(indexSelected, this);
NativeLibrary.ReloadWiimoteConfig();
});
builder.setPositiveButton(R.string.ok, (dialogInterface, i) ->
{
editor.apply();
mEmulationFragment.refreshInputOverlay();
});
builder.show();
editor.apply();
mEmulationFragment.refreshInputOverlay();
})
.show();
}
private void showMotionControlsOptions()
{
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(R.string.emulation_motion_controls);
builder.setSingleChoiceItems(R.array.motionControlsEntries,
IntSetting.MAIN_MOTION_CONTROLS.getInt(mSettings),
(dialog, indexSelected) ->
{
IntSetting.MAIN_MOTION_CONTROLS.setInt(mSettings, indexSelected);
new MaterialAlertDialogBuilder(this)
.setTitle(R.string.emulation_motion_controls)
.setSingleChoiceItems(R.array.motionControlsEntries,
IntSetting.MAIN_MOTION_CONTROLS.getInt(mSettings),
(dialog, indexSelected) ->
{
IntSetting.MAIN_MOTION_CONTROLS.setInt(mSettings, indexSelected);
updateMotionListener();
updateMotionListener();
updateWiimoteNewImuIr(indexSelected);
NativeLibrary.ReloadWiimoteConfig();
});
builder.setPositiveButton(R.string.ok, (dialogInterface, i) -> dialogInterface.dismiss());
builder.show();
updateWiimoteNewImuIr(indexSelected);
NativeLibrary.ReloadWiimoteConfig();
})
.setPositiveButton(R.string.ok, (dialogInterface, i) -> dialogInterface.dismiss())
.show();
}
private void setIRMode()
{
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(R.string.emulation_ir_mode);
builder.setSingleChoiceItems(R.array.irModeEntries,
IntSetting.MAIN_IR_MODE.getInt(mSettings),
(dialog, indexSelected) ->
IntSetting.MAIN_IR_MODE.setInt(mSettings, indexSelected));
builder.setPositiveButton(R.string.ok, (dialogInterface, i) ->
mEmulationFragment.refreshOverlayPointer(mSettings));
builder.show();
new MaterialAlertDialogBuilder(this)
.setTitle(R.string.emulation_ir_mode)
.setSingleChoiceItems(R.array.irModeEntries,
IntSetting.MAIN_IR_MODE.getInt(mSettings),
(dialog, indexSelected) ->
IntSetting.MAIN_IR_MODE.setInt(mSettings, indexSelected))
.setPositiveButton(R.string.ok, (dialogInterface, i) ->
mEmulationFragment.refreshOverlayPointer(mSettings))
.show();
}
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 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));
units.setText(getString(R.string.pitch));
seekbar_pitch.setMax(100);
seekbar_pitch.setProgress(ir_pitch);
seekbar_pitch.setKeyProgressIncrement(5);
seekbar_pitch.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener()
{
@Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser)
{
text_slider_value_pitch.setText(String.valueOf(progress));
}
@Override public void onStartTrackingTouch(SeekBar seekBar)
{
// Do nothing
}
@Override public void onStopTrackingTouch(SeekBar seekBar)
{
// Do nothing
}
});
slider_pitch.setValueTo(100);
slider_pitch.setValue(ir_pitch);
slider_pitch.setStepSize(1);
slider_pitch.addOnChangeListener(
(slider, progress, fromUser) -> text_slider_value_pitch.setText(
String.valueOf((int) progress)));
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 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));
units_yaw.setText(getString(R.string.yaw));
seekbar_yaw.setMax(100);
seekbar_yaw.setProgress(ir_yaw);
seekbar_yaw.setKeyProgressIncrement(5);
seekbar_yaw.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener()
{
@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
}
});
seekbar_yaw.setValueTo(100);
seekbar_yaw.setValue(ir_yaw);
seekbar_yaw.setStepSize(1);
seekbar_yaw.addOnChangeListener((slider, progress, fromUser) -> text_slider_value_yaw.setText(
String.valueOf((int) progress)));
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 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));
units_vertical_offset.setText(getString(R.string.vertical_offset));
seekbar_vertical_offset.setMax(100);
seekbar_vertical_offset.setProgress(ir_vertical_offset);
seekbar_vertical_offset.setKeyProgressIncrement(5);
seekbar_vertical_offset.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener()
{
@Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser)
{
text_slider_value_vertical_offset.setText(String.valueOf(progress));
}
seekbar_vertical_offset.setValueTo(100);
seekbar_vertical_offset.setValue(ir_vertical_offset);
seekbar_vertical_offset.setStepSize(1);
seekbar_vertical_offset.addOnChangeListener(
(slider, progress, fromUser) -> text_slider_value_vertical_offset.setText(
String.valueOf((int) progress)));
@Override public void onStartTrackingTouch(SeekBar seekBar)
{
// Do nothing
}
new MaterialAlertDialogBuilder(this)
.setTitle(getString(R.string.emulation_ir_sensitivity))
.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)
{
// Do nothing
}
});
NativeLibrary.ReloadWiimoteConfig();
})
.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);
builder.setTitle(getString(R.string.emulation_ir_sensitivity));
builder.setView(view);
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();
NativeLibrary.ReloadWiimoteConfig();
})
.show();
}
private void resetOverlay()
{
new AlertDialog.Builder(this)
new MaterialAlertDialogBuilder(this)
.setTitle(getString(R.string.emulation_touch_overlay_reset))
.setPositiveButton(R.string.yes, (dialogInterface, i) ->
mEmulationFragment.resetInputOverlay())
.setNegativeButton(R.string.cancel, (dialogInterface, i) ->
{
})
.setPositiveButton(R.string.yes,
(dialogInterface, i) -> mEmulationFragment.resetInputOverlay())
.setNegativeButton(R.string.cancel, null)
.show();
}
@ -1300,4 +1226,17 @@ public final class EmulationActivity extends AppCompatActivity
{
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 androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
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.utils.DirectoryInitialization;
import org.dolphinemu.dolphinemu.utils.Log;
import org.dolphinemu.dolphinemu.utils.ThemeHelper;
import org.dolphinemu.dolphinemu.utils.ThreadUtil;
import java.io.File;
@ -50,6 +53,8 @@ public class UserDataActivity extends AppCompatActivity
@Override
protected void onCreate(Bundle savedInstanceState)
{
ThemeHelper.setTheme(this);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_user_data);
@ -80,7 +85,8 @@ public class UserDataActivity extends AppCompatActivity
buttonExportUserData.setOnClickListener(view -> exportUserData());
// show up button
Toolbar tb = findViewById(R.id.toolbar_user_data);
setSupportActionBar(tb);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
@ -100,26 +106,25 @@ public class UserDataActivity extends AppCompatActivity
{
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);
builder.setNegativeButton(R.string.no, (dialog, i) -> dialog.dismiss());
builder.setPositiveButton(R.string.yes, (dialog, i) ->
{
dialog.dismiss();
ThreadUtil.runOnThreadAndShowResult(this, R.string.import_in_progress,
R.string.do_not_close_app, () -> getResources().getString(importUserData(uri)),
(dialogInterface) ->
{
if (sMustRestartApp)
{
System.exit(0);
}
});
});
builder.show();
ThreadUtil.runOnThreadAndShowResult(this, R.string.import_in_progress,
R.string.do_not_close_app,
() -> getResources().getString(importUserData(uri)),
(dialogInterface) ->
{
if (sMustRestartApp)
{
System.exit(0);
}
});
})
.show();
}
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
// 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)
.setPositiveButton(R.string.ok, null)
.show();

View File

@ -62,7 +62,8 @@ public class PlatformPagerAdapter extends FragmentPagerAdapter
// 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: 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());
ImageSpan imageSpan = new ImageSpan(drawable, ImageSpan.ALIGN_BOTTOM);

View File

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

View File

@ -9,9 +9,10 @@ import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.DialogFragment;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import org.dolphinemu.dolphinemu.NativeLibrary;
import org.dolphinemu.dolphinemu.R;
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));
AlertDialog.Builder builder = new AlertDialog.Builder(requireActivity());
ViewGroup contents = (ViewGroup) getActivity().getLayoutInflater()
.inflate(R.layout.dialog_game_details, null);
@ -116,7 +116,8 @@ public final class GameDetailsDialog extends DialogFragment
PicassoUtils.loadGameBanner(banner, gameFile);
builder.setView(contents);
return builder.create();
return new MaterialAlertDialogBuilder(requireActivity())
.setView(contents)
.create();
}
}

View File

@ -8,9 +8,10 @@ import android.os.Bundle;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.DialogFragment;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import org.dolphinemu.dolphinemu.DolphinApplication;
import org.dolphinemu.dolphinemu.R;
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) ->
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);
builder.setTitle(requireContext()
.getString(R.string.preferences_game_properties_with_game_id, gameId));
return builder.create();
}
private void clearGameSettingsWithConfirmation(String gameId)
{
new AlertDialog.Builder(requireContext())
new MaterialAlertDialogBuilder(requireContext())
.setTitle(R.string.properties_clear_game_settings)
.setMessage(R.string.properties_clear_game_settings_confirmation)
.setPositiveButton(R.string.yes, (dialog, i) -> clearGameSettings(gameId))

View File

@ -3,13 +3,29 @@
package org.dolphinemu.dolphinemu.dialogs;
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.KeyEvent;
import android.view.MotionEvent;
import androidx.annotation.AttrRes;
import androidx.annotation.NonNull;
import androidx.annotation.StyleRes;
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.ui.SettingsAdapter;
import org.dolphinemu.dolphinemu.utils.ControllerMappingHelper;
@ -18,12 +34,20 @@ import org.dolphinemu.dolphinemu.utils.Log;
import java.util.ArrayList;
import java.util.List;
import static com.google.android.material.theme.overlay.MaterialThemeOverlay.wrap;
/**
* {@link AlertDialog} derivative that listens for
* motion events from controllers and joysticks.
*/
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
private final InputBindingSetting setting;
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)
{
super(context);
super(createMaterialAlertDialogThemedContext(context));
this.setting = setting;
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)

View File

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

View File

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

View File

@ -2,7 +2,6 @@
package org.dolphinemu.dolphinemu.features.settings.ui;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
@ -15,13 +14,18 @@ import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.fragment.app.FragmentTransaction;
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.R;
import org.dolphinemu.dolphinemu.ui.main.MainPresenter;
import org.dolphinemu.dolphinemu.utils.FileBrowserHelper;
import org.dolphinemu.dolphinemu.utils.ThemeHelper;
import java.util.Set;
@ -34,7 +38,9 @@ public final class SettingsActivity extends AppCompatActivity implements Setting
private static final String FRAGMENT_TAG = "settings";
private SettingsActivityPresenter mPresenter;
private ProgressDialog dialog;
private AlertDialog dialog;
private CollapsingToolbarLayout mToolbarLayout;
public static void launch(Context context, MenuTag menuTag, String gameId, int revision,
boolean isWii)
@ -58,6 +64,8 @@ public final class SettingsActivity extends AppCompatActivity implements Setting
@Override
protected void onCreate(Bundle savedInstanceState)
{
ThemeHelper.setTheme(this);
super.onCreate(savedInstanceState);
// 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.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);
}
@ -211,11 +221,12 @@ public final class SettingsActivity extends AppCompatActivity implements Setting
{
if (dialog == null)
{
dialog = new ProgressDialog(this);
dialog.setMessage(getString(R.string.load_settings));
dialog.setIndeterminate(true);
dialog = new MaterialAlertDialogBuilder(this)
.setTitle(getString(R.string.load_settings))
.setView(getLayoutInflater().inflate(R.layout.dialog_indeterminate_progress, null,
false))
.create();
}
dialog.show();
}
@ -228,7 +239,7 @@ public final class SettingsActivity extends AppCompatActivity implements Setting
@Override
public void showGameIniJunkDeletionQuestion()
{
new AlertDialog.Builder(this)
new MaterialAlertDialogBuilder(this)
.setTitle(getString(R.string.game_ini_junk_title))
.setMessage(getString(R.string.game_ini_junk_question))
.setPositiveButton(R.string.yes, (dialogInterface, i) -> mPresenter.clearSettings())
@ -312,4 +323,9 @@ public final class SettingsActivity extends AppCompatActivity implements Setting
{
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.
*/
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.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.SeekBar;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
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.dialogs.MotionAlertDialog;
import org.dolphinemu.dolphinemu.features.settings.model.Settings;
@ -56,7 +59,7 @@ import java.io.RandomAccessFile;
import java.util.ArrayList;
public final class SettingsAdapter extends RecyclerView.Adapter<SettingViewHolder>
implements DialogInterface.OnClickListener, SeekBar.OnSeekBarChangeListener
implements DialogInterface.OnClickListener, Slider.OnChangeListener
{
private final SettingsFragmentView mView;
private final Context mContext;
@ -64,7 +67,6 @@ public final class SettingsAdapter extends RecyclerView.Adapter<SettingViewHolde
private SettingsItem mClickedItem;
private int mClickedPosition;
private int mSeekbarMinValue;
private int mSeekbarProgress;
private AlertDialog mDialog;
@ -204,28 +206,27 @@ public final class SettingsAdapter extends RecyclerView.Adapter<SettingViewHolde
{
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);
EditText input = (EditText) dialogView.findViewById(R.id.input);
TextInputEditText input = dialogView.findViewById(R.id.input);
input.setText(item.getSelectedValue(getSettings()));
builder.setView(dialogView);
builder.setMessage(item.getDescription());
builder.setPositiveButton(R.string.ok, (dialogInterface, i) ->
{
String editTextInput = input.getText().toString();
mDialog = new MaterialAlertDialogBuilder(mView.getActivity())
.setView(dialogView)
.setMessage(item.getDescription())
.setPositiveButton(R.string.ok, (dialogInterface, i) ->
{
String editTextInput = input.getText().toString();
if (!item.getSelectedValue(mView.getSettings()).equals(editTextInput))
{
notifyItemChanged(position);
mView.onSettingChanged();
}
if (!item.getSelectedValue(mView.getSettings()).equals(editTextInput))
{
notifyItemChanged(position);
mView.onSettingChanged();
}
item.setSelectedValue(mView.getSettings(), editTextInput);
});
builder.setNegativeButton(R.string.cancel, null);
mDialog = builder.show();
item.setSelectedValue(mView.getSettings(), editTextInput);
})
.setNegativeButton(R.string.cancel, null)
.show();
}
public void onSingleChoiceClick(SingleChoiceSetting item, int position)
@ -235,12 +236,10 @@ public final class SettingsAdapter extends RecyclerView.Adapter<SettingViewHolde
int value = getSelectionForSingleChoiceValue(item);
AlertDialog.Builder builder = new AlertDialog.Builder(mView.getActivity());
builder.setTitle(item.getName());
builder.setSingleChoiceItems(item.getChoicesId(), value, this);
mDialog = builder.show();
mDialog = new MaterialAlertDialogBuilder(mView.getActivity())
.setTitle(item.getName())
.setSingleChoiceItems(item.getChoicesId(), value, this)
.show();
}
public void onStringSingleChoiceClick(StringSingleChoiceSetting item, int position)
@ -248,13 +247,11 @@ public final class SettingsAdapter extends RecyclerView.Adapter<SettingViewHolde
mClickedItem = item;
mClickedPosition = position;
AlertDialog.Builder builder = new AlertDialog.Builder(mView.getActivity());
builder.setTitle(item.getName());
builder.setSingleChoiceItems(item.getChoices(), item.getSelectedValueIndex(getSettings()),
this);
mDialog = builder.show();
mDialog = new MaterialAlertDialogBuilder(mView.getActivity())
.setTitle(item.getName())
.setSingleChoiceItems(item.getChoices(), item.getSelectedValueIndex(getSettings()),
this)
.show();
}
public void onSingleChoiceDynamicDescriptionsClick(SingleChoiceSettingDynamicDescriptions item,
@ -265,29 +262,26 @@ public final class SettingsAdapter extends RecyclerView.Adapter<SettingViewHolde
int value = getSelectionForSingleChoiceDynamicDescriptionsValue(item);
AlertDialog.Builder builder = new AlertDialog.Builder(mView.getActivity());
builder.setTitle(item.getName());
builder.setSingleChoiceItems(item.getChoicesId(), value, this);
mDialog = builder.show();
mDialog = new MaterialAlertDialogBuilder(mView.getActivity())
.setTitle(item.getName())
.setSingleChoiceItems(item.getChoicesId(), value, this)
.show();
}
public void onSliderClick(SliderSetting item, int position)
{
mClickedItem = item;
mClickedPosition = position;
mSeekbarMinValue = item.getMin();
mSeekbarProgress = item.getSelectedValue(getSettings());
AlertDialog.Builder builder = new AlertDialog.Builder(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());
builder.setView(view);
builder.setPositiveButton(R.string.ok, this);
mDialog = builder.show();
mDialog = new MaterialAlertDialogBuilder(mView.getActivity())
.setTitle(item.getName())
.setView(view)
.setPositiveButton(R.string.ok, this)
.show();
mTextSliderValue = view.findViewById(R.id.text_value);
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);
units.setText(item.getUnits());
SeekBar seekbar = view.findViewById(R.id.seekbar);
// TODO: Once we require API 26, uncomment this line and remove the mSeekbarMinValue variable
//seekbar.setMin(item.getMin());
seekbar.setMax(item.getMax() - mSeekbarMinValue);
seekbar.setProgress(mSeekbarProgress - mSeekbarMinValue);
seekbar.setKeyProgressIncrement(5);
seekbar.setOnSeekBarChangeListener(this);
Slider slider = view.findViewById(R.id.slider);
slider.setValueFrom(item.getMin());
slider.setValueTo(item.getMax());
slider.setValue(mSeekbarProgress);
slider.setStepSize(1);
slider.addOnChangeListener(this);
}
public void onSubmenuClick(SubmenuSetting item)
@ -339,10 +329,10 @@ public final class SettingsAdapter extends RecyclerView.Adapter<SettingViewHolde
if (!PermissionsHandler.isExternalStorageLegacy())
{
AlertDialog.Builder builder = new AlertDialog.Builder(mContext);
builder.setMessage(R.string.path_not_changeable_scoped_storage);
builder.setPositiveButton(R.string.ok, (dialog, i) -> dialog.dismiss());
builder.show();
new MaterialAlertDialogBuilder(mContext)
.setMessage(R.string.path_not_changeable_scoped_storage)
.setPositiveButton(R.string.ok, (dialog, i) -> dialog.dismiss())
.show();
}
else
{
@ -509,22 +499,12 @@ public final class SettingsAdapter extends RecyclerView.Adapter<SettingViewHolde
}
@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));
}
@Override
public void onStartTrackingTouch(SeekBar seekBar)
{
}
@Override
public void onStopTrackingTouch(SeekBar seekBar)
{
}
private int getValueForSingleChoiceSelection(SingleChoiceSetting item, int which)
{
int valuesId = item.getValuesId();

View File

@ -127,7 +127,7 @@ public final class SettingsFragment extends Fragment implements SettingsFragment
if (titles.containsKey(menuTag))
{
getActivity().setTitle(titles.get(menuTag));
mActivity.setToolbarTitle(getString(titles.get(menuTag)));
}
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.utils.BooleanSupplier;
import org.dolphinemu.dolphinemu.utils.EGLHelper;
import org.dolphinemu.dolphinemu.utils.ThemeHelper;
import org.dolphinemu.dolphinemu.utils.ThreadUtil;
import org.dolphinemu.dolphinemu.utils.WiiUtils;
@ -323,6 +324,50 @@ public final class SettingsFragmentPresenter
R.string.download_game_covers, 0));
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));
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)

View File

@ -6,7 +6,7 @@ import android.content.Context;
import android.text.method.LinkMovementMethod;
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.features.settings.model.view.SettingsItem;
@ -27,7 +27,8 @@ public final class HeaderHyperLinkViewHolder extends HeaderViewHolder
public void bind(SettingsItem item)
{
super.bind(item);
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 androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import org.dolphinemu.dolphinemu.R;
import org.dolphinemu.dolphinemu.features.settings.model.view.RunRunnable;
@ -54,19 +55,16 @@ public final class RunRunnableViewHolder extends SettingViewHolder
if (alertTextID > 0)
{
AlertDialog.Builder builder = new AlertDialog.Builder(mContext)
new MaterialAlertDialogBuilder(mContext)
.setTitle(mItem.getName())
.setMessage(alertTextID);
builder
.setMessage(alertTextID)
.setPositiveButton(R.string.ok, (dialog, whichButton) ->
{
runRunnable();
dialog.dismiss();
})
.setNegativeButton(R.string.cancel, (dialog, whichButton) -> dialog.dismiss());
builder.show();
.setNegativeButton(R.string.cancel, (dialog, whichButton) -> dialog.dismiss())
.show();
}
else
{

View File

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

View File

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

View File

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

View File

@ -3,15 +3,20 @@
package org.dolphinemu.dolphinemu.features.sysupdate.ui;
import android.app.Dialog;
import android.app.ProgressDialog;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.DialogFragment;
import androidx.lifecycle.ViewModelProvider;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.google.android.material.progressindicator.LinearProgressIndicator;
import org.dolphinemu.dolphinemu.R;
public class SystemUpdateProgressBarDialogFragment extends DialogFragment
@ -28,28 +33,20 @@ public class SystemUpdateProgressBarDialogFragment extends DialogFragment
SystemUpdateViewModel viewModel =
new ViewModelProvider(requireActivity()).get(SystemUpdateViewModel.class);
ProgressDialog progressDialog = new ProgressDialog(requireContext());
progressDialog.setTitle(getString(R.string.updating));
// 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);
View dialogView = getLayoutInflater().inflate(R.layout.dialog_progress, null, false);
LinearProgressIndicator progressBar = dialogView.findViewById(R.id.update_progress);
viewModel.getProgressData().observe(this, (@Nullable Integer progress) ->
{
progressDialog.setProgress(progress.intValue());
});
// 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())
.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) ->
{
@ -58,13 +55,11 @@ public class SystemUpdateProgressBarDialogFragment extends DialogFragment
return;
}
progressDialog.setMax(total.intValue());
progressBar.setMax(total);
});
viewModel.getTitleIdData().observe(this, (@Nullable Long titleId) ->
{
progressDialog.setMessage(getString(R.string.updating_message, titleId));
});
viewModel.getTitleIdData().observe(this, (@Nullable Long titleId) -> progressDialog.setMessage(
getString(R.string.updating_message, titleId)));
viewModel.getResultData().observe(this, (@Nullable Integer result) ->
{
@ -88,4 +83,17 @@ public class SystemUpdateProgressBarDialogFragment extends DialogFragment
}
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 androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.DialogFragment;
import androidx.lifecycle.ViewModelProvider;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import org.dolphinemu.dolphinemu.R;
import org.dolphinemu.dolphinemu.utils.WiiUtils;
@ -88,13 +89,10 @@ public class SystemUpdateResultFragment extends DialogFragment
throw new IllegalStateException("Unexpected value: " + mResult);
}
return new AlertDialog.Builder(requireContext())
return new MaterialAlertDialogBuilder(requireContext())
.setTitle(title)
.setMessage(message)
.setPositiveButton(R.string.ok, (dialog, which) ->
{
dismiss();
})
.setPositiveButton(R.string.ok, (dialog, which) -> dismiss())
.create();
}

View File

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

View File

@ -37,6 +37,7 @@ import org.dolphinemu.dolphinemu.utils.DirectoryInitialization;
import org.dolphinemu.dolphinemu.utils.FileBrowserHelper;
import org.dolphinemu.dolphinemu.utils.PermissionsHandler;
import org.dolphinemu.dolphinemu.utils.StartupHandler;
import org.dolphinemu.dolphinemu.utils.ThemeHelper;
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.
*/
public final class MainActivity extends AppCompatActivity
implements MainView, SwipeRefreshLayout.OnRefreshListener
implements MainView, SwipeRefreshLayout.OnRefreshListener, ThemeProvider
{
private ViewPager mViewPager;
private Toolbar mToolbar;
private TabLayout mTabLayout;
private FloatingActionButton mFab;
private int mThemeId;
private final MainPresenter mPresenter = new MainPresenter(this, this);
@Override
@ -60,6 +63,8 @@ public final class MainActivity extends AppCompatActivity
splashScreen.setKeepOnScreenCondition(
() -> !DirectoryInitialization.areDolphinDirectoriesReady());
ThemeHelper.setTheme(this);
super.onCreate(savedInstanceState);
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)
if (savedInstanceState == null)
{
StartupHandler.HandleInit(this);
new AfterDirectoryInitializationRunner().runWithLifecycle(this, this::checkTheme);
}
if (!DirectoryInitialization.isWaitingForWriteAccess(this))
{
@ -86,6 +94,8 @@ public final class MainActivity extends AppCompatActivity
@Override
protected void onResume()
{
ThemeHelper.setCorrectTheme(this);
super.onResume();
if (DirectoryInitialization.shouldStart(this))
@ -355,4 +365,22 @@ public final class MainActivity extends AppCompatActivity
showGames();
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 androidx.activity.ComponentActivity;
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.FragmentActivity;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProvider;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import org.dolphinemu.dolphinemu.BuildConfig;
import org.dolphinemu.dolphinemu.R;
import org.dolphinemu.dolphinemu.activities.EmulationActivity;
@ -171,11 +172,12 @@ public final class MainPresenter
if (Arrays.stream(childNames).noneMatch((name) -> FileBrowserHelper.GAME_EXTENSIONS.contains(
FileBrowserHelper.getExtension(name, false))))
{
AlertDialog.Builder builder = new AlertDialog.Builder(mActivity);
builder.setMessage(mActivity.getString(R.string.wrong_file_extension_in_directory,
FileBrowserHelper.setToSortedDelimitedString(FileBrowserHelper.GAME_EXTENSIONS)));
builder.setPositiveButton(R.string.ok, null);
builder.show();
new MaterialAlertDialogBuilder(mActivity)
.setMessage(mActivity.getString(R.string.wrong_file_extension_in_directory,
FileBrowserHelper.setToSortedDelimitedString(
FileBrowserHelper.GAME_EXTENSIONS)))
.setPositiveButton(R.string.ok, null)
.show();
}
ContentResolver contentResolver = mActivity.getContentResolver();
@ -209,13 +211,12 @@ public final class MainPresenter
{
mActivity.runOnUiThread(() ->
{
AlertDialog.Builder builder =
new AlertDialog.Builder(mActivity);
builder.setMessage(R.string.wii_save_exists);
builder.setCancelable(false);
builder.setPositiveButton(R.string.yes, (dialog, i) -> canOverwriteFuture.complete(true));
builder.setNegativeButton(R.string.no, (dialog, i) -> canOverwriteFuture.complete(false));
builder.show();
new MaterialAlertDialogBuilder(mActivity)
.setMessage(R.string.wii_save_exists)
.setCancelable(false)
.setPositiveButton(R.string.yes, (dialog, i) -> canOverwriteFuture.complete(true))
.setNegativeButton(R.string.no, (dialog, i) -> canOverwriteFuture.complete(false))
.show();
});
try
@ -255,26 +256,23 @@ public final class MainPresenter
public void importNANDBin(String path)
{
AlertDialog.Builder builder =
new AlertDialog.Builder(mActivity);
new MaterialAlertDialogBuilder(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);
builder.setNegativeButton(R.string.no, (dialog, i) -> dialog.dismiss());
builder.setPositiveButton(R.string.yes, (dialog, i) ->
{
dialog.dismiss();
ThreadUtil.runOnThreadAndShowResult(mActivity, R.string.import_in_progress,
R.string.do_not_close_app, () ->
{
// ImportNANDBin unfortunately doesn't provide any result value...
// It does however show a panic alert if something goes wrong.
WiiUtils.importNANDBin(path);
return null;
});
});
builder.show();
ThreadUtil.runOnThreadAndShowResult(mActivity, R.string.import_in_progress,
R.string.do_not_close_app, () ->
{
// ImportNANDBin unfortunately doesn't provide any result value...
// It does however show a panic alert if something goes wrong.
WiiUtils.importNANDBin(path);
return null;
});
})
.show();
}
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.net.Uri;
import android.os.Bundle;
import android.util.TypedValue;
import androidx.annotation.NonNull;
import androidx.core.content.ContextCompat;
@ -121,10 +120,6 @@ public final class TvMainActivity extends FragmentActivity
{
mSwipeRefresh = findViewById(R.id.swipe_refresh);
TypedValue typedValue = new TypedValue();
getTheme().resolveAttribute(R.attr.colorPrimary, typedValue, true);
mSwipeRefresh.setColorSchemeColors(typedValue.data);
mSwipeRefresh.setOnRefreshListener(this);
setRefreshing(GameFileCacheManager.isLoadingOrRescanning());
@ -138,7 +133,7 @@ public final class TvMainActivity extends FragmentActivity
// Set display parameters for the BrowseFragment
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();
mBrowseFragment.setOnItemViewClickedListener(
@ -364,7 +359,7 @@ public final class TvMainActivity extends FragmentActivity
ArrayObjectAdapter rowItems = new ArrayObjectAdapter(new SettingsRowPresenter());
rowItems.add(new TvSettingsItem(R.id.menu_settings,
R.drawable.ic_settings,
R.drawable.ic_settings_tv,
R.string.grid_menu_settings));
rowItems.add(new TvSettingsItem(R.id.button_add_directory,
@ -372,31 +367,31 @@ public final class TvMainActivity extends FragmentActivity
R.string.add_directory_title));
rowItems.add(new TvSettingsItem(R.id.menu_refresh,
R.drawable.ic_refresh,
R.drawable.ic_refresh_tv,
R.string.grid_menu_refresh));
rowItems.add(new TvSettingsItem(R.id.menu_open_file,
R.drawable.ic_play,
R.drawable.ic_play_tv,
R.string.grid_menu_open_file));
rowItems.add(new TvSettingsItem(R.id.menu_install_wad,
R.drawable.ic_folder,
R.drawable.ic_folder_tv,
R.string.grid_menu_install_wad));
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));
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));
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));
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));
// Create a header for this row.

View File

@ -3,7 +3,6 @@
package org.dolphinemu.dolphinemu.ui.platform;
import android.os.Bundle;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@ -15,6 +14,8 @@ import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import com.google.android.material.color.MaterialColors;
import org.dolphinemu.dolphinemu.R;
import org.dolphinemu.dolphinemu.adapters.GameAdapter;
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);
mAdapter = new GameAdapter();
TypedValue typedValue = new TypedValue();
requireActivity().getTheme().resolveAttribute(R.attr.colorPrimary, typedValue, true);
mSwipeRefresh.setColorSchemeColors(typedValue.data);
// Set theme color to the refresh animation's background
mSwipeRefresh.setProgressBackgroundColorSchemeColor(
MaterialColors.getColor(mSwipeRefresh, R.attr.colorSurfaceVariant));
mSwipeRefresh.setColorSchemeColors(MaterialColors.getColor(mSwipeRefresh, R.attr.colorPrimary));
mSwipeRefresh.setOnRefreshListener(mOnRefreshListener);

View File

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

View File

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

View File

@ -20,6 +20,7 @@ import androidx.lifecycle.MutableLiveData;
import org.dolphinemu.dolphinemu.NativeLibrary;
import org.dolphinemu.dolphinemu.R;
import org.dolphinemu.dolphinemu.activities.EmulationActivity;
import org.dolphinemu.dolphinemu.features.settings.model.IntSetting;
import java.io.File;
import java.io.FileOutputStream;
@ -77,6 +78,15 @@ public final class DirectoryInitialization
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)
{
// This has to be done after calling NativeLibrary.Initialize(),

View File

@ -8,9 +8,9 @@ import android.net.Uri;
import android.os.Environment;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.FragmentActivity;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.nononsenseapps.filepicker.FilePickerActivity;
import com.nononsenseapps.filepicker.Utils;
@ -126,7 +126,7 @@ public final class FileBrowserHelper
setToSortedDelimitedString(validExtensions));
}
new AlertDialog.Builder(context)
new MaterialAlertDialogBuilder(context)
.setMessage(message)
.setPositiveButton(R.string.yes, (dialogInterface, i) -> runnable.run())
.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.appcompat.app.AlertDialog;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import org.dolphinemu.dolphinemu.R;
import java.util.function.Supplier;
@ -27,12 +29,14 @@ public class ThreadUtil
@Nullable DialogInterface.OnDismissListener onResultDismiss)
{
Resources resources = activity.getResources();
AlertDialog progressDialog = new AlertDialog.Builder(activity)
AlertDialog progressDialog = new MaterialAlertDialogBuilder(activity)
.setTitle(progressTitle)
.setCancelable(false)
.create();
progressDialog.setTitle(progressTitle);
if (progressMessage != 0)
progressDialog.setMessage(resources.getString(progressMessage));
progressDialog.setCancelable(false);
progressDialog.show();
new Thread(() ->
@ -44,12 +48,11 @@ public class ThreadUtil
if (result != null)
{
AlertDialog.Builder builder =
new AlertDialog.Builder(activity);
builder.setMessage(result);
builder.setPositiveButton(R.string.ok, (dialog, i) -> dialog.dismiss());
builder.setOnDismissListener(onResultDismiss);
builder.show();
new MaterialAlertDialogBuilder(activity)
.setMessage(result)
.setPositiveButton(R.string.ok, (dialog, i) -> dialog.dismiss())
.setOnDismissListener(onResultDismiss)
.show();
}
});
}, 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:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:fillColor="?attr/colorControlNormal"
android:pathData="M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/>
</vector>

View File

@ -4,6 +4,6 @@
android:viewportWidth="24"
android:viewportHeight="24">
<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"/>
</vector>

View File

@ -4,6 +4,6 @@
android:viewportWidth="24"
android:viewportHeight="24">
<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"/>
</vector>

View File

@ -5,5 +5,5 @@
android:viewportHeight="24">
<path
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>

View File

@ -3,14 +3,14 @@
android:width="24dp"
android:viewportHeight="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"/>
<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"/>
<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"/>
<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"/>
<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"/>
</vector>

View File

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

View File

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

View File

@ -1,22 +1,39 @@
<?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:tools="http://schemas.android.com/tools"
android:layout_width="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
android:id="@+id/text_type"
android:layout_width="0dp"
android:layout_height="wrap_content"
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_constraintEnd_toStartOf="@id/divider"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/appbar_user_data"
app:layout_constraintVertical_chainStyle="packed"
app:layout_constraintWidth_max="400dp" />
app:layout_constraintWidth_max="400dp"
tools:text="@string/user_data_new_location" />
<TextView
android:id="@+id/text_path"
@ -74,11 +91,10 @@
android:layout_height="wrap_content"
android:layout_margin="@dimen/spacing_small"
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_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_constraintWidth_max="400dp" />
@ -88,8 +104,7 @@
android:layout_height="wrap_content"
android:layout_margin="@dimen/spacing_small"
android:text="@string/user_data_import"
android:textColor="@color/dolphin_white"
app:layout_constraintStart_toEndOf="@id/divider"
app:layout_constraintStart_toEndOf="@id/barrier_text"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/button_open_system_file_manager"
app:layout_constraintBottom_toTopOf="@id/button_export_user_data"
@ -101,8 +116,7 @@
android:layout_height="wrap_content"
android:layout_margin="@dimen/spacing_small"
android:text="@string/user_data_export"
android:textColor="@color/dolphin_white"
app:layout_constraintStart_toEndOf="@id/divider"
app:layout_constraintStart_toEndOf="@id/barrier_text"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/button_import_user_data"
app:layout_constraintBottom_toBottomOf="parent"

View File

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

View File

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

View File

@ -1,22 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.slidingpanelayout.widget.SlidingPaneLayout
<androidx.coordinatorlayout.widget.CoordinatorLayout
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_height="match_parent">
<androidx.fragment.app.FragmentContainerView
android:layout_width="320dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:id="@+id/cheat_list"
android:name="org.dolphinemu.dolphinemu.features.cheats.ui.CheatListFragment" />
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar_cheats"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true">
<androidx.fragment.app.FragmentContainerView
android:layout_width="320dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:id="@+id/cheat_details"
android:name="org.dolphinemu.dolphinemu.features.cheats.ui.CheatDetailsFragment" />
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar_cheats"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorSurface"/>
</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"?>
<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"
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"
android:id="@+id/appbar_main"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/ThemeOverlay.MaterialComponents.Dark.ActionBar">
android:layout_height="wrap_content">
<androidx.appcompat.widget.Toolbar
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar_main"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/dolphin_blue"
app:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="@style/Theme.MaterialComponents.DayNight" />
android:background="?attr/colorSurface"
app:layout_scrollFlags="scroll|enterAlways|snap"
app:subtitleTextColor="?attr/colorOnSurface"
app:titleTextColor="?attr/colorOnSurface" />
<com.google.android.material.tabs.TabLayout
android:id="@+id/tabs_platforms"
style="@style/Widget.Design.TabLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/dolphin_blue"
android:background="?attr/colorSurface"
app:tabGravity="fill"
app:tabIndicatorColor="@color/dolphin_white"
app:tabIndicatorColor="?attr/colorPrimary"
app:tabIndicatorHeight="3dp"
app:tabMode="fixed"
app:tabTextAppearance="@style/MyCustomTextAppearance" />
app:tabMode="fixed" />
</com.google.android.material.appbar.AppBarLayout>
@ -37,6 +36,7 @@
android:id="@+id/pager_platforms"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/colorSurface"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
@ -44,12 +44,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:backgroundTint="@color/dolphin_blue"
android:minHeight="48dp"
android:src="@drawable/ic_add"
app:borderWidth="0dp"
app:layout_anchor="@+id/pager_platforms"
app:layout_anchorGravity="bottom|right|end"
app:tint="@android:color/white" />
app:layout_anchorGravity="bottom|right|end" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -1,5 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/frame_content"/>
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
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"?>
<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:tools="http://schemas.android.com/tools"
android:layout_width="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
android:id="@+id/text_type"
android:layout_width="0dp"
android:layout_height="wrap_content"
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_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/appbar_user_data"
app:layout_constraintVertical_chainStyle="packed"
app:layout_constraintWidth_max="400dp" />
app:layout_constraintWidth_max="400dp"
tools:text="@string/user_data_new_location" />
<TextView
android:id="@+id/text_path"
@ -50,7 +67,6 @@
android:layout_height="wrap_content"
android:layout_margin="@dimen/spacing_small"
android:text="@string/user_data_open_system_file_manager"
android:textColor="@color/dolphin_white"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/text_android_11"
@ -62,7 +78,6 @@
android:layout_height="wrap_content"
android:layout_margin="@dimen/spacing_small"
android:text="@string/user_data_import"
android:textColor="@color/dolphin_white"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/button_open_system_file_manager"
@ -74,7 +89,6 @@
android:layout_height="wrap_content"
android:layout_margin="@dimen/spacing_small"
android:text="@string/user_data_export"
android:textColor="@color/dolphin_white"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
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"?>
<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:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RelativeLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/input_scale"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:clickable="false">
android:layout_height="wrap_content">
<TextView
android:id="@+id/input_scale_name"
style="@style/TextAppearance.MaterialComponents.Headline5"
android:layout_width="match_parent"
android:layout_width="56dp"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginStart="@dimen/spacing_large"
android:layout_marginTop="@dimen/spacing_large"
android:layout_marginEnd="@dimen/spacing_large"
android:layout_marginStart="24dp"
android:layout_marginEnd="@dimen/spacing_medlarge"
android:text="@string/emulation_control_scale"
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
android:id="@+id/input_scale_value"
android:layout_width="40dp"
android:layout_height="wrap_content"
android:layout_below="@+id/input_scale_name"
android:layout_alignParentEnd="true"
android:layout_marginStart="@dimen/spacing_small"
android:layout_marginTop="@dimen/spacing_medlarge"
android:layout_marginEnd="@dimen/spacing_large"
android:layout_marginBottom="@dimen/spacing_large"
tools:text="99%"
android:textAlignment="textEnd"/>
android:layout_marginStart="@dimen/spacing_medlarge"
android:layout_marginEnd="24dp"
android:gravity="end"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/input_scale_slider"
app:layout_constraintTop_toTopOf="parent"
tools:text="100%" />
<SeekBar
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" />
</androidx.constraintlayout.widget.ConstraintLayout>
</RelativeLayout>
<RelativeLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/input_opacity"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/input_scale"
android:layout_alignParentStart="true"
android:clickable="false">
android:layout_height="wrap_content">
<TextView
android:id="@+id/input_opacity_name"
style="@style/TextAppearance.MaterialComponents.Headline5"
android:layout_width="match_parent"
android:layout_width="56dp"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginStart="@dimen/spacing_large"
android:layout_marginTop="@dimen/spacing_large"
android:layout_marginEnd="@dimen/spacing_large"
android:layout_marginStart="24dp"
android:layout_marginEnd="@dimen/spacing_medlarge"
android:text="@string/emulation_control_opacity"
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
android:id="@+id/input_opacity_value"
android:layout_width="40dp"
android:layout_height="wrap_content"
android:layout_below="@+id/input_opacity_name"
android:layout_alignParentEnd="true"
android:layout_marginStart="@dimen/spacing_small"
android:layout_marginTop="@dimen/spacing_medlarge"
android:layout_marginEnd="@dimen/spacing_large"
android:layout_marginBottom="@dimen/spacing_large"
tools:text="99%"
android:textAlignment="textEnd"/>
android:layout_marginStart="@dimen/spacing_medlarge"
android:layout_marginEnd="24dp"
android:gravity="end"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/input_opacity_slider"
app:layout_constraintTop_toTopOf="parent"
tools:text="100%" />
<SeekBar
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" />
</androidx.constraintlayout.widget.ConstraintLayout>
</RelativeLayout>
</RelativeLayout>
</androidx.appcompat.widget.LinearLayoutCompat>

View File

@ -1,19 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<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"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<EditText
android:id="@+id/input"
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/input_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"
android:ems="10"
android:inputType="text"
android:importantForAutofill="no" />
android:layout_height="wrap_content"
android:hint="@string/cheats_name"
android:paddingTop="@dimen/spacing_medlarge"
android:layout_marginHorizontal="@dimen/spacing_large"
android:layout_marginVertical="@dimen/spacing_small">
<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>

View File

@ -1,115 +1,132 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout
android:layout_width="wrap_content"
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<SeekBar
android:id="@+id/seekbar_width"
android:layout_width="match_parent"
<com.google.android.material.slider.Slider
android:id="@+id/slider_width"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentStart="true"
android:layout_below="@+id/text_ir_yaw"
android:layout_marginBottom="@dimen/spacing_medlarge"
android:layout_marginLeft="@dimen/spacing_large"
android:layout_marginRight="@dimen/spacing_large"/>
app:layout_constraintEnd_toStartOf="@id/text_ir_yaw"
app:layout_constraintStart_toEndOf="@id/text_ir_yaw_units"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/text_ir_yaw"
android:layout_width="wrap_content"
android:layout_width="26dp"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="@dimen/spacing_medlarge"
android:layout_marginTop="@dimen/spacing_medlarge"
tools:text="75"/>
android:layout_marginEnd="24dp"
android:layout_marginStart="@dimen/spacing_medlarge"
android:gravity="end"
app:layout_constraintBottom_toBottomOf="@+id/slider_width"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/slider_width"
app:layout_constraintTop_toTopOf="@+id/slider_width"
tools:text="100" />
<TextView
android:id="@+id/text_ir_yaw_units"
android:layout_width="wrap_content"
android:layout_width="92dp"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/text_ir_yaw"
android:layout_toEndOf="@+id/text_ir_yaw"
tools:text="%"/>
</RelativeLayout>
android:gravity="start"
android:layout_marginStart="24dp"
android:layout_marginEnd="@dimen/spacing_medlarge"
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
android:layout_width="wrap_content"
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<SeekBar
android:id="@+id/seekbar_pitch"
android:layout_width="match_parent"
<com.google.android.material.slider.Slider
android:id="@+id/slider_pitch"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentStart="true"
android:layout_below="@+id/text_ir_pitch"
android:layout_marginBottom="@dimen/spacing_medlarge"
android:layout_marginLeft="@dimen/spacing_large"
android:layout_marginRight="@dimen/spacing_large"/>
app:layout_constraintEnd_toStartOf="@id/text_ir_pitch"
app:layout_constraintStart_toEndOf="@id/text_ir_pitch_units"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/text_ir_pitch"
android:layout_width="wrap_content"
android:layout_width="26dp"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="@dimen/spacing_medlarge"
android:layout_marginTop="@dimen/spacing_medlarge"
tools:text="75"/>
android:layout_marginEnd="24dp"
android:layout_marginStart="@dimen/spacing_medlarge"
android:gravity="end"
app:layout_constraintBottom_toBottomOf="@+id/slider_pitch"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/slider_pitch"
app:layout_constraintTop_toTopOf="@+id/slider_pitch"
tools:text="100" />
<TextView
android:id="@+id/text_ir_pitch_units"
android:layout_width="wrap_content"
android:layout_width="92dp"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/text_ir_pitch"
android:layout_toEndOf="@+id/text_ir_pitch"
tools:text="%"/>
android:gravity="start"
android:layout_marginStart="24dp"
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
android:layout_width="wrap_content"
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<SeekBar
android:id="@+id/seekbar_vertical_offset"
android:layout_width="match_parent"
<com.google.android.material.slider.Slider
android:id="@+id/slider_vertical_offset"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentStart="true"
android:layout_below="@+id/text_ir_vertical_offset"
android:layout_marginBottom="@dimen/spacing_medlarge"
android:layout_marginLeft="@dimen/spacing_large"
android:layout_marginRight="@dimen/spacing_large"/>
app:layout_constraintEnd_toStartOf="@id/text_ir_vertical_offset"
app:layout_constraintStart_toEndOf="@id/text_ir_vertical_offset_units"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/text_ir_vertical_offset"
android:layout_width="wrap_content"
android:layout_width="26dp"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="@dimen/spacing_medlarge"
android:layout_marginTop="@dimen/spacing_medlarge"
tools:text="75"/>
android:layout_marginEnd="24dp"
android:layout_marginStart="@dimen/spacing_medlarge"
android:gravity="end"
app:layout_constraintBottom_toBottomOf="@+id/slider_vertical_offset"
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
android:id="@+id/text_ir_vertical_offset_units"
android:layout_width="wrap_content"
android:layout_width="92dp"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/text_ir_vertical_offset"
android:layout_toEndOf="@+id/text_ir_vertical_offset"
tools:text="%"/>
android:gravity="start"
android:layout_marginStart="24dp"
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_height="wrap_content">
<TextView
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
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/edit_name"
android:layout_width="match_parent"
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:importantForAutofill="no"
android:inputType="text"
android:layout_marginVertical="@dimen/spacing_small"
app:errorEnabled="true"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/label_name"
app:layout_constraintBottom_toTopOf="@id/label_creator"
tools:text="Hyrule Field Speed Hack" />
app:layout_constraintTop_toBottomOf="parent"
app:layout_constraintBottom_toTopOf="@id/edit_creator">
<TextView
android:id="@+id/label_creator"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/TextAppearance.MaterialComponents.Headline5"
android:textSize="18sp"
android:text="@string/cheats_creator"
android:layout_margin="@dimen/spacing_large"
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" />
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/edit_name_input"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="48dp"
android:importantForAutofill="no"
android:inputType="text"
tools:text="Hyrule Field Speed Hack"/>
<EditText
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/edit_creator"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="48dp"
android:hint="@string/cheats_creator"
android:layout_marginHorizontal="@dimen/spacing_large"
android:importantForAutofill="no"
android:inputType="text"
android:layout_marginBottom="24dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/label_creator"
app:layout_constraintBottom_toTopOf="@id/label_notes" />
app:layout_constraintTop_toBottomOf="@id/edit_name"
app:layout_constraintBottom_toTopOf="@id/edit_notes">
<TextView
android:id="@+id/label_notes"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/TextAppearance.MaterialComponents.Headline5"
android:textSize="18sp"
android:text="@string/cheats_notes"
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" />
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/edit_creator_input"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="48dp"
android:importantForAutofill="no"
android:inputType="text"/>
<EditText
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/edit_notes"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="48dp"
android:hint="@string/cheats_notes"
android:layout_marginHorizontal="@dimen/spacing_large"
android:importantForAutofill="no"
android:inputType="textMultiLine"
android:layout_marginBottom="24dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/label_notes"
app:layout_constraintBottom_toTopOf="@id/label_code" />
app:layout_constraintTop_toBottomOf="@id/edit_creator"
app:layout_constraintBottom_toTopOf="@id/edit_code">
<TextView
android:id="@+id/label_code"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/TextAppearance.MaterialComponents.Headline5"
android:textSize="18sp"
android:text="@string/cheats_code"
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" />
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/edit_notes_input"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="48dp"
android:importantForAutofill="no"
android:inputType="textMultiLine" />
<EditText
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/edit_code"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="108sp"
android:layout_marginHorizontal="@dimen/spacing_large"
android:importantForAutofill="no"
android:inputType="textMultiLine"
android:typeface="monospace"
android:gravity="start"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/label_code"
android:layout_marginVertical="@dimen/spacing_small"
android:hint="@string/cheats_code"
app:errorEnabled="true"
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>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -16,7 +16,7 @@
<item
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"
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>
</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">
<item>Never</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="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="change_theme">Change App Theme</string>
<!-- Online Update Region Select Fragment -->
<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_toggle_controls">Toggle Controls</string>
<string name="emulation_toggle_all">Toggle All</string>
<string name="emulation_control_scale">Adjust Scale</string>
<string name="emulation_control_opacity">Adjust Opacity</string>
<string name="emulation_control_scale">Scale</string>
<string name="emulation_control_opacity">Opacity</string>
<string name="emulation_control_adjustments">Adjust Controls</string>
<string name="emulation_control_joystick_rel_center">Relative Stick Center</string>
<string name="emulation_control_rumble">Rumble</string>

View File

@ -1,12 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<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 -->
<style name="MyCustomTextAppearance" parent="TextAppearance.Design.Tab">
<item name="textAllCaps">false</item>
@ -14,9 +7,9 @@
<!-- Custom button styles -->
<style name="InGameMenuOption" parent="Widget.Material3.Button.TextButton">
<item name="android:textColor">?attr/colorOnSurface</item>
<item name="android:textSize">16sp</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:layout_width">match_parent</item>
<item name="android:layout_height">48dp</item>
@ -24,13 +17,39 @@
<item name="android:paddingLeft">32dp</item>
<item name="android:paddingRight">32dp</item>
<item name="android:layout_margin">0dp</item>
<item name="rippleColor">@color/dolphin_blue_secondary</item>
</style>
<style name="OverlayInGameMenuOption" parent="InGameMenuOption">
<item name="android:textColor">@color/button_text_color</item>
<item name="android:padding">8dp</item>
<item name="android:gravity">center</item>
<item name="android:layout_gravity">center</item>
</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>

View File

@ -1,5 +1,5 @@
<?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">
<item name="windowSplashScreenBackground">@color/dolphin_surface</item>
<item name="windowSplashScreenAnimatedIcon">@drawable/ic_dolphin</item>
@ -14,55 +14,138 @@
<!-- Base theme -->
<style name="Theme.Dolphin.Main" parent="Theme.Material3.DayNight.NoActionBar">
<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="colorPrimary">@color/dolphin_primary</item>
<item name="colorOnPrimary">@color/dolphin_onPrimary</item>
<item name="colorPrimaryContainer">@color/dolphin_primary</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:colorEdgeEffect">@color/dolphin_blue_secondary</item>
<item name="android:colorControlHighlight">@color/dolphin_secondary</item>
<item name="android:colorEdgeEffect">@color/dolphin_onSurfaceVariant</item>
<!-- Enable window content transitions -->
<item name="android:windowContentTransitions">true</item>
<item name="android:windowAllowEnterTransitionOverlap">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>
<!-- Global alert dialog style -->
<item name="alertDialogTheme">@style/DolphinDialogBase</item>
<item name="android:windowLightStatusBar" tools:targetApi="m">@bool/lightStatusBar</item>
<item name="materialAlertDialogTheme">@style/DolphinMaterialDialog</item>
<item name="popupTheme">@style/DolphinPopup</item>
<item name="sliderStyle">@style/DolphinSlider</item>
</style>
<style name="Theme.Dolphin.Main.Emulation" parent="Theme.Dolphin.Main">
<item name="android:windowBackground">@android:color/black</item>
<style name="Theme.Dolphin.Main.Material" parent="Theme.Dolphin.Main">
<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>
<!-- Inherit from a base file picker theme that handles day/night -->
<style name="Theme.Dolphin.FilePicker" parent="FilePickerBaseTheme">
<item name="colorPrimary">@color/dolphin_blue</item>
<item name="colorPrimaryDark">@color/dolphin_blue</item>
<item name="colorAccent">@color/dolphin_blue_secondary</item>
<item name="colorPrimary">@color/dolphin_filepicker</item>
<item name="colorPrimaryDark">@color/dolphin_filepicker</item>
<item name="colorAccent">@color/dolphin_filepicker</item>
<!-- Setting a divider is entirely optional -->
<item name="nnf_list_item_divider">?android:attr/listDivider</item>
<!-- If you want to set a specific toolbar theme, do it here -->
<item name="nnf_toolbarTheme">@style/ThemeOverlay.Material3.Dark.ActionBar</item>
<!-- Global alert dialog style -->
<item name="alertDialogTheme">@style/DolphinDialogBase</item>
</style>
<style name="Theme.Dolphin.TV" parent="Theme.Leanback.Browse">
@ -74,7 +157,7 @@
<!-- Use CustomTitleView as the leanback title view. -->
<item name="browseTitleViewLayout">@layout/titleview</item>
<!-- Global alert dialog style -->
<item name="alertDialogTheme">@style/DolphinDialogBase</item>
<!-- Global AlertDialog Theme -->
<item name="alertDialogTheme">@style/DolphinTVDialog</item>
</style>
</resources>

View File

@ -39,10 +39,10 @@ bool IsSettingSaveable(const Config::Location& config_location)
// TODO: Kill the current Android controller mappings system
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",
"LastPlatformTab", "MotionControls", "PhoneRumble", "ShowInputOverlay",
"IRMode", "IRAlwaysRecenter", "ShowGameTitles"};
"IRMode", "IRAlwaysRecenter", "ShowGameTitles", "InterfaceTheme"};
return std::any_of(
android_setting_saveable.cbegin(), android_setting_saveable.cend(),