From 5acf6e27f7bac41c75ea67a18f71d07b435bf5a3 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Tue, 22 Sep 2020 16:55:01 +0300 Subject: [PATCH] Hide extra description and remove unnecessary changes --- .../net/osmand/plus/activities/MapActivityActions.java | 4 +--- .../plus/routepreparationmenu/MapRouteInfoMenu.java | 9 +++++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java index 5414b9c0f7..dbd0f133fa 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java @@ -525,9 +525,7 @@ public class MapActivityActions implements DialogProvider { TargetPointsHelper tg = mapActivity.getMyApplication().getTargetPointsHelper(); tg.clearStartPoint(false); Location finishLoc = ps.get(ps.size() - 1); - PointDescription point = new PointDescription(PointDescription.POINT_TYPE_LOCATION, result.path, ""); - point.setName(PointDescription.getSearchAddressStr(mapActivity)); - tg.navigateToPoint(new LatLon(finishLoc.getLatitude(), finishLoc.getLongitude()), false, -1, point); + tg.navigateToPoint(new LatLon(finishLoc.getLatitude(), finishLoc.getLongitude()), false, -1); } } } diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/MapRouteInfoMenu.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/MapRouteInfoMenu.java index f0216f1c9d..69bed394cc 100644 --- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/MapRouteInfoMenu.java +++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/MapRouteInfoMenu.java @@ -1760,8 +1760,13 @@ public class MapRouteInfoMenu implements IRouteInformationListener, CardListener if (routeParams != null) { TargetPoint target = app.getTargetPointsHelper().getPointToNavigate(); if (target != null) { - PointDescription pointDescription = target.getOriginalPointDescription(); - return pointDescription != null && routeParams.getFile().path.equals(pointDescription.getTypeName()); + List points = routeParams.getPoints(app); + if (!Algorithms.isEmpty(points)) { + Location loc = points.get(points.size() - 1); + LatLon latLon = new LatLon(loc.getLatitude(), loc.getLongitude()); + LatLon targetLatLon = new LatLon(target.getLatitude(), target.getLongitude()); + return latLon.equals(targetLatLon); + } } } }