Add transport route

This commit is contained in:
Victor Shcherb 2016-07-29 18:21:02 +02:00
parent 12a656b586
commit 20d2204b2e
2 changed files with 6 additions and 2 deletions

View file

@ -36,7 +36,9 @@ public class TransportRouteController extends MenuController {
@Override @Override
public int getLeftIconId() { public int getLeftIconId() {
return this.transportStop.type.getTopResourceId(); return this.transportStop.type == null ?
R.drawable.mx_public_transport :
this.transportStop.type.getTopResourceId();
} }
@Override @Override
@ -76,7 +78,8 @@ public class TransportRouteController extends MenuController {
boolean useEnglishNames = getMapActivity().getMyApplication().getSettings().usingEnglishNames(); boolean useEnglishNames = getMapActivity().getMyApplication().getSettings().usingEnglishNames();
for (TransportStop stop : stops) { for (TransportStop stop : stops) {
addPlainMenuItem( addPlainMenuItem(
stop == transportStop.stop ? R.drawable.ic_action_marker_dark : transportStop.type.getResourceId(), stop == transportStop.stop ? R.drawable.ic_action_marker_dark :
(transportStop.type == null ? R.drawable.mx_route_bus_ref : transportStop.type.getResourceId()),
useEnglishNames ? stop.getEnName(true) : stop.getName(), false, false, null); useEnglishNames ? stop.getEnName(true) : stop.getName(), false, false, null);
} }
} }

View file

@ -154,6 +154,7 @@ public class TransportStopController extends MenuController {
if (topType == null && type != null && type.isTopType()) { if (topType == null && type != null && type.isTopType()) {
topType = type; topType = type;
} }
r.type = type;
r.desc = rs.getRef() + " " + (useEnglishNames ? rs.getEnName(true) : rs.getName()); r.desc = rs.getRef() + " " + (useEnglishNames ? rs.getEnName(true) : rs.getName());
r.route = rs; r.route = rs;
r.stop = transportStop; r.stop = transportStop;