Change title and type strings in transport route controller

This commit is contained in:
PavelRatushny 2017-12-29 11:41:09 +02:00
parent e4341eb787
commit dd2441c024

View file

@ -121,15 +121,7 @@ public class TransportRouteController extends MenuController {
@Override @Override
public String getTypeStr() { public String getTypeStr() {
if (transportRoute.refStop != null && !TextUtils.isEmpty(transportRoute.refStop.getName())) { return getPointDescription().getName();
return transportRoute.refStop.getName();
} else if (transportRoute.stop != null && !TextUtils.isEmpty(transportRoute.stop.getName())) {
return transportRoute.stop.getName();
} else if (!TextUtils.isEmpty(getPointDescription().getTypeName())) {
return getPointDescription().getTypeName();
} else {
return getStopType();
}
} }
private String getStopType() { private String getStopType() {
@ -220,6 +212,19 @@ public class TransportRouteController extends MenuController {
return -1; return -1;
} }
@Override
public String getNameStr() {
if (transportRoute.refStop != null && !TextUtils.isEmpty(transportRoute.refStop.getName())) {
return transportRoute.refStop.getName();
} else if (transportRoute.stop != null && !TextUtils.isEmpty(transportRoute.stop.getName())) {
return transportRoute.stop.getName();
} else if (!TextUtils.isEmpty(getPointDescription().getTypeName())) {
return getPointDescription().getTypeName();
} else {
return getStopType();
}
}
@Override @Override
public void addPlainMenuItems(String typeStr, PointDescription pointDescription, final LatLon latLon) { public void addPlainMenuItems(String typeStr, PointDescription pointDescription, final LatLon latLon) {
super.addPlainMenuItems(typeStr, pointDescription, latLon); super.addPlainMenuItems(typeStr, pointDescription, latLon);