diff --git a/OsmAnd/res/xml/global_settings.xml b/OsmAnd/res/xml/global_settings.xml index 2e95524c79..db5b667f2d 100644 --- a/OsmAnd/res/xml/global_settings.xml +++ b/OsmAnd/res/xml/global_settings.xml @@ -46,6 +46,7 @@ android:icon="@drawable/ic_action_notification" android:key="do_not_show_startup_messages" android:layout="@layout/preference_switch_with_descr" + android:persistent="false" android:summaryOff="@string/shared_string_off" android:summaryOn="@string/shared_string_on" android:title="@string/start_up_message_pref" /> diff --git a/OsmAnd/src/net/osmand/plus/OsmandSettings.java b/OsmAnd/src/net/osmand/plus/OsmandSettings.java index 7580a69044..8196bb1806 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandSettings.java +++ b/OsmAnd/src/net/osmand/plus/OsmandSettings.java @@ -1391,7 +1391,7 @@ public class OsmandSettings { public final OsmandPreference SEND_ANONYMOUS_DATA_REQUESTS_COUNT = new IntPreference("send_anonymous_data_requests_count", 0).makeGlobal().cache(); public final OsmandPreference SEND_ANONYMOUS_DATA_LAST_REQUEST_NS = new IntPreference("send_anonymous_data_last_request_ns", -1).makeGlobal().cache(); - public final OsmandPreference MAP_EMPTY_STATE_ALLOWED = new BooleanPreference("map_empty_state_allowed", true).makeProfile().makeGeneral().cache(); + public final OsmandPreference MAP_EMPTY_STATE_ALLOWED = new BooleanPreference("map_empty_state_allowed", false).makeProfile().makeGeneral().cache(); public final CommonPreference TEXT_SCALE = new FloatPreference("text_scale", 1f).makeProfile().cache(); @@ -3021,9 +3021,12 @@ public class OsmandSettings { return false; } - ; }; + { + RENDERER.setModeDefaultValue(ApplicationMode.BOAT, RendererRegistry.NAUTICAL_RENDER); + RENDERER.setModeDefaultValue(ApplicationMode.SKI, RendererRegistry.WINTER_SKI_RENDER); + } Map> customRendersProps = new LinkedHashMap>(); diff --git a/OsmAnd/src/net/osmand/plus/dialogs/SendAnalyticsBottomSheetDialogFragment.java b/OsmAnd/src/net/osmand/plus/dialogs/SendAnalyticsBottomSheetDialogFragment.java index 2509402319..d212b7e76d 100644 --- a/OsmAnd/src/net/osmand/plus/dialogs/SendAnalyticsBottomSheetDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/dialogs/SendAnalyticsBottomSheetDialogFragment.java @@ -54,8 +54,16 @@ public class SendAnalyticsBottomSheetDialogFragment extends MenuBottomSheetDialo items.add(new SubtitleDividerItem(context)); - sendAnonymousMapDownloadsData = app.getSettings().SEND_ANONYMOUS_MAP_DOWNLOADS_DATA.get(); - sendAnonymousAppUsageData = app.getSettings().SEND_ANONYMOUS_APP_USAGE_DATA.get(); + if (app.getSettings().SEND_ANONYMOUS_MAP_DOWNLOADS_DATA.isSet()) { + sendAnonymousMapDownloadsData = app.getSettings().SEND_ANONYMOUS_MAP_DOWNLOADS_DATA.get(); + } else { + sendAnonymousMapDownloadsData = true; + } + if (app.getSettings().SEND_ANONYMOUS_APP_USAGE_DATA.isSet()) { + sendAnonymousAppUsageData = app.getSettings().SEND_ANONYMOUS_APP_USAGE_DATA.get(); + } else { + sendAnonymousAppUsageData = true; + } final BottomSheetItemWithCompoundButton[] downloadedMapsItem = new BottomSheetItemWithCompoundButton[1]; downloadedMapsItem[0] = (BottomSheetItemWithCompoundButton) new BottomSheetItemWithCompoundButton.Builder() .setChecked(sendAnonymousMapDownloadsData) diff --git a/OsmAnd/src/net/osmand/plus/settings/GlobalSettingsFragment.java b/OsmAnd/src/net/osmand/plus/settings/GlobalSettingsFragment.java index 1eb702376b..aaff3a914a 100644 --- a/OsmAnd/src/net/osmand/plus/settings/GlobalSettingsFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/GlobalSettingsFragment.java @@ -30,6 +30,7 @@ public class GlobalSettingsFragment extends BaseSettingsFragment implements Send setupExternalStorageDirPref(); setupSendAnonymousDataPref(); + setupShowStartupMessagesPref(); setupEnableProxyPref(); } @@ -66,6 +67,11 @@ public class GlobalSettingsFragment extends BaseSettingsFragment implements Send } } return false; + } else if (prefId.equals(settings.DO_NOT_SHOW_STARTUP_MESSAGES.getId())) { + if (newValue instanceof Boolean) { + boolean enabled = !(Boolean) newValue; + return settings.DO_NOT_SHOW_STARTUP_MESSAGES.set(enabled); + } } return super.onPreferenceChange(preference, newValue); @@ -165,6 +171,13 @@ public class GlobalSettingsFragment extends BaseSettingsFragment implements Send sendAnonymousData.setChecked(enabled); } + private void setupShowStartupMessagesPref() { + boolean enabled = !settings.DO_NOT_SHOW_STARTUP_MESSAGES.get(); // pref ui was inverted + + SwitchPreferenceCompat sendAnonymousData = (SwitchPreferenceCompat) findPreference(settings.DO_NOT_SHOW_STARTUP_MESSAGES.getId()); + sendAnonymousData.setChecked(enabled); + } + private void setupEnableProxyPref() { SwitchPreferenceEx enableProxy = (SwitchPreferenceEx) findPreference(settings.ENABLE_PROXY.getId()); enableProxy.setIcon(getContentIcon(R.drawable.ic_action_proxy));