diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java b/OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java index 8776a4f5e9..ea194e465a 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java @@ -252,8 +252,6 @@ public class MapActivityLayers { dialog.dismiss(); showGPXFileLayer(mapView); } - } else if(itemId == R.string.layer_route){ - routeInfoLayer.setVisible(isChecked); } else if(itemId == R.string.layer_transport_route){ transportInfoLayer.setVisible(isChecked); } else if(itemId == R.string.layer_transport){ @@ -277,15 +275,10 @@ public class MapActivityLayers { R.drawable.list_activities_favorites); adapter.registerSelectedItem(R.string.layer_gpx_layer, getApplication().getGpxFileToDisplay() != null ? 1 : 0, R.drawable.list_activities_gpx_tracks); - if(routeInfoLayer.couldBeVisible()){ - adapter.registerSelectedItem(R.string.layer_route, - routeInfoLayer.isUserDefinedVisible() ? 1 : 0, R.drawable.list_activities_route); - } adapter.registerSelectedItem(R.string.layer_transport, settings.SHOW_TRANSPORT_OVER_MAP.get() ? 1 : 0, R.drawable.list_activities_transport_stops); if(TransportRouteHelper.getInstance().routeIsCalculated()){ - adapter.registerSelectedItem(R.string.layer_transport_route, - routeInfoLayer.isUserDefinedVisible() ? 1 : 0, R.drawable.list_activities_transport_stops); + adapter.registerSelectedItem(R.string.layer_transport_route, 1 , R.drawable.list_activities_transport_stops); } diff --git a/OsmAnd/src/net/osmand/plus/views/RouteInfoLayer.java b/OsmAnd/src/net/osmand/plus/views/RouteInfoLayer.java index 89b4802798..4a4b635aff 100644 --- a/OsmAnd/src/net/osmand/plus/views/RouteInfoLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/RouteInfoLayer.java @@ -27,7 +27,6 @@ public class RouteInfoLayer extends OsmandMapLayer implements IRouteInformationL private Button next; private Button prev; private Button info; - private boolean visible = true; private int directionInfo = -1; private DisplayMetrics dm; @@ -107,11 +106,9 @@ public class RouteInfoLayer extends OsmandMapLayer implements IRouteInformationL } public boolean isVisible(){ - return visible && routingHelper.isRouteCalculated() && !routingHelper.isFollowingMode(); - } - public boolean couldBeVisible(){ return routingHelper.isRouteCalculated() && !routingHelper.isFollowingMode(); } + private void updateVisibility(){ int vis = isVisible() ? View.VISIBLE : View.INVISIBLE; prev.setVisibility(vis); @@ -142,22 +139,10 @@ public class RouteInfoLayer extends OsmandMapLayer implements IRouteInformationL @Override public void newRouteIsCalculated(boolean newRoute) { directionInfo = -1; - if (!routingHelper.isFollowingMode()) { - visible = true; - } updateVisibility(); view.refreshMap(); } - public boolean isUserDefinedVisible() { - return visible; - } - - public void setVisible(boolean visible) { - this.visible = visible; - updateVisibility(); - } - public int getDirectionInfo() { return directionInfo; }