Merge branch 'r3.9'

This commit is contained in:
Vitaliy 2021-02-15 00:16:12 +02:00
commit 151c972764
4 changed files with 17 additions and 9 deletions

View file

@ -60,7 +60,8 @@ public class GPXUtilities {
private final static NumberFormat latLonFormat = new DecimalFormat("0.00#####", new DecimalFormatSymbols( private final static NumberFormat latLonFormat = new DecimalFormat("0.00#####", new DecimalFormatSymbols(
new Locale("EN", "US"))); new Locale("EN", "US")));
private final static NumberFormat decimalFormat = new DecimalFormat("#.###", new DecimalFormatSymbols( // speed, ele, hdop
private final static NumberFormat decimalFormat = new DecimalFormat("#.#", new DecimalFormatSymbols(
new Locale("EN", "US"))); new Locale("EN", "US")));
public enum GPXColor { public enum GPXColor {
@ -2480,6 +2481,7 @@ public class GPXUtilities {
firstSegment.routeSegments = routeSegments; firstSegment.routeSegments = routeSegments;
firstSegment.routeTypes = routeTypes; firstSegment.routeTypes = routeTypes;
} }
gpxFile.addGeneralTrack();
} catch (Exception e) { } catch (Exception e) {
gpxFile.error = e; gpxFile.error = e;
log.error("Error reading gpx", e); //$NON-NLS-1$ log.error("Error reading gpx", e); //$NON-NLS-1$
@ -2594,4 +2596,4 @@ public class GPXUtilities {
to.error = from.error; to.error = from.error;
} }
} }
} }

View file

@ -651,7 +651,7 @@ public class MapContextMenu extends MenuTitleController implements StateChangedL
} }
private void updateTitle(String address) { private void updateTitle(String address) {
nameStr = address; setNameStr(address);
getPointDescription().setName(address); getPointDescription().setName(address);
WeakReference<MapContextMenuFragment> fragmentRef = findMenuFragment(); WeakReference<MapContextMenuFragment> fragmentRef = findMenuFragment();
if (fragmentRef != null) if (fragmentRef != null)

View file

@ -1369,7 +1369,9 @@ public class MenuBuilder {
if (amenity != null) { if (amenity != null) {
PoiCategory category = amenity.getType(); PoiCategory category = amenity.getType();
PoiType poiType = category.getPoiTypeByKeyName(amenity.getSubType()); PoiType poiType = category.getPoiTypeByKeyName(amenity.getSubType());
return app.getPoiFilters().getFilterById(PoiUIFilter.STD_PREFIX + poiType.getKeyName()); if (poiType != null) {
return app.getPoiFilters().getFilterById(PoiUIFilter.STD_PREFIX + poiType.getKeyName());
}
} }
return null; return null;
} }

View file

@ -138,6 +138,10 @@ public abstract class MenuTitleController {
} }
} }
public void setNameStr(@Nullable String nameStr) {
this.nameStr = nameStr != null ? nameStr : "";
}
protected boolean needStreetName() { protected boolean needStreetName() {
MenuController menuController = getMenuController(); MenuController menuController = getMenuController();
boolean res = getObject() != null || Algorithms.isEmpty(getPointDescription().getName()); boolean res = getObject() != null || Algorithms.isEmpty(getPointDescription().getName());
@ -165,28 +169,28 @@ public abstract class MenuTitleController {
protected void acquireNameAndType() { protected void acquireNameAndType() {
String firstNameStr = ""; String firstNameStr = "";
nameStr = "";
typeStr = ""; typeStr = "";
commonTypeStr = ""; commonTypeStr = "";
streetStr = ""; streetStr = "";
setNameStr("");
MenuController menuController = getMenuController(); MenuController menuController = getMenuController();
if (menuController != null) { if (menuController != null) {
firstNameStr = menuController.getFirstNameStr(); firstNameStr = menuController.getFirstNameStr();
nameStr = menuController.getNameStr(); setNameStr(menuController.getNameStr());
typeStr = menuController.getTypeStr(); typeStr = menuController.getTypeStr();
commonTypeStr = menuController.getCommonTypeStr(); commonTypeStr = menuController.getCommonTypeStr();
} }
if (Algorithms.isEmpty(nameStr)) { if (Algorithms.isEmpty(nameStr)) {
nameStr = typeStr; setNameStr(typeStr);
typeStr = commonTypeStr; typeStr = commonTypeStr;
} else if (Algorithms.isEmpty(typeStr)) { } else if (Algorithms.isEmpty(typeStr)) {
typeStr = commonTypeStr; typeStr = commonTypeStr;
} }
if (!Algorithms.isEmpty(firstNameStr)) { if (!Algorithms.isEmpty(firstNameStr)) {
nameStr = firstNameStr + " (" + nameStr + ")"; setNameStr(firstNameStr + " (" + nameStr + ")");
} }
} }
@ -204,7 +208,7 @@ public abstract class MenuTitleController {
} }
if (displayStreetNameInTitle()) { if (displayStreetNameInTitle()) {
nameStr = streetStr; setNameStr(streetStr);
getPointDescription().setName(nameStr); getPointDescription().setName(nameStr);
} }
onSearchAddressDone(); onSearchAddressDone();