From 62a792952b211e07af3ab8694a4e5a378536088e Mon Sep 17 00:00:00 2001 From: Dima-1 Date: Tue, 24 Mar 2020 13:10:40 +0200 Subject: [PATCH] Add gpx wptpt editor current track --- .../net/osmand/plus/activities/SavingTrackHelper.java | 11 +++++++++++ .../editors/WptPtEditorFragmentNew.java | 4 +++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/SavingTrackHelper.java b/OsmAnd/src/net/osmand/plus/activities/SavingTrackHelper.java index 9b713e2481..52fe084e2e 100644 --- a/OsmAnd/src/net/osmand/plus/activities/SavingTrackHelper.java +++ b/OsmAnd/src/net/osmand/plus/activities/SavingTrackHelper.java @@ -533,6 +533,11 @@ public class SavingTrackHelper extends SQLiteOpenHelper { } public void updatePointData(WptPt pt, double lat, double lon, long time, String description, String name, String category, int color) { + updatePointData(pt, lat, lon, time, description, name, category, color, null, null); + } + + public void updatePointData(WptPt pt, double lat, double lon, long time, String description, String name, + String category, int color, String iconName, String iconBackground) { currentTrack.getModifiableGpxFile().modifiedTime = time; List params = new ArrayList<>(); @@ -594,6 +599,12 @@ public class SavingTrackHelper extends SQLiteOpenHelper { if (color != 0) { pt.setColor(color); } + if (iconName != null) { + pt.setIconName(iconName); + } + if (iconBackground != null) { + pt.setBackgroundType(iconBackground); + } } public void deletePointData(WptPt pt) { diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/WptPtEditorFragmentNew.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/WptPtEditorFragmentNew.java index 0ec778ca02..cf7a5638b4 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/WptPtEditorFragmentNew.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/WptPtEditorFragmentNew.java @@ -248,6 +248,8 @@ public class WptPtEditorFragmentNew extends PointEditorFragmentNew { } else { wpt.removeColor(); } + wpt.setBackgroundType(backgroundTypeName); + wpt.setIconName(iconName); GPXFile gpx = editor.getGpxFile(); SavingTrackHelper savingTrackHelper = getSavingTrackHelper(); GpxSelectionHelper selectedGpxHelper = getSelectedGpxHelper(); @@ -287,7 +289,7 @@ public class WptPtEditorFragmentNew extends PointEditorFragmentNew { if (gpx != null) { if (gpx.showCurrentTrack) { savingTrackHelper.updatePointData(wpt, wpt.getLatitude(), wpt.getLongitude(), - System.currentTimeMillis(), description, name, category, color); + System.currentTimeMillis(), description, name, category, color, iconName, backgroundTypeName); if (!editor.isGpxSelected()) { selectedGpxHelper.setGpxFileToDisplay(gpx); }