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;
}
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() {

View file

@ -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 {