Skip to content

Commit

Permalink
toast
Browse files Browse the repository at this point in the history
show a warning when theme is changed; "app restart may be needed for changes to take effect". #492
  • Loading branch information
forrestguice committed Mar 17, 2021
1 parent ef79fba commit 18ad13c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ private void onPickTheme(int requestCode, int resultCode, Intent data)
pref.putString(prefKeyForRequestCode(requestCode), selection);
pref.apply();
rebuildActivity();
Toast.makeText(context, context.getString(R.string.restart_required_message), Toast.LENGTH_LONG).show();

} else if (adapterModified) {
rebuildActivity();
Expand Down Expand Up @@ -1381,6 +1382,7 @@ private static Preference.OnPreferenceChangeListener onOverrideThemeChanged(fina
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
overridePref.setActionButtonPreferenceListener(createThemeListPreferenceListener(activity, (String)newValue, requestCode));
Toast.makeText(activity, activity.getString(R.string.restart_required_message), Toast.LENGTH_LONG).show();
return true;
}
};
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1748,7 +1748,8 @@
<string name="security_duplicate_permissions">A permission that belongs to Suntimes:\n\n<xliff:g id="permissionName" example="suntimes.permission.READ_CALENDAR">%1$s</xliff:g>\n\nis also defined by: <xliff:g id="packageName" example="some.other.app">%2$s</xliff:g></string>
<string name="feature_not_supported_by_api">This feature is not supported by API %1$s.</string>
<string name="feature_not_supported_by_source">This feature is not supported by the current data source.</string>
<string name="reboot_required_message">A reboot may be needed for changes to take effect.</string>
<string name="reboot_required_message">A reboot may be needed for changes to take effect.</string> <!-- toast; device off/on may be required -->
<string name="restart_required_message">A restart may be needed for changes to take full effect.</string> <!-- toast; app restart may be required --> <!-- TODO -->

<string name="dialog_ok">OK</string>
<string name="dialog_cancel">Cancel</string>
Expand Down

0 comments on commit 18ad13c

Please sign in to comment.