Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
16b6ca49c7
1 changed files with 21 additions and 3 deletions
|
@ -65,6 +65,14 @@ public class QuickSearchListItem {
|
||||||
|
|
||||||
public static String getName(OsmandApplication app, SearchResult searchResult) {
|
public static String getName(OsmandApplication app, SearchResult searchResult) {
|
||||||
switch (searchResult.objectType) {
|
switch (searchResult.objectType) {
|
||||||
|
case STREET:
|
||||||
|
if (searchResult.localeName.endsWith(")")) {
|
||||||
|
int i = searchResult.localeName.indexOf('(');
|
||||||
|
if (i > 0) {
|
||||||
|
return searchResult.localeName.substring(0, i).trim();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
case STREET_INTERSECTION:
|
case STREET_INTERSECTION:
|
||||||
if (!Algorithms.isEmpty(searchResult.localeRelatedObjectName)) {
|
if (!Algorithms.isEmpty(searchResult.localeRelatedObjectName)) {
|
||||||
return searchResult.localeName + " - " + searchResult.localeRelatedObjectName;
|
return searchResult.localeName + " - " + searchResult.localeRelatedObjectName;
|
||||||
|
@ -107,10 +115,20 @@ public class QuickSearchListItem {
|
||||||
return getCityTypeStr(app, city.getType());
|
return getCityTypeStr(app, city.getType());
|
||||||
}
|
}
|
||||||
case STREET:
|
case STREET:
|
||||||
if (!Algorithms.isEmpty(searchResult.localeRelatedObjectName)) {
|
StringBuilder streetBuilder = new StringBuilder();
|
||||||
return searchResult.localeRelatedObjectName;
|
if (searchResult.localeName.endsWith(")")) {
|
||||||
|
int i = searchResult.localeName.indexOf('(');
|
||||||
|
if (i > 0) {
|
||||||
|
streetBuilder.append(searchResult.localeName.substring(i + 1, searchResult.localeName.length() - 1));
|
||||||
}
|
}
|
||||||
return "";
|
}
|
||||||
|
if (!Algorithms.isEmpty(searchResult.localeRelatedObjectName)) {
|
||||||
|
if (streetBuilder.length() > 0) {
|
||||||
|
streetBuilder.append(", ");
|
||||||
|
}
|
||||||
|
streetBuilder.append(searchResult.localeRelatedObjectName);
|
||||||
|
}
|
||||||
|
return streetBuilder.toString();
|
||||||
case HOUSE:
|
case HOUSE:
|
||||||
if (searchResult.relatedObject != null) {
|
if (searchResult.relatedObject != null) {
|
||||||
Street relatedStreet = (Street) searchResult.relatedObject;
|
Street relatedStreet = (Street) searchResult.relatedObject;
|
||||||
|
|
Loading…
Reference in a new issue