Skip to content

Commit

Permalink
Apply OBF_POINTS_GROUPS_EMPTY_NAME_VALUE
Browse files Browse the repository at this point in the history
  • Loading branch information
RZR-UA committed Dec 10, 2024
1 parent 677c968 commit 2f90b5c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ object GpxUtilities {
const val OBF_POINTS_GROUPS_ICONS = "points_groups_icons"
const val OBF_POINTS_GROUPS_COLORS = "points_groups_colors"
const val OBF_POINTS_GROUPS_BACKGROUNDS = "points_groups_backgrounds"
const val OBF_POINTS_GROUPS_EMPTY_NAME_VALUE = "." // stub to store empty points_groups_names
const val OBF_POINTS_GROUPS_CATEGORY = "points_groups_category" // optional category of OBF-GPX point

fun parsePointsGroupAttributes(parser: XmlPullParser): PointsGroup {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import static net.osmand.shared.gpx.GpxUtilities.PointsGroup.OBF_POINTS_GROUPS_BACKGROUNDS;
import static net.osmand.shared.gpx.GpxUtilities.PointsGroup.OBF_POINTS_GROUPS_COLORS;
import static net.osmand.shared.gpx.GpxUtilities.PointsGroup.OBF_POINTS_GROUPS_DELIMITER;
import static net.osmand.shared.gpx.GpxUtilities.PointsGroup.OBF_POINTS_GROUPS_EMPTY_NAME_VALUE;
import static net.osmand.shared.gpx.GpxUtilities.PointsGroup.OBF_POINTS_GROUPS_ICONS;
import static net.osmand.shared.gpx.GpxUtilities.PointsGroup.OBF_POINTS_GROUPS_NAMES;
import static net.osmand.shared.gpx.GpxUtilities.PointsGroup.OBF_POINTS_GROUPS_PREFIX;
Expand Down Expand Up @@ -1305,7 +1306,9 @@ private void reconstructPointsGroups(GpxFile gpxFile, List<String> pgNames, List
String icon = pgIcons.get(i);
String background = pgBackgrounds.get(i);
int color = KAlgorithms.INSTANCE.parseColor(pgColors.get(i));
if (name.isEmpty()) name = GpxFile.DEFAULT_WPT_GROUP_NAME; // follow current default
if (name.isEmpty() || OBF_POINTS_GROUPS_EMPTY_NAME_VALUE.equals(name)) {
name = GpxFile.DEFAULT_WPT_GROUP_NAME; // follow current default
}
GpxUtilities.PointsGroup pg = new GpxUtilities.PointsGroup(name, icon, background, color);
gpxFile.addPointsGroup(pg);
}
Expand Down

0 comments on commit 2f90b5c

Please sign in to comment.