fix: sb does not turn off

This commit is contained in:
TheJeterLP 2022-07-31 13:44:29 +02:00
parent a2a515d2d9
commit 97c184b5fb
No known key found for this signature in database
GPG Key ID: D8CFD6FCF7215E6C
2 changed files with 3 additions and 1 deletions

View File

@ -33,13 +33,14 @@ public class ReturnYouTubeDislikeSettingsFragment extends PreferenceFragment {
SwitchPreference preference = new SwitchPreference(context);
preferenceScreen.addPreference(preference);
preference.setKey(SettingsEnum.RYD_ENABLED.getPath());
preference.setDefaultValue(false);
preference.setDefaultValue(SettingsEnum.RYD_ENABLED.getDefaultValue());
preference.setChecked(SettingsEnum.RYD_ENABLED.getBoolean());
preference.setTitle(str("revanced_ryd_title"));
preference.setSummary(str("revanced_ryd_summary"));
preference.setOnPreferenceChangeListener((pref, newValue) -> {
final boolean value = (Boolean) newValue;
ReturnYouTubeDislike.onEnabledChange(value);
SettingsEnum.RYD_ENABLED.saveValue(value);
return true;
});
}

View File

@ -66,6 +66,7 @@ public class SponsorBlockSettingsFragment extends PreferenceFragment implements
preference.setOnPreferenceChangeListener((preference1, newValue) -> {
final boolean value = (Boolean) newValue;
enableCategoriesIfNeeded(value);
SettingsEnum.SB_ENABLED.saveValue(newValue);
return true;
});
}