Merge pull request #5086 from osmandapp/PaulsBranch

Added ability to determine the subway logo
This commit is contained in:
Alexey 2018-03-01 15:29:49 +03:00 committed by GitHub
commit d7b1d6f024
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 1 deletions

View file

@ -334,7 +334,7 @@ public class AmenityMenuBuilder extends MenuBuilder {
String key = e.getKey(); String key = e.getKey();
String vl = e.getValue(); String vl = e.getValue();
if (key.equals("image") || key.equals("mapillary")) { if (key.equals("image") || key.equals("mapillary") || key.equals("subway_region")) {
continue; continue;
} }

View file

@ -1,5 +1,7 @@
package net.osmand.plus.mapcontextmenu.controllers; package net.osmand.plus.mapcontextmenu.controllers;
import android.graphics.drawable.Drawable;
import net.osmand.data.Amenity; import net.osmand.data.Amenity;
import net.osmand.data.LatLon; import net.osmand.data.LatLon;
import net.osmand.data.PointDescription; import net.osmand.data.PointDescription;
@ -29,6 +31,7 @@ import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.Comparator; import java.util.Comparator;
import java.util.List; import java.util.List;
import java.util.Map;
public class AmenityMenuController extends MenuController { public class AmenityMenuController extends MenuController {
@ -185,6 +188,18 @@ public class AmenityMenuController extends MenuController {
} }
} }
@Override
public Drawable getRightIcon() {
Map<String, String> addTypes = amenity.getAdditionalInfo();
if (addTypes != null && addTypes.containsKey("subway_region")) {
String region = "subway_" + addTypes.get("subway_region");
if (RenderingIcons.containsBigIcon(region)) {
return RenderingIcons.getBigIcon(getMapActivity(), region);
}
}
return null;
}
private void processTransportStop() { private void processTransportStop() {
routes = new ArrayList<>(); routes = new ArrayList<>();
List<TransportIndexRepository> reps = getMapActivity().getMyApplication() List<TransportIndexRepository> reps = getMapActivity().getMyApplication()