fix[TouchController]: Fixed slider preferences of TouchController vibrate length

This commit is contained in:
fifth_light 2025-07-16 20:49:16 +08:00
parent 0765ce7991
commit 71a28fa5fb
No known key found for this signature in database
GPG Key ID: 980E55EC56F8AFA5

View File

@ -13,6 +13,7 @@ import net.kdt.pojavlaunch.prefs.LauncherPreferences;
public class LauncherPreferenceControlFragment extends LauncherPreferenceFragment {
private boolean mGyroAvailable = false;
@Override
public void onCreatePreferences(Bundle b, String str) {
// Get values
@ -20,6 +21,7 @@ public class LauncherPreferenceControlFragment extends LauncherPreferenceFragmen
int prefButtonSize = (int) LauncherPreferences.PREF_BUTTONSIZE;
int mouseScale = (int) (LauncherPreferences.PREF_MOUSESCALE * 100);
int gyroSampleRate = LauncherPreferences.PREF_GYRO_SAMPLE_RATE;
int touchControllerVibrateLength = LauncherPreferences.PREF_TOUCHCONTROLLER_VIBRATE_LENGTH;
float mouseSpeed = LauncherPreferences.PREF_MOUSESPEED;
float gyroSpeed = LauncherPreferences.PREF_GYRO_SENSITIVITY;
float joystickDeadzone = LauncherPreferences.PREF_DEADZONE_SCALE;
@ -71,6 +73,13 @@ public class LauncherPreferenceControlFragment extends LauncherPreferenceFragmen
CustomSeekBarPreference.class);
gyroSampleRateSeek.setValue(gyroSampleRate);
gyroSampleRateSeek.setSuffix(" ms");
CustomSeekBarPreference touchControllerVibrateLengthSeek = requirePreference(
"touchControllerVibrateLength",
CustomSeekBarPreference.class);
touchControllerVibrateLengthSeek.setValue(touchControllerVibrateLength);
touchControllerVibrateLengthSeek.setSuffix(" ms");
computeVisibility();
}