From edd72827f3b7fd76f179cab554c0c953bba66e0c Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Wed, 3 Dec 2014 21:26:15 +0100 Subject: [PATCH] Introduce new property engine_v1 --- .../net/osmand/render/RenderingRuleStorageProperties.java | 3 +++ OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java | 4 +++- .../src/net/osmand/plus/render/MapRenderRepositories.java | 8 ++++++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/OsmAnd-java/src/net/osmand/render/RenderingRuleStorageProperties.java b/OsmAnd-java/src/net/osmand/render/RenderingRuleStorageProperties.java index 3ce078ef41..e5d7982947 100644 --- a/OsmAnd-java/src/net/osmand/render/RenderingRuleStorageProperties.java +++ b/OsmAnd-java/src/net/osmand/render/RenderingRuleStorageProperties.java @@ -7,6 +7,9 @@ import java.util.Map; public class RenderingRuleStorageProperties { + public static final String A_ENGINE_V1 = "engine_v1"; + public static final String A_APP_MODE= "appMode"; + public static final String A_DEFAULT_COLOR = "defaultColor"; public static final String A_SHADOW_RENDERING = "shadowRendering"; public static final String ATTR_INT_VALUE = "attrIntValue"; diff --git a/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java b/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java index 41adfbfd1c..7a801e812e 100644 --- a/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java +++ b/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java @@ -20,6 +20,7 @@ import net.osmand.plus.activities.SettingsActivity; import net.osmand.plus.activities.TransportRouteHelper; import net.osmand.plus.views.OsmandMapTileView; import net.osmand.render.RenderingRuleProperty; +import net.osmand.render.RenderingRuleStorageProperties; import net.osmand.render.RenderingRulesStorage; import android.app.AlertDialog; import android.content.DialogInterface; @@ -326,7 +327,8 @@ public class ConfigureMapMenu { List customRules ){ final OsmandMapTileView view = activity.getMapView(); for (final RenderingRuleProperty p : customRules) { - if (p.getAttrName().equals("appMode")){ + if (p.getAttrName().equals(RenderingRuleStorageProperties.A_APP_MODE) || + p.getAttrName().equals(RenderingRuleStorageProperties.A_ENGINE_V1)){ continue; } String propertyName = SettingsActivity.getStringPropertyName(view.getContext(), p.getAttrName(), diff --git a/OsmAnd/src/net/osmand/plus/render/MapRenderRepositories.java b/OsmAnd/src/net/osmand/plus/render/MapRenderRepositories.java index 915dd55d99..686958df80 100644 --- a/OsmAnd/src/net/osmand/plus/render/MapRenderRepositories.java +++ b/OsmAnd/src/net/osmand/plus/render/MapRenderRepositories.java @@ -586,8 +586,12 @@ public class MapRenderRepositories { renderingReq.setBooleanFilter(renderingReq.ALL.R_NIGHT_MODE, nightMode); for (RenderingRuleProperty customProp : storage.PROPS.getCustomRules()) { if (customProp.isBoolean()) { - CommonPreference pref = prefs.getCustomRenderBooleanProperty(customProp.getAttrName()); - renderingReq.setBooleanFilter(customProp, pref.get()); + if(customProp.getAttrName().equals(RenderingRuleStorageProperties.A_ENGINE_V1)) { + renderingReq.setBooleanFilter(customProp, true); + } else { + CommonPreference pref = prefs.getCustomRenderBooleanProperty(customProp.getAttrName()); + renderingReq.setBooleanFilter(customProp, pref.get()); + } } else { CommonPreference settings = prefs.getCustomRenderProperty(customProp.getAttrName()); String res = settings.get();