Fixed name lookup in context menu after marker was moved

This commit is contained in:
Alexey Kulish 2016-07-06 19:11:38 +03:00
parent 80768e6bc6
commit 258f271c85
2 changed files with 9 additions and 9 deletions

View file

@ -90,13 +90,12 @@ public class MapMarkersHelper {
if (colorIndex != mapMarker.colorIndex) return false;
if (pos != mapMarker.pos) return false;
if (index != mapMarker.index) return false;
if (history != mapMarker.history) return false;
if (selected != mapMarker.selected) return false;
if (dist != mapMarker.dist) return false;
//noinspection SimplifiableIfStatement
if (!point.equals(mapMarker.point)) return false;
return pointDescription != null ? pointDescription.equals(mapMarker.pointDescription) : mapMarker.pointDescription == null;
//if (index != mapMarker.index) return false;
//if (history != mapMarker.history) return false;
//if (selected != mapMarker.selected) return false;
//if (dist != mapMarker.dist) return false;
return point.equals(mapMarker.point);
//return pointDescription != null ? pointDescription.equals(mapMarker.pointDescription) : mapMarker.pointDescription == null;
}
@ -399,6 +398,7 @@ public class MapMarkersHelper {
if (marker != null) {
settings.moveMapMarker(new LatLon(marker.getLatitude(), marker.getLongitude()), latLon,
marker.pointDescription, marker.colorIndex, marker.pos, marker.selected);
marker.point = new LatLon(latLon.getLatitude(), latLon.getLongitude());
readFromSettings();
refresh();
}

View file

@ -382,8 +382,8 @@ public class MapContextMenu extends MenuTitleController implements StateChangedL
@Override
public void onMapMarkerChanged(MapMarker mapMarker) {
if (object == mapMarker) {
String address = ((MapMarker) object).getOnlyName();
if (object.equals(mapMarker)) {
String address = mapMarker.getOnlyName();
nameStr = address;
pointDescription.setName(address);
WeakReference<MapContextMenuFragment> fragmentRef = findMenuFragment();