Merge branch 'sasha_pasha_branch' of ssh://github.com/osmandapp/Osmand into sasha_pasha_branch

This commit is contained in:
PavelRatushny 2017-09-14 17:37:16 +03:00
commit 0e5d09eb82
3 changed files with 9 additions and 2 deletions

View file

@ -819,6 +819,7 @@ public class OsmandAidlApi {
PointDescription pd = new PointDescription(
PointDescription.POINT_TYPE_MAP_MARKER, markerNew.getName() != null ? markerNew.getName() : "");
MapMarker marker = new MapMarker(m.point, pd, m.colorIndex, m.selected, m.index);
marker.id = m.id;
marker.creationDate = m.creationDate;
marker.visitedDate = m.visitedDate;
markersHelper.moveMapMarker(marker, latLonNew);

View file

@ -589,7 +589,6 @@ public class FavouritesDbHelper {
return true;
}
//todo
public void editFavouriteGroup(FavoriteGroup group, String newName, int color, boolean visible) {
MapMarkersHelper markersHelper = context.getMapMarkersHelper();
if (color != 0 && group.color != color) {
@ -605,6 +604,7 @@ public class FavouritesDbHelper {
for (FavouritePoint p : gr.points) {
p.setVisible(visible);
}
markersHelper.syncGroup(new MarkersSyncGroup(gr.name, gr.name, MarkersSyncGroup.FAVORITES_TYPE));
}
if (!group.name.equals(newName)) {
FavoriteGroup gr = flatGroups.remove(group.name);

View file

@ -301,7 +301,12 @@ public class MapMarkersHelper {
List<MapMarker> dbMarkers = markersDbHelper.getMarkersFromGroup(group);
if (group.getType() == MarkersSyncGroup.FAVORITES_TYPE) {
List<FavouritePoint> favPoints = ctx.getFavorites().getGroup(group.name).points;
FavouritesDbHelper.FavoriteGroup favGroup = ctx.getFavorites().getGroup(group.name);
if (!favGroup.visible) {
removeActiveMarkersFromSyncGroup(group.id);
return;
}
List<FavouritePoint> favPoints = favGroup.points;
for (FavouritePoint fp : favPoints) {
LatLon fpLatLon = new LatLon(fp.getLatitude(), fp.getLongitude());
boolean exists = false;
@ -498,6 +503,7 @@ public class MapMarkersHelper {
}
}
checkAndFixActiveMarkersOrderIfNeeded();
refresh();
}
}