Check if selected theme it's not the current
This commit is contained in:
parent
f8d9e0fa60
commit
6ec393699e
|
@ -98,6 +98,8 @@ public class SettingsFragment extends PreferenceFragment
|
|||
downloadPathAudioPreference = findPreference(DOWNLOAD_PATH_AUDIO_PREFERENCE);
|
||||
themePreference = findPreference(THEME);
|
||||
|
||||
final String currentTheme = defaultPreferences.getString(THEME, "Light");
|
||||
|
||||
prefListener = new SharedPreferences.OnSharedPreferenceChangeListener() {
|
||||
@Override
|
||||
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences,
|
||||
|
@ -139,9 +141,10 @@ public class SettingsFragment extends PreferenceFragment
|
|||
}
|
||||
else if (key == THEME)
|
||||
{
|
||||
String theme = sharedPreferences.getString(THEME, "Light");
|
||||
themePreference.setSummary(theme);
|
||||
String selectedTheme = sharedPreferences.getString(THEME, "Light");
|
||||
themePreference.setSummary(selectedTheme);
|
||||
|
||||
if(!selectedTheme.equals(currentTheme)) { // If it's not the current theme
|
||||
new AlertDialog.Builder(activity)
|
||||
.setTitle(R.string.restart_title)
|
||||
.setMessage(R.string.msg_restart)
|
||||
|
@ -159,6 +162,7 @@ public class SettingsFragment extends PreferenceFragment
|
|||
.setNegativeButton(R.string.later, null)
|
||||
.create().show();
|
||||
}
|
||||
}
|
||||
updateSummary();
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue