android: frontend: settings: Simplify sliders.
This commit is contained in:
parent
a927bad573
commit
e0ac8635e3
@ -7,19 +7,25 @@ import org.citra.citra_android.utils.Log;
|
||||
import org.citra.citra_android.utils.SettingsFile;
|
||||
|
||||
public final class SliderSetting extends SettingsItem {
|
||||
private int mMin;
|
||||
private int mMax;
|
||||
private int mDefaultValue;
|
||||
|
||||
private String mUnits;
|
||||
|
||||
public SliderSetting(String key, String section, int file, int titleId, int descriptionId,
|
||||
int max, String units, int defaultValue, Setting setting) {
|
||||
int min, int max, String units, int defaultValue, Setting setting) {
|
||||
super(key, section, file, setting, titleId, descriptionId);
|
||||
mMin = min;
|
||||
mMax = max;
|
||||
mUnits = units;
|
||||
mDefaultValue = defaultValue;
|
||||
}
|
||||
|
||||
public int getMin() {
|
||||
return mMin;
|
||||
}
|
||||
|
||||
public int getMax() {
|
||||
return mMax;
|
||||
}
|
||||
|
@ -237,6 +237,7 @@ public final class SettingsAdapter extends RecyclerView.Adapter<SettingViewHolde
|
||||
TextView units = view.findViewById(R.id.text_units);
|
||||
units.setText(item.getUnits());
|
||||
|
||||
seekbar.setMin(item.getMin());
|
||||
seekbar.setMax(item.getMax());
|
||||
seekbar.setProgress(mSeekbarProgress);
|
||||
|
||||
|
@ -132,7 +132,7 @@ public final class SettingsFragmentPresenter {
|
||||
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_CPU_JIT, SettingsFile.SECTION_CORE, SettingsFile.SETTINGS_DOLPHIN, R.string.cpu_jit, R.string.cpu_jit_description, true, useCpuJit, true, mView));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_FRAME_LIMIT_ENABLED, SettingsFile.SECTION_RENDERER, SettingsFile.SETTINGS_DOLPHIN, R.string.frame_limit_enable, R.string.frame_limit_enable_description, true, frameLimitEnable));
|
||||
sl.add(new SliderSetting(SettingsFile.KEY_FRAME_LIMIT, SettingsFile.SECTION_RENDERER, SettingsFile.SETTINGS_DOLPHIN, R.string.frame_limit_slider, R.string.frame_limit_slider_description, 500, "%", 100, frameLimitValue));
|
||||
sl.add(new SliderSetting(SettingsFile.KEY_FRAME_LIMIT, SettingsFile.SECTION_RENDERER, SettingsFile.SETTINGS_DOLPHIN, R.string.frame_limit_slider, R.string.frame_limit_slider_description, 0, 200, "%", 100, frameLimitValue));
|
||||
}
|
||||
|
||||
private void addSystemSettings(ArrayList<SettingsItem> sl) {
|
||||
@ -262,7 +262,7 @@ public final class SettingsFragmentPresenter {
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_HW_RENDERER, SettingsFile.SECTION_RENDERER, SettingsFile.SETTINGS_DOLPHIN, R.string.hw_renderer, R.string.hw_renderer_description, true, hardwareRenderer, true, mView));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_HW_SHADER, SettingsFile.SECTION_RENDERER, SettingsFile.SETTINGS_DOLPHIN, R.string.hw_shaders, R.string.hw_shaders_description, true, hardwareShader, true, mView));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_SHADERS_ACCURATE_MUL, SettingsFile.SECTION_RENDERER, SettingsFile.SETTINGS_DOLPHIN, R.string.shaders_accurate_mul, R.string.shaders_accurate_mul_description, true, shadersAccurateMul));
|
||||
sl.add(new SliderSetting(SettingsFile.KEY_RESOLUTION_FACTOR, SettingsFile.SECTION_RENDERER, SettingsFile.SETTINGS_DOLPHIN, R.string.internal_resolution, R.string.internal_resolution_description, 10, "x", 1, resolutionFactor));
|
||||
sl.add(new SliderSetting(SettingsFile.KEY_RESOLUTION_FACTOR, SettingsFile.SECTION_RENDERER, SettingsFile.SETTINGS_DOLPHIN, R.string.internal_resolution, R.string.internal_resolution_description, 1, 4, "x", 1, resolutionFactor));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_USE_VSYNC, SettingsFile.SECTION_RENDERER, SettingsFile.SETTINGS_DOLPHIN, R.string.vsync, R.string.vsync_description, false, vsyncEnable));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_FILTER_MODE, SettingsFile.SECTION_RENDERER, SettingsFile.SETTINGS_DOLPHIN, R.string.linear_filtering, R.string.linear_filtering_description, true, filterMode));
|
||||
}
|
||||
|
@ -70,7 +70,7 @@
|
||||
<string name="frame_limit_slider">Limit speed percent</string>
|
||||
<string name="frame_limit_slider_description">Specifies the percentage to limit emulation speed. With the default of 100% emulation will be limited to normal speed. Values higher or lower will increase or decrease the speed limit.</string>
|
||||
<string name="internal_resolution">Internal resolution</string>
|
||||
<string name="internal_resolution_description">Specifies the resolution used to render at. A high resolution will improve visual quality a lot but is also quite heavy on performance and might cause glitches in certain games. Use zero(0) for auto scaling.</string>
|
||||
<string name="internal_resolution_description">Specifies the resolution used to render at. A high resolution will improve visual quality a lot but is also quite heavy on performance and might cause glitches in certain games.</string>
|
||||
|
||||
<!-- Audio settings strings -->
|
||||
<string name="audio_stretch">Enable audio stretching</string>
|
||||
|
Loading…
x
Reference in New Issue
Block a user