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() {
return regionMapDownload;
}
public String getLocaleName() {
if(!Algorithms.isEmpty(regionNameLocale)) {
return regionNameLocale;
@ -92,14 +92,14 @@ public class WorldRegion implements Serializable {
if(!Algorithms.isEmpty(regionName)) {
return regionName;
}
return capitalize(regionFullName.replace('_', ' '));
}
public String getRegionDownloadName() {
return regionDownloadName;
}
public String getRegionDownloadNameLC() {
return regionDownloadName == null ? null : regionDownloadName.toLowerCase();
}
@ -111,7 +111,7 @@ public class WorldRegion implements Serializable {
public LatLon getRegionCenter() {
return regionCenter;
}
public String getRegionSearchText() {
return regionSearchText;
}
@ -145,7 +145,7 @@ public class WorldRegion implements Serializable {
this.regionDownloadName = downloadName;
superregion = null;
subregions = new LinkedList<WorldRegion>();
}
public WorldRegion(String id) {
this(id, null);
@ -154,7 +154,7 @@ public class WorldRegion implements Serializable {
public String getRegionId() {
return regionFullName;
}
private String capitalize(String s) {
String[] words = s.split(" ");
if (words[0].length() > 0) {
@ -191,4 +191,13 @@ public class WorldRegion implements Serializable {
}
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;
parentGroup.addGroup(mainGrp);
DownloadResourceGroup flatFiles = new DownloadResourceGroup(mainGrp, REGION_MAPS);
List<IndexItem> list = groupByRegion.get(reg);
if (list != null) {
DownloadResourceGroup flatFiles = new DownloadResourceGroup(mainGrp, REGION_MAPS);
for (IndexItem ii : list) {
flatFiles.addItem(ii);
}
}
if (list != null || !reg.isContinent()) {
mainGrp.addGroup(flatFiles);
}
DownloadResourceGroup subRegions = new DownloadResourceGroup(mainGrp, DownloadResourceGroupType.SUBREGIONS);
@ -467,12 +469,16 @@ public class DownloadResources extends DownloadResourceGroup {
addGroup(otherGroup);
createHillshadeSRTMGroups();
collectMultipleIndexesItems();
trimEmptyGroups();
updateLoadedFiles();
collectMultipleIndexesItems(region);
return true;
}
private void collectMultipleIndexesItems() {
collectMultipleIndexesItems(region);
}
private void collectMultipleIndexesItems(@NonNull WorldRegion region) {
List<WorldRegion> subRegions = region.getSubregions();
if (Algorithms.isEmpty(subRegions)) return;

View file

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