From a5de781e650095c6d7e3b3e2f307eb59505c0f5a Mon Sep 17 00:00:00 2001 From: Alexander Sytnyk Date: Mon, 18 Sep 2017 13:08:25 +0300 Subject: [PATCH] Add syncing gpx after change "show on map" and after deleting waypoint --- OsmAnd/src/net/osmand/plus/GpxSelectionHelper.java | 1 + .../src/net/osmand/plus/myplaces/TrackPointFragment.java | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/OsmAnd/src/net/osmand/plus/GpxSelectionHelper.java b/OsmAnd/src/net/osmand/plus/GpxSelectionHelper.java index b45a195de0..ad5f87f476 100644 --- a/OsmAnd/src/net/osmand/plus/GpxSelectionHelper.java +++ b/OsmAnd/src/net/osmand/plus/GpxSelectionHelper.java @@ -482,6 +482,7 @@ public class GpxSelectionHelper { selectedGPXFiles.remove(sf); } } + syncGpx(gpx); return sf; } diff --git a/OsmAnd/src/net/osmand/plus/myplaces/TrackPointFragment.java b/OsmAnd/src/net/osmand/plus/myplaces/TrackPointFragment.java index 23efbbc03a..4d22d464d1 100644 --- a/OsmAnd/src/net/osmand/plus/myplaces/TrackPointFragment.java +++ b/OsmAnd/src/net/osmand/plus/myplaces/TrackPointFragment.java @@ -542,6 +542,7 @@ public class TrackPointFragment extends OsmandExpandableListFragment { app.getSelectedGpxHelper().setGpxFileToDisplay(gpx); } } + syncGpx(gpx); } selectedItems.clear(); selectedGroups.clear(); @@ -551,6 +552,14 @@ public class TrackPointFragment extends OsmandExpandableListFragment { }.execute(); } + private void syncGpx(GPXFile gpxFile) { + File gpx = new File(gpxFile.path); + if (gpx.exists()) { + app.getMapMarkersHelper().syncGroup(new MarkersSyncGroup(gpx.getAbsolutePath(), + AndroidUtils.trimExtension(gpx.getName()), MarkersSyncGroup.GPX_TYPE)); + } + } + private void enterMapMarkersMode() { actionMode = getActionBarActivity().startSupportActionMode(new ActionMode.Callback() {