From 30811d9f8d9dd2233bc9c968d7b50bb53710aea7 Mon Sep 17 00:00:00 2001 From: Alexander Sytnyk Date: Tue, 3 Oct 2017 11:19:23 +0300 Subject: [PATCH] Fix door-to-door sort --- .../src/net/osmand/plus/mapmarkers/PlanRouteFragment.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/PlanRouteFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/PlanRouteFragment.java index 6a5eb92b38..340004c047 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/PlanRouteFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/PlanRouteFragment.java @@ -762,8 +762,8 @@ public class PlanRouteFragment extends Fragment implements OsmAndLocationListene if (i == 0 && startFromLoc) { continue; } - int index = sequence[startFromLoc ? i - 1 : i]; - res.add(selectedMarkers.get(index)); + int index = sequence[i]; + res.add(selectedMarkers.get(startFromLoc ? index - 1 : index)); } return res; @@ -786,8 +786,9 @@ public class PlanRouteFragment extends Fragment implements OsmAndLocationListene } mapActivity.getMyApplication().getMapMarkersHelper().addSelectedMarkersToTop(res); - adapter.notifyDataSetChanged(); + updateText(); + showMarkersRouteOnMap(); } }.execute(); }