Add "Russia", "Canada", "USA"

Don't show country name in for the maps: "Germany Bavaria" > "Bavaria"
This commit is contained in:
nazar-kutz 2021-02-16 21:44:33 +02:00
parent 021ff51533
commit 25744449af
3 changed files with 27 additions and 12 deletions

View file

@ -76,12 +76,12 @@ public class WorldRegion implements Serializable {
} }
} }
public boolean isRegionMapDownload() { public boolean isRegionMapDownload() {
return regionMapDownload; return regionMapDownload;
} }
public String getLocaleName() { public String getLocaleName() {
if(!Algorithms.isEmpty(regionNameLocale)) { if(!Algorithms.isEmpty(regionNameLocale)) {
return regionNameLocale; return regionNameLocale;
@ -92,14 +92,14 @@ public class WorldRegion implements Serializable {
if(!Algorithms.isEmpty(regionName)) { if(!Algorithms.isEmpty(regionName)) {
return regionName; return regionName;
} }
return capitalize(regionFullName.replace('_', ' ')); return capitalize(regionFullName.replace('_', ' '));
} }
public String getRegionDownloadName() { public String getRegionDownloadName() {
return regionDownloadName; return regionDownloadName;
} }
public String getRegionDownloadNameLC() { public String getRegionDownloadNameLC() {
return regionDownloadName == null ? null : regionDownloadName.toLowerCase(); return regionDownloadName == null ? null : regionDownloadName.toLowerCase();
} }
@ -111,7 +111,7 @@ public class WorldRegion implements Serializable {
public LatLon getRegionCenter() { public LatLon getRegionCenter() {
return regionCenter; return regionCenter;
} }
public String getRegionSearchText() { public String getRegionSearchText() {
return regionSearchText; return regionSearchText;
} }
@ -145,7 +145,7 @@ public class WorldRegion implements Serializable {
this.regionDownloadName = downloadName; this.regionDownloadName = downloadName;
superregion = null; superregion = null;
subregions = new LinkedList<WorldRegion>(); subregions = new LinkedList<WorldRegion>();
} }
public WorldRegion(String id) { public WorldRegion(String id) {
this(id, null); this(id, null);
@ -154,7 +154,7 @@ public class WorldRegion implements Serializable {
public String getRegionId() { public String getRegionId() {
return regionFullName; return regionFullName;
} }
private String capitalize(String s) { private String capitalize(String s) {
String[] words = s.split(" "); String[] words = s.split(" ");
if (words[0].length() > 0) { if (words[0].length() > 0) {
@ -191,4 +191,13 @@ public class WorldRegion implements Serializable {
} }
return false; return false;
} }
public boolean isContinent() {
if (superregion != null) {
String superRegionId = superregion.getRegionId();
String thisRegionId = getRegionId();
return WORLD.equals(superRegionId) && !RUSSIA_REGION_ID.equals(thisRegionId);
}
return false;
}
} }

View file

@ -418,12 +418,14 @@ public class DownloadResources extends DownloadResourceGroup {
mainGrp.region = reg; mainGrp.region = reg;
parentGroup.addGroup(mainGrp); parentGroup.addGroup(mainGrp);
DownloadResourceGroup flatFiles = new DownloadResourceGroup(mainGrp, REGION_MAPS);
List<IndexItem> list = groupByRegion.get(reg); List<IndexItem> list = groupByRegion.get(reg);
if (list != null) { if (list != null) {
DownloadResourceGroup flatFiles = new DownloadResourceGroup(mainGrp, REGION_MAPS);
for (IndexItem ii : list) { for (IndexItem ii : list) {
flatFiles.addItem(ii); flatFiles.addItem(ii);
} }
}
if (list != null || !reg.isContinent()) {
mainGrp.addGroup(flatFiles); mainGrp.addGroup(flatFiles);
} }
DownloadResourceGroup subRegions = new DownloadResourceGroup(mainGrp, DownloadResourceGroupType.SUBREGIONS); DownloadResourceGroup subRegions = new DownloadResourceGroup(mainGrp, DownloadResourceGroupType.SUBREGIONS);
@ -467,12 +469,16 @@ public class DownloadResources extends DownloadResourceGroup {
addGroup(otherGroup); addGroup(otherGroup);
createHillshadeSRTMGroups(); createHillshadeSRTMGroups();
collectMultipleIndexesItems();
trimEmptyGroups(); trimEmptyGroups();
updateLoadedFiles(); updateLoadedFiles();
collectMultipleIndexesItems(region);
return true; return true;
} }
private void collectMultipleIndexesItems() {
collectMultipleIndexesItems(region);
}
private void collectMultipleIndexesItems(@NonNull WorldRegion region) { private void collectMultipleIndexesItems(@NonNull WorldRegion region) {
List<WorldRegion> subRegions = region.getSubregions(); List<WorldRegion> subRegions = region.getSubregions();
if (Algorithms.isEmpty(subRegions)) return; if (Algorithms.isEmpty(subRegions)) return;

View file

@ -29,7 +29,7 @@ public class MultipleIndexesUiHelper {
OsmandRegions osmandRegions = app.getRegions(); OsmandRegions osmandRegions = app.getRegions();
for (IndexItem indexItem : multipleIndexItem.getAllIndexes()) { for (IndexItem indexItem : multipleIndexItem.getAllIndexes()) {
SelectableItem selectableItem = new SelectableItem(); SelectableItem selectableItem = new SelectableItem();
selectableItem.setTitle(indexItem.getVisibleName(app, osmandRegions)); selectableItem.setTitle(indexItem.getVisibleName(app, osmandRegions, false));
String size = indexItem.getSizeDescription(app); String size = indexItem.getSizeDescription(app);
String date = indexItem.getDate(dateFormat, showRemoteDate); String date = indexItem.getDate(dateFormat, showRemoteDate);