use of net.osmand.plus.GpxSelectionHelper in project Osmand by osmandapp.
the class SelectWptCategoriesBottomSheetDialogFragment method onRightBottomButtonClick.
@Override
protected void onRightBottomButtonClick() {
OsmandApplication app = getMyApplication();
GpxSelectionHelper gpxSelectionHelper = app.getSelectedGpxHelper();
MapMarkersHelper mapMarkersHelper = app.getMapMarkersHelper();
SelectedGpxFile selectedGpxFile = gpxSelectionHelper.getSelectedFileByPath(gpxFile.path);
if (selectedGpxFile == null) {
gpxSelectionHelper.selectGpxFile(gpxFile, true, false);
}
MapMarkersGroup markersGr = mapMarkersHelper.getOrCreateGroup(new File(gpxFile.path));
mapMarkersHelper.updateGroupWptCategories(markersGr, selectedCategories);
mapMarkersHelper.addOrEnableGroup(markersGr);
dismiss();
}
use of net.osmand.plus.GpxSelectionHelper in project Osmand by osmandapp.
the class WptPtMenuBuilder method buildWaypointsView.
private void buildWaypointsView(View view) {
GpxSelectionHelper gpxSelectionHelper = app.getSelectedGpxHelper();
SelectedGpxFile selectedGpxFile = gpxSelectionHelper.getSelectedGPXFile(wpt);
if (selectedGpxFile != null) {
List<WptPt> points = selectedGpxFile.getGpxFile().getPoints();
GPXUtilities.GPXFile gpx = selectedGpxFile.getGpxFile();
if (points.size() > 0) {
String title = view.getContext().getString(R.string.context_menu_points_of_group);
File file = new File(gpx.path);
String gpxName = file.getName().replace(".gpx", "").replace("/", " ").replace("_", " ");
int color = getPointColor(wpt, getFileColor(selectedGpxFile));
buildRow(view, app.getIconsCache().getPaintedIcon(R.drawable.ic_type_waypoints_group, color), null, title, 0, gpxName, true, getCollapsableWaypointsView(view.getContext(), true, gpx, wpt), false, 0, false, null, false);
}
}
}
use of net.osmand.plus.GpxSelectionHelper in project Osmand by osmandapp.
the class AddTracksGroupBottomSheetDialogFragment method createMapMarkersSyncGroup.
private MapMarkersGroup createMapMarkersSyncGroup(OsmandApplication app, GpxDataItem gpxDataItem) {
GpxSelectionHelper gpxSelectionHelper = app.getSelectedGpxHelper();
File gpx = gpxDataItem.getFile();
SelectedGpxFile selectedGpxFile = gpxSelectionHelper.getSelectedFileByPath(gpx.getAbsolutePath());
if (selectedGpxFile == null) {
GPXFile res = GPXUtilities.loadGPXFile(app, gpx);
gpxSelectionHelper.selectGpxFile(res, true, false);
}
return getMyApplication().getMapMarkersHelper().getOrCreateGroup(gpx);
}
Aggregations