From 57cb3ae6110543ff70a9185b8f10362c9e7e0215 Mon Sep 17 00:00:00 2001 From: sonora Date: Sun, 28 Feb 2016 15:23:42 +0100 Subject: [PATCH] fix order of map marker history entries --- OsmAnd/src/net/osmand/plus/MapMarkersHelper.java | 2 +- OsmAnd/src/net/osmand/plus/dashboard/DashboardOnMap.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/MapMarkersHelper.java b/OsmAnd/src/net/osmand/plus/MapMarkersHelper.java index 3959c2afab..3d639dcbe8 100644 --- a/OsmAnd/src/net/osmand/plus/MapMarkersHelper.java +++ b/OsmAnd/src/net/osmand/plus/MapMarkersHelper.java @@ -256,7 +256,7 @@ public class MapMarkersHelper { public void removeActiveMarkers() { cancelAddressRequests(); List markers = new ArrayList<>(mapMarkers.size()); - for (int i = 0; i<= mapMarkers.size() - 1; i++) { + for (int i = mapMarkers.size() - 1; i>= 0; i--) { MapMarker marker = mapMarkers.get(i); addMapMarkerHistory(marker); } diff --git a/OsmAnd/src/net/osmand/plus/dashboard/DashboardOnMap.java b/OsmAnd/src/net/osmand/plus/dashboard/DashboardOnMap.java index aa5d2040fc..5a7515ba89 100644 --- a/OsmAnd/src/net/osmand/plus/dashboard/DashboardOnMap.java +++ b/OsmAnd/src/net/osmand/plus/dashboard/DashboardOnMap.java @@ -343,7 +343,7 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks, DynamicLis } } - for (int i = deletedMarkers.size() - 1; i >= 0; i--) { + for (int i = 0; i <= deletedMarkers.size() - 1; i++) { markersHistory.add(0, (MapMarker) deletedMarkers.get(i)); } deletedMarkers.clear();