Change theme after pref switch
This commit is contained in:
parent
7003ba058f
commit
0a1335e4ee
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() {
|
public void updateAllSettings() {
|
||||||
PreferenceScreen screen = getPreferenceScreen();
|
PreferenceScreen screen = getPreferenceScreen();
|
||||||
if (screen != null) {
|
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) {
|
private void updateTargetSettings(boolean discard) {
|
||||||
BaseSettingsFragment target = (BaseSettingsFragment) getTargetFragment();
|
BaseSettingsFragment target = (BaseSettingsFragment) getTargetFragment();
|
||||||
if (target != null) {
|
if (target != null) {
|
||||||
target.updateAllSettings();
|
target.updateSetting(getPrefId());
|
||||||
if (!discard) {
|
if (!discard) {
|
||||||
if (target.shouldDismissOnChange()) {
|
if (target.shouldDismissOnChange()) {
|
||||||
target.dismiss();
|
target.dismiss();
|
||||||
|
|
Loading…
Reference in a new issue