Fix map marker name

This commit is contained in:
Alexey Kulish 2017-04-08 18:31:22 +03:00
parent c10cb196f3
commit c9a0232ff1
3 changed files with 14 additions and 10 deletions

View file

@ -50,6 +50,17 @@ public class MapMarkersHelper {
getOnlyName());
}
public String getName(Context ctx) {
String name;
PointDescription pd = getPointDescription(ctx);
if (Algorithms.isEmpty(pd.getName())) {
name = pd.getTypeName();
} else {
name = pd.getName();
}
return name;
}
public PointDescription getOriginalPointDescription() {
return pointDescription;
}

View file

@ -531,14 +531,7 @@ public class MapMarkerDialogHelper {
waypointDeviation.setVisibility(View.GONE);
String descr;
PointDescription pd = marker.getPointDescription(app);
if (Algorithms.isEmpty(pd.getName())) {
descr = pd.getTypeName();
} else {
descr = pd.getName();
}
String descr = marker.getName(app);
if (textShadow != null) {
textShadow.setText(descr);
}

View file

@ -799,13 +799,13 @@ public class MapRouteInfoMenu implements IRouteInformationListener {
MapMarker m = markers.get(0);
actions.add(new RouteSpinnerRow(SPINNER_MAP_MARKER_1_ID,
MapMarkerDialogHelper.getMapMarkerIcon(mapActivity.getMyApplication(), m.colorIndex),
m.getOnlyName()));
m.getName(mapActivity)));
}
if (markers.size() > 1) {
MapMarker m = markers.get(1);
actions.add(new RouteSpinnerRow(SPINNER_MAP_MARKER_2_ID,
MapMarkerDialogHelper.getMapMarkerIcon(mapActivity.getMyApplication(), m.colorIndex),
m.getOnlyName()));
m.getName(mapActivity)));
}
/*
if (markers.size() > 2) {