Introduce new property engine_v1

This commit is contained in:
Victor Shcherb 2014-12-03 21:26:15 +01:00
parent c98c104421
commit edd72827f3
3 changed files with 12 additions and 3 deletions

View file

@ -7,6 +7,9 @@ import java.util.Map;
public class RenderingRuleStorageProperties { 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_DEFAULT_COLOR = "defaultColor";
public static final String A_SHADOW_RENDERING = "shadowRendering"; public static final String A_SHADOW_RENDERING = "shadowRendering";
public static final String ATTR_INT_VALUE = "attrIntValue"; public static final String ATTR_INT_VALUE = "attrIntValue";

View file

@ -20,6 +20,7 @@ import net.osmand.plus.activities.SettingsActivity;
import net.osmand.plus.activities.TransportRouteHelper; import net.osmand.plus.activities.TransportRouteHelper;
import net.osmand.plus.views.OsmandMapTileView; import net.osmand.plus.views.OsmandMapTileView;
import net.osmand.render.RenderingRuleProperty; import net.osmand.render.RenderingRuleProperty;
import net.osmand.render.RenderingRuleStorageProperties;
import net.osmand.render.RenderingRulesStorage; import net.osmand.render.RenderingRulesStorage;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.content.DialogInterface; import android.content.DialogInterface;
@ -326,7 +327,8 @@ public class ConfigureMapMenu {
List<RenderingRuleProperty> customRules ){ List<RenderingRuleProperty> customRules ){
final OsmandMapTileView view = activity.getMapView(); final OsmandMapTileView view = activity.getMapView();
for (final RenderingRuleProperty p : customRules) { 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; continue;
} }
String propertyName = SettingsActivity.getStringPropertyName(view.getContext(), p.getAttrName(), String propertyName = SettingsActivity.getStringPropertyName(view.getContext(), p.getAttrName(),

View file

@ -586,8 +586,12 @@ public class MapRenderRepositories {
renderingReq.setBooleanFilter(renderingReq.ALL.R_NIGHT_MODE, nightMode); renderingReq.setBooleanFilter(renderingReq.ALL.R_NIGHT_MODE, nightMode);
for (RenderingRuleProperty customProp : storage.PROPS.getCustomRules()) { for (RenderingRuleProperty customProp : storage.PROPS.getCustomRules()) {
if (customProp.isBoolean()) { if (customProp.isBoolean()) {
CommonPreference<Boolean> pref = prefs.getCustomRenderBooleanProperty(customProp.getAttrName()); if(customProp.getAttrName().equals(RenderingRuleStorageProperties.A_ENGINE_V1)) {
renderingReq.setBooleanFilter(customProp, pref.get()); renderingReq.setBooleanFilter(customProp, true);
} else {
CommonPreference<Boolean> pref = prefs.getCustomRenderBooleanProperty(customProp.getAttrName());
renderingReq.setBooleanFilter(customProp, pref.get());
}
} else { } else {
CommonPreference<String> settings = prefs.getCustomRenderProperty(customProp.getAttrName()); CommonPreference<String> settings = prefs.getCustomRenderProperty(customProp.getAttrName());
String res = settings.get(); String res = settings.get();