mirror of
https://github.com/revanced/revanced-integrations.git
synced 2025-01-07 10:35:49 +01:00
fix(YouTube - Settings): Correctly initialize default values
This commit is contained in:
parent
9920116f63
commit
752544b962
@ -164,7 +164,7 @@ public abstract class AbstractPreferenceFragment extends PreferenceFragment {
|
|||||||
} else if (pref instanceof EditTextPreference) {
|
} else if (pref instanceof EditTextPreference) {
|
||||||
EditTextPreference editPreference = (EditTextPreference) pref;
|
EditTextPreference editPreference = (EditTextPreference) pref;
|
||||||
if (applySettingToPreference) {
|
if (applySettingToPreference) {
|
||||||
editPreference.getEditText().setText(setting.get().toString());
|
editPreference.setText(setting.get().toString());
|
||||||
} else {
|
} else {
|
||||||
Setting.privateSetValueFromString(setting, editPreference.getText());
|
Setting.privateSetValueFromString(setting, editPreference.getText());
|
||||||
}
|
}
|
||||||
|
@ -14,12 +14,12 @@ import app.revanced.integrations.youtube.settings.Settings;
|
|||||||
public class ReVancedPreferenceFragment extends AbstractPreferenceFragment {
|
public class ReVancedPreferenceFragment extends AbstractPreferenceFragment {
|
||||||
@Override
|
@Override
|
||||||
protected void initialize() {
|
protected void initialize() {
|
||||||
|
super.initialize();
|
||||||
|
|
||||||
// If the preference was included, then initialize it based on the available playback speed
|
// If the preference was included, then initialize it based on the available playback speed
|
||||||
Preference defaultSpeedPreference = findPreference(Settings.PLAYBACK_SPEED_DEFAULT.key);
|
Preference defaultSpeedPreference = findPreference(Settings.PLAYBACK_SPEED_DEFAULT.key);
|
||||||
if (defaultSpeedPreference instanceof ListPreference) {
|
if (defaultSpeedPreference instanceof ListPreference) {
|
||||||
CustomPlaybackSpeedPatch.initializeListPreference((ListPreference) defaultSpeedPreference);
|
CustomPlaybackSpeedPatch.initializeListPreference((ListPreference) defaultSpeedPreference);
|
||||||
}
|
}
|
||||||
|
|
||||||
super.initialize();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user