Change theme after pref switch
This commit is contained in:
parent
3dea308641
commit
04c5c60723
3 changed files with 14 additions and 1 deletions
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue