Change theme after pref switch

This commit is contained in:
max-klaus 2019-11-12 18:10:55 +03:00
parent 3dea308641
commit 04c5c60723
3 changed files with 14 additions and 1 deletions

View file

@ -450,6 +450,10 @@ public abstract class BaseSettingsFragment extends PreferenceFragmentCompat impl
}
}
public void updateSetting(String prefId) {
updateAllSettings();
}
public void updateAllSettings() {
PreferenceScreen screen = getPreferenceScreen();
if (screen != null) {

View file

@ -402,4 +402,13 @@ public class GeneralProfileSettingsFragment extends BaseSettingsFragment impleme
}
}
}
@Override
public void updateSetting(String prefId) {
if (settings.OSMAND_THEME.getId().equals(prefId)) {
recreate();
return;
}
super.updateSetting(prefId);
}
}

View file

@ -107,7 +107,7 @@ public class ChangeGeneralProfilesPrefBottomSheet extends BasePreferenceBottomSh
private void updateTargetSettings(boolean discard) {
BaseSettingsFragment target = (BaseSettingsFragment) getTargetFragment();
if (target != null) {
target.updateAllSettings();
target.updateSetting(getPrefId());
if (!discard) {
if (target.shouldDismissOnChange()) {
target.dismiss();