This commit is contained in:
Alex Sytnyk 2018-09-12 18:14:15 +03:00
parent 9d2b4ec903
commit ca203098b5
2 changed files with 7 additions and 5 deletions

View file

@ -1411,12 +1411,12 @@ public class MapMarkersHelper {
return pointDescription; return pointDescription;
} }
public String getOnlyName() { public void setOriginalPointDescription(PointDescription pointDescription) {
return pointDescription == null ? "" : pointDescription.getName(); this.pointDescription = pointDescription;
} }
public void setName(String name) { public String getOnlyName() {
pointDescription.setName(name); return pointDescription == null ? "" : pointDescription.getName();
} }
public double getLatitude() { public double getLatitude() {

View file

@ -22,6 +22,7 @@ import android.widget.EditText;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import net.osmand.AndroidUtils; import net.osmand.AndroidUtils;
import net.osmand.data.PointDescription;
import net.osmand.plus.MapMarkersHelper.MapMarker; import net.osmand.plus.MapMarkersHelper.MapMarker;
import net.osmand.plus.R; import net.osmand.plus.R;
import net.osmand.plus.activities.MapActivity; import net.osmand.plus.activities.MapActivity;
@ -82,7 +83,8 @@ public class RenameMarkerBottomSheetDialogFragment extends BottomSheetDialogFrag
public void onClick(View view) { public void onClick(View view) {
String name = nameEditText.getText().toString(); String name = nameEditText.getText().toString();
if (name.replaceAll("\\s", "").length() > 0) { 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); mapActivity.getMyApplication().getMapMarkersHelper().updateMapMarker(marker, true);
dismiss(); dismiss();
} else { } else {