Fix defaultColor

This commit is contained in:
Alexey Kulish 2017-07-19 15:27:26 +03:00
parent e726a0cc99
commit a61a7e2d03
2 changed files with 11 additions and 6 deletions

View file

@ -1091,12 +1091,15 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
if (mapView.getMapRenderer() != null) {
NativeCoreContext.getMapRendererContext().updateMapSettings();
}
mapView.resetDefaultColor();
if (registry.getCurrentSelectedRenderer() != newRenderer) {
registry.setCurrentSelectedRender(newRenderer);
app.getResourceManager().getRenderer().clearCache();
mapView.resetDefaultColor();
mapView.refreshMap(true);
} else {
mapView.resetDefaultColor();
}
return null;
}

View file

@ -615,11 +615,13 @@ public class OsmandMapTileView implements IMapDownloaderCallback {
private int updateDefaultColor(boolean nightMode) {
int color = MAP_DEFAULT_COLOR;
RenderingRulesStorage rrs = application.getRendererRegistry().getCurrentSelectedRenderer();
RenderingRuleSearchRequest req = new RenderingRuleSearchRequest(rrs);
req.setBooleanFilter(rrs.PROPS.R_NIGHT_MODE, nightMode);
if (req.searchRenderingAttribute(RenderingRuleStorageProperties.A_DEFAULT_COLOR)) {
color = req.getIntPropertyValue(req.ALL.R_ATTR_COLOR_VALUE);
defaultColor = color;
if (rrs != null) {
RenderingRuleSearchRequest req = new RenderingRuleSearchRequest(rrs);
req.setBooleanFilter(rrs.PROPS.R_NIGHT_MODE, nightMode);
if (req.searchRenderingAttribute(RenderingRuleStorageProperties.A_DEFAULT_COLOR)) {
color = req.getIntPropertyValue(req.ALL.R_ATTR_COLOR_VALUE);
defaultColor = color;
}
}
return color;
}