Skip restart when night mode change (#2454)

This commit is contained in:
Howard Wu 2023-03-23 00:14:07 +08:00 committed by GitHub
parent a185496e41
commit 98ec80c28e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 4 deletions

View File

@ -235,10 +235,6 @@ public class SettingsFragment extends BaseFragment {
theme.setOnPreferenceChangeListener((preference, newValue) -> {
if (!App.getPreferences().getString("dark_theme", ThemeUtil.MODE_NIGHT_FOLLOW_SYSTEM).equals(newValue)) {
AppCompatDelegate.setDefaultNightMode(ThemeUtil.getDarkTheme((String) newValue));
MainActivity activity = (MainActivity) getActivity();
if (activity != null) {
activity.restart();
}
}
return true;
});