From ca203098b5918ef90ebd57e2ec2f0a19070874cf Mon Sep 17 00:00:00 2001 From: Alex Sytnyk Date: Wed, 12 Sep 2018 18:14:15 +0300 Subject: [PATCH] Fix #5776 --- OsmAnd/src/net/osmand/plus/MapMarkersHelper.java | 8 ++++---- .../mapmarkers/RenameMarkerBottomSheetDialogFragment.java | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/MapMarkersHelper.java b/OsmAnd/src/net/osmand/plus/MapMarkersHelper.java index 984396ef7d..38d4307e64 100644 --- a/OsmAnd/src/net/osmand/plus/MapMarkersHelper.java +++ b/OsmAnd/src/net/osmand/plus/MapMarkersHelper.java @@ -1411,12 +1411,12 @@ public class MapMarkersHelper { return pointDescription; } - public String getOnlyName() { - return pointDescription == null ? "" : pointDescription.getName(); + public void setOriginalPointDescription(PointDescription pointDescription) { + this.pointDescription = pointDescription; } - public void setName(String name) { - pointDescription.setName(name); + public String getOnlyName() { + return pointDescription == null ? "" : pointDescription.getName(); } public double getLatitude() { diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/RenameMarkerBottomSheetDialogFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/RenameMarkerBottomSheetDialogFragment.java index ed75d6ef22..308a7bbc77 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/RenameMarkerBottomSheetDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/RenameMarkerBottomSheetDialogFragment.java @@ -22,6 +22,7 @@ import android.widget.EditText; import android.widget.LinearLayout; import net.osmand.AndroidUtils; +import net.osmand.data.PointDescription; import net.osmand.plus.MapMarkersHelper.MapMarker; import net.osmand.plus.R; import net.osmand.plus.activities.MapActivity; @@ -82,7 +83,8 @@ public class RenameMarkerBottomSheetDialogFragment extends BottomSheetDialogFrag public void onClick(View view) { String name = nameEditText.getText().toString(); if (name.replaceAll("\\s", "").length() > 0) { - marker.setName(name); + PointDescription pd = new PointDescription(PointDescription.POINT_TYPE_MAP_MARKER, name); + marker.setOriginalPointDescription(pd); mapActivity.getMyApplication().getMapMarkersHelper().updateMapMarker(marker, true); dismiss(); } else {