fix(YouTube - Settings): Correctly initialize default values

This commit is contained in:
LisoUseInAIKyrios 2024-01-06 21:28:41 +04:00
parent 9920116f63
commit 752544b962
2 changed files with 3 additions and 3 deletions

View File

@ -164,7 +164,7 @@ public abstract class AbstractPreferenceFragment extends PreferenceFragment {
} else if (pref instanceof EditTextPreference) {
EditTextPreference editPreference = (EditTextPreference) pref;
if (applySettingToPreference) {
editPreference.getEditText().setText(setting.get().toString());
editPreference.setText(setting.get().toString());
} else {
Setting.privateSetValueFromString(setting, editPreference.getText());
}

View File

@ -14,12 +14,12 @@ import app.revanced.integrations.youtube.settings.Settings;
public class ReVancedPreferenceFragment extends AbstractPreferenceFragment {
@Override
protected void initialize() {
super.initialize();
// If the preference was included, then initialize it based on the available playback speed
Preference defaultSpeedPreference = findPreference(Settings.PLAYBACK_SPEED_DEFAULT.key);
if (defaultSpeedPreference instanceof ListPreference) {
CustomPlaybackSpeedPatch.initializeListPreference((ListPreference) defaultSpeedPreference);
}
super.initialize();
}
}