This commit is contained in:
Alexey Kulish 2016-09-22 17:27:50 +03:00
parent cec52a53e8
commit 5f5e574ac5

View file

@ -113,7 +113,14 @@ public class ContextMenuLayer extends OsmandMapLayer {
paint = new Paint(); paint = new Paint();
pressedBitmap = BitmapFactory.decodeResource(view.getResources(), R.drawable.map_shield_tap); pressedBitmap = BitmapFactory.decodeResource(view.getResources(), R.drawable.map_shield_tap);
pressedBitmapSmall = BitmapFactory.decodeResource(view.getResources(), R.drawable.map_shield_tap_small); pressedBitmapSmall = BitmapFactory.decodeResource(view.getResources(), R.drawable.map_shield_tap_small);
}
public boolean isVisible() {
return menu.isActive();
}
private List<String> getPublicTransportTypes() {
if (publicTransportTypes == null) {
publicTransportTypes = new ArrayList<>(); publicTransportTypes = new ArrayList<>();
List<PoiFilter> filters = activity.getMyApplication().getPoiTypes().getPoiCategoryByName("transportation").getPoiFilters(); List<PoiFilter> filters = activity.getMyApplication().getPoiTypes().getPoiCategoryByName("transportation").getPoiFilters();
for (PoiFilter poiFilter : filters) { for (PoiFilter poiFilter : filters) {
@ -127,9 +134,7 @@ public class ContextMenuLayer extends OsmandMapLayer {
} }
} }
} }
return publicTransportTypes;
public boolean isVisible() {
return menu.isActive();
} }
@Override @Override
@ -681,7 +686,7 @@ public class ContextMenuLayer extends OsmandMapLayer {
} }
} }
if (res != null && publicTransportTypes.contains(res.getSubType())) { if (res != null && getPublicTransportTypes().contains(res.getSubType())) {
return findNearestTransportStop(lat, lon) == null ? res : null; return findNearestTransportStop(lat, lon) == null ? res : null;
} }