Show toast after prefs restored
This commit is contained in:
parent
285749921b
commit
746932386c
5 changed files with 12 additions and 4 deletions
|
@ -11,6 +11,8 @@
|
|||
Thx - Hardy
|
||||
|
||||
-->
|
||||
<string name="plugin_prefs_reset_successful">All plugin settings restored to default state.</string>
|
||||
<string name="profile_prefs_reset_successful">All profile settings restored to default state.</string>
|
||||
<string name="ltr_or_rtl_combine_via_slash">%1$s/%2$s</string>
|
||||
<string name="sunset_at">Sunset at %1$s</string>
|
||||
<string name="sunrise_at">Sunrise at %1$s</string>
|
||||
|
|
|
@ -189,6 +189,7 @@ public class AccessibilitySettingsFragment extends BaseSettingsFragment implemen
|
|||
OsmandMonitoringPlugin plugin = OsmandPlugin.getPlugin(OsmandMonitoringPlugin.class);
|
||||
if (plugin != null) {
|
||||
app.getSettings().resetProfilePreferences(appMode, plugin.getPreferences());
|
||||
app.showToastMessage(R.string.plugin_prefs_reset_successful);
|
||||
updateAllSettings();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -484,6 +484,7 @@ public class MultimediaNotesFragment extends BaseSettingsFragment implements Cop
|
|||
AudioVideoNotesPlugin plugin = OsmandPlugin.getPlugin(AudioVideoNotesPlugin.class);
|
||||
if (plugin != null) {
|
||||
app.getSettings().resetProfilePreferences(appMode, plugin.getPreferences());
|
||||
app.showToastMessage(R.string.plugin_prefs_reset_successful);
|
||||
updateAllSettings();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -299,6 +299,7 @@ public class MonitoringSettingsFragment extends BaseSettingsFragment implements
|
|||
OsmandMonitoringPlugin plugin = OsmandPlugin.getPlugin(OsmandMonitoringPlugin.class);
|
||||
if (plugin != null) {
|
||||
app.getSettings().resetProfilePreferences(appMode, plugin.getPreferences());
|
||||
app.showToastMessage(R.string.plugin_prefs_reset_successful);
|
||||
updateAllSettings();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -165,12 +165,15 @@ public class ConfigureProfileFragment extends BaseSettingsFragment implements Co
|
|||
@Override
|
||||
public void resetAppModePrefs(ApplicationMode appMode) {
|
||||
if (appMode != null) {
|
||||
app.getSettings().resetPreferencesForProfile(appMode);
|
||||
boolean prefsRestored = app.getSettings().resetPreferencesForProfile(appMode);
|
||||
if (prefsRestored) {
|
||||
app.showToastMessage(R.string.profile_prefs_reset_successful);
|
||||
ApplicationMode.initModeParams(app, appMode);
|
||||
updateToolbar();
|
||||
updateAllSettings();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private RecyclerView.ItemDecoration createDividerItemDecoration() {
|
||||
final Drawable dividerLight = new ColorDrawable(ContextCompat.getColor(app, R.color.list_background_color_light));
|
||||
|
|
Loading…
Reference in a new issue