diff --git a/OsmAnd-java/src/main/java/net/osmand/render/RenderingRuleStorageProperties.java b/OsmAnd-java/src/main/java/net/osmand/render/RenderingRuleStorageProperties.java index e4d65a7386..7b785c4e5e 100644 --- a/OsmAnd-java/src/main/java/net/osmand/render/RenderingRuleStorageProperties.java +++ b/OsmAnd-java/src/main/java/net/osmand/render/RenderingRuleStorageProperties.java @@ -10,6 +10,7 @@ public class RenderingRuleStorageProperties { public static final String UI_CATEGORY_HIDDEN = "ui_hidden"; public static final String A_ENGINE_V1 = "engine_v1"; public static final String A_APP_MODE= "appMode"; + public static final String A_BASE_APP_MODE = "baseAppMode"; public static final String A_DEFAULT_COLOR = "defaultColor"; public static final String A_SHADOW_RENDERING = "shadowRendering"; diff --git a/OsmAnd/src/net/osmand/plus/OsmandSettings.java b/OsmAnd/src/net/osmand/plus/OsmandSettings.java index a3038045f5..34436b51d5 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandSettings.java +++ b/OsmAnd/src/net/osmand/plus/OsmandSettings.java @@ -2982,10 +2982,8 @@ public class OsmandSettings { } { - CommonPreference pref = getCustomRenderProperty("appMode"); - pref.setModeDefaultValue(ApplicationMode.CAR, "car"); - pref.setModeDefaultValue(ApplicationMode.PEDESTRIAN, "pedestrian"); - pref.setModeDefaultValue(ApplicationMode.BICYCLE, "bicycle"); + getCustomRenderProperty("appMode"); + getCustomRenderProperty("defAppMode"); } Map> customBooleanRendersProps = new LinkedHashMap>(); diff --git a/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java b/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java index bc34487e12..9468c9cc86 100644 --- a/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java +++ b/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java @@ -1176,6 +1176,7 @@ public class ConfigureMapMenu { private boolean isPropertyAccepted(RenderingRuleProperty p) { return !(p.getAttrName().equals(RenderingRuleStorageProperties.A_APP_MODE) || + p.getAttrName().equals(RenderingRuleStorageProperties.A_BASE_APP_MODE) || p.getAttrName().equals(RenderingRuleStorageProperties.A_ENGINE_V1) || p.getAttrName().equals(HIKING_ROUTES_OSMC_ATTR) || p.getAttrName().equals(ROAD_STYLE_ATTR) || diff --git a/OsmAnd/src/net/osmand/plus/render/MapRenderRepositories.java b/OsmAnd/src/net/osmand/plus/render/MapRenderRepositories.java index 5f5e63e700..f4ce51cf88 100644 --- a/OsmAnd/src/net/osmand/plus/render/MapRenderRepositories.java +++ b/OsmAnd/src/net/osmand/plus/render/MapRenderRepositories.java @@ -66,7 +66,6 @@ import android.os.Looper; import android.widget.Toast; public class MapRenderRepositories { - // It is needed to not draw object twice if user have map index that intersects by boundaries public static boolean checkForDuplicateObjectIds = true; @@ -644,9 +643,17 @@ public class MapRenderRepositories { // find selected rendering type OsmandApplication app = ((OsmandApplication) context.getApplicationContext()); boolean nightMode = app.getDaynightHelper().isNightMode(); + // boolean moreDetail = prefs.SHOW_MORE_MAP_DETAIL.get(); RenderingRulesStorage storage = app.getRendererRegistry().getCurrentSelectedRenderer(); + prefs.getCustomRenderProperty("appMode").setModeValue(prefs.APPLICATION_MODE.get(), + app.getSettings().APPLICATION_MODE.get().getStringKey()); + prefs.getCustomRenderProperty("baseAppMode").setModeValue(prefs.APPLICATION_MODE.get(), + app.getSettings().APPLICATION_MODE.get().getParent() != null + ? prefs.APPLICATION_MODE.get().getParent().getStringKey() + : prefs.APPLICATION_MODE.get().getStringKey()); RenderingRuleSearchRequest renderingReq = getSearchRequestWithAppliedCustomRules(storage, nightMode); + renderingReq.saveState(); NativeOsmandLibrary nativeLib = !prefs.SAFE_MODE.get() ? NativeOsmandLibrary.getLibrary(storage, context) : null;