From bedb45e61e517dac7d1bcff251e1c47ae8b2bc87 Mon Sep 17 00:00:00 2001 From: PavelRatushny Date: Fri, 29 Dec 2017 16:43:01 +0200 Subject: [PATCH] Navigate in pedestrian mode from transport route controller --- .../net/osmand/plus/mapcontextmenu/MapContextMenu.java | 5 ++++- .../net/osmand/plus/mapcontextmenu/MenuController.java | 4 ++++ .../controllers/TransportRouteController.java | 10 +++++----- .../parkingpoint/ParkingPositionMenuController.java | 5 +++++ 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java index ca8e8b7ccd..a6d14121b6 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java @@ -419,7 +419,10 @@ public class MapContextMenu extends MenuTitleController implements StateChangedL } public boolean navigateInPedestrianMode() { - return menuController instanceof ParkingPositionMenuController; + if (menuController != null) { + return menuController.navigateInPedestrianMode(); + } + return false; } public boolean close() { diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java index 68dc0567b7..a124d885d8 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java @@ -403,6 +403,10 @@ public abstract class MenuController extends BaseMenuController { return null; } + public boolean navigateInPedestrianMode() { + return false; + } + public int getFavActionIconId() { return R.drawable.map_action_fav_dark; } diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/TransportRouteController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/TransportRouteController.java index 18e8a2d07e..b107f77e7a 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/TransportRouteController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/TransportRouteController.java @@ -80,6 +80,11 @@ public class TransportRouteController extends MenuController { } } + @Override + public boolean navigateInPedestrianMode() { + return true; + } + @Override protected Object getObject() { return transportRoute; @@ -102,11 +107,6 @@ public class TransportRouteController extends MenuController { return false; } - @Override - public boolean navigateButtonVisible() { - return false; - } - @Override public boolean isClosable() { return false; diff --git a/OsmAnd/src/net/osmand/plus/parkingpoint/ParkingPositionMenuController.java b/OsmAnd/src/net/osmand/plus/parkingpoint/ParkingPositionMenuController.java index 17767ba6cd..61badd42bb 100644 --- a/OsmAnd/src/net/osmand/plus/parkingpoint/ParkingPositionMenuController.java +++ b/OsmAnd/src/net/osmand/plus/parkingpoint/ParkingPositionMenuController.java @@ -83,6 +83,11 @@ public class ParkingPositionMenuController extends MenuController { return parkingTitle; } + @Override + public boolean navigateInPedestrianMode() { + return true; + } + @Override public boolean displayDistanceDirection() { return true;