Remove export of GPX and favorite markers
This commit is contained in:
parent
ec4684b8e9
commit
6fb592bde1
4 changed files with 18 additions and 4 deletions
|
@ -1011,6 +1011,20 @@ public class MapMarkersHelper {
|
|||
});
|
||||
}
|
||||
|
||||
public List<MapMarker> getMapMarkersFromDefaultGroups(boolean history) {
|
||||
List<MapMarker> mapMarkers = new ArrayList<>();
|
||||
for (MapMarkersGroup group : mapMarkersGroups) {
|
||||
if (group.getType() == MapMarkersGroup.ANY_TYPE) {
|
||||
for (MapMarker marker : group.getMarkers()) {
|
||||
if (history && marker.history || !history && !marker.history) {
|
||||
mapMarkers.add(marker);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return mapMarkers;
|
||||
}
|
||||
|
||||
public String saveMarkersToFile(String fileName) {
|
||||
GPXFile gpxFile = generateGpx();
|
||||
String dirName = IndexConstants.GPX_INDEX_DIR + IndexConstants.MAP_MARKERS_INDEX_DIR;
|
||||
|
|
|
@ -46,7 +46,7 @@ public class HistoryMarkersSettingsItem extends CollectionSettingsItem<MapMarker
|
|||
protected void init() {
|
||||
super.init();
|
||||
markersHelper = app.getMapMarkersHelper();
|
||||
existingItems = new ArrayList<>(markersHelper.getMapMarkersHistory());
|
||||
existingItems = new ArrayList<>(markersHelper.getMapMarkersFromDefaultGroups(true));
|
||||
}
|
||||
|
||||
@NonNull
|
||||
|
|
|
@ -46,7 +46,7 @@ public class MarkersSettingsItem extends CollectionSettingsItem<MapMarker> {
|
|||
protected void init() {
|
||||
super.init();
|
||||
markersHelper = app.getMapMarkersHelper();
|
||||
existingItems = new ArrayList<>(markersHelper.getMapMarkers());
|
||||
existingItems = new ArrayList<>(markersHelper.getMapMarkersFromDefaultGroups(false));
|
||||
}
|
||||
|
||||
@NonNull
|
||||
|
|
|
@ -597,7 +597,7 @@ public class SettingsHelper {
|
|||
if (!files.isEmpty()) {
|
||||
dataList.put(ExportSettingsType.VOICE, files);
|
||||
}
|
||||
List<MapMarker> mapMarkers = app.getMapMarkersHelper().getMapMarkers();
|
||||
List<MapMarker> mapMarkers = app.getMapMarkersHelper().getMapMarkersFromDefaultGroups(false);
|
||||
if (!mapMarkers.isEmpty()) {
|
||||
String name = app.getString(R.string.map_markers);
|
||||
String groupId = ExportSettingsType.ACTIVE_MARKERS.name();
|
||||
|
@ -605,7 +605,7 @@ public class SettingsHelper {
|
|||
markersGroup.setMarkers(mapMarkers);
|
||||
dataList.put(ExportSettingsType.ACTIVE_MARKERS, Collections.singletonList(markersGroup));
|
||||
}
|
||||
List<MapMarker> markersHistory = app.getMapMarkersHelper().getMapMarkersHistory();
|
||||
List<MapMarker> markersHistory = app.getMapMarkersHelper().getMapMarkersFromDefaultGroups(true);
|
||||
if (!markersHistory.isEmpty()) {
|
||||
String name = app.getString(R.string.shared_string_history);
|
||||
String groupId = ExportSettingsType.HISTORY_MARKERS.name();
|
||||
|
|
Loading…
Reference in a new issue