From b9243cfb595df01ca174ba9ae8860445e5c9eec0 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 1 Sep 2017 19:05:48 +0300 Subject: [PATCH] Undo for removing active marker in progress --- OsmAnd/src/net/osmand/plus/MapMarkersHelper.java | 4 ++-- .../adapters/MapMarkersActiveAdapter.java | 16 ++++++++++++++-- .../adapters/MapMarkersHistoryAdapter.java | 2 +- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/MapMarkersHelper.java b/OsmAnd/src/net/osmand/plus/MapMarkersHelper.java index ff4fab8f71..5b58d6e20e 100644 --- a/OsmAnd/src/net/osmand/plus/MapMarkersHelper.java +++ b/OsmAnd/src/net/osmand/plus/MapMarkersHelper.java @@ -321,9 +321,9 @@ public class MapMarkersHelper { refresh(); } - public void addMapMarker(MapMarker marker) { + public void addMapMarker(MapMarker marker, int index) { settings.insertMapMarker(marker.getLatitude(), marker.getLongitude(), marker.pointDescription, - marker.colorIndex, marker.selected, marker.creationDate, 0); + marker.colorIndex, marker.selected, marker.creationDate, index); readFromSettings(); } diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersActiveAdapter.java b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersActiveAdapter.java index bf8e7d3f76..972996a1b1 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersActiveAdapter.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersActiveAdapter.java @@ -1,5 +1,6 @@ package net.osmand.plus.mapmarkers.adapters; +import android.support.design.widget.Snackbar; import android.support.v4.view.MotionEventCompat; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; @@ -93,8 +94,19 @@ public class MapMarkersActiveAdapter extends RecyclerView.Adapter