Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2017-03-20 20:24:06 +01:00
commit c6bbecca94
3 changed files with 14 additions and 2 deletions

View file

@ -99,9 +99,11 @@ public class ConfigureMapMenu {
});
RenderingRulesStorage renderer = ma.getMyApplication().getRendererRegistry().getCurrentSelectedRenderer();
List<RenderingRuleProperty> customRules = new ArrayList<>();
boolean hasDepthContours = ma.getMyApplication().getResourceManager().hasDepthContours();
if (renderer != null) {
for (RenderingRuleProperty p : renderer.PROPS.getCustomRules()) {
if (!RenderingRuleStorageProperties.UI_CATEGORY_HIDDEN.equals(p.getCategory())) {
if (!RenderingRuleStorageProperties.UI_CATEGORY_HIDDEN.equals(p.getCategory())
&& (hasDepthContours || !p.getAttrName().equals("depthContours"))) {
customRules.add(p);
}
}

View file

@ -132,6 +132,7 @@ public class DownloadResources extends DownloadResourceGroup {
if ((item.getType() == DownloadActivityType.NORMAL_FILE && !item.extra)
|| item.getType() == DownloadActivityType.ROADS_FILE
|| item.getType() == DownloadActivityType.WIKIPEDIA_FILE
|| item.getType() == DownloadActivityType.DEPTH_CONTOUR_FILE
|| item.getType() == DownloadActivityType.SRTM_COUNTRY_FILE) {
outdated = true;
} else {

View file

@ -211,6 +211,7 @@ public class ResourceManager {
protected boolean internetIsNotAccessible = false;
private java.text.DateFormat dateFormat;
private boolean depthContours;
public ResourceManager(OsmandApplication context) {
@ -269,7 +270,11 @@ public class ResourceManager {
public OsmandApplication getContext() {
return context;
}
public boolean hasDepthContours() {
return depthContours;
}
////////////////////////////////////////////// Working with tiles ////////////////////////////////////////////////
public Bitmap getTileImageForMapAsync(String file, ITileSource map, int x, int y, int zoom, boolean loadFromInternetIfNeeded) {
@ -745,6 +750,7 @@ public class ResourceManager {
}
}
File liveDir = context.getAppPath(IndexConstants.LIVE_INDEX_DIR);
depthContours = false;
for (File f : files) {
progress.startTask(context.getString(R.string.indexing_map) + " " + f.getName(), -1); //$NON-NLS-1$
try {
@ -783,6 +789,9 @@ public class ResourceManager {
changesManager.indexMainMap(f, dateCreated);
}
indexFileNames.put(f.getName(), dateFormat.format(dateCreated)); //$NON-NLS-1$
if (!depthContours && f.getName().toLowerCase().startsWith("depth_")) {
depthContours = true;
}
renderer.initializeNewResource(progress, f, mapReader);
BinaryMapReaderResource resource = new BinaryMapReaderResource(f, mapReader);