use of net.osmand.plus.GpxSelectionHelper.GpxDisplayItem in project Osmand by osmandapp.
the class GPXLayer method drawSelectedFilesSplits.
private void drawSelectedFilesSplits(Canvas canvas, RotatedTileBox tileBox, List<SelectedGpxFile> selectedGPXFiles, DrawSettings settings) {
if (tileBox.getZoom() >= startZoom) {
// request to load
for (SelectedGpxFile g : selectedGPXFiles) {
List<GpxDisplayGroup> groups = g.getDisplayGroups();
if (groups != null && !groups.isEmpty()) {
GpxDataItem gpxDataItem = view.getApplication().getGpxDatabase().getItem(new File(g.getGpxFile().path));
int color = gpxDataItem != null ? gpxDataItem.getColor() : 0;
if (color == 0) {
color = g.getModifiableGpxFile().getColor(0);
}
if (color == 0) {
color = cachedColor;
}
paintInnerRect.setColor(color);
paintInnerRect.setAlpha(179);
List<GpxDisplayItem> items = groups.get(0).getModifiableList();
drawSplitItems(canvas, tileBox, items, settings);
}
}
}
}
use of net.osmand.plus.GpxSelectionHelper.GpxDisplayItem in project Osmand by osmandapp.
the class MenuController method getMenuController.
public static MenuController getMenuController(MapActivity mapActivity, LatLon latLon, PointDescription pointDescription, Object object, MenuType menuType) {
MenuController menuController = null;
if (object != null) {
if (object instanceof Amenity) {
menuController = new AmenityMenuController(mapActivity, pointDescription, (Amenity) object);
} else if (object instanceof FavouritePoint) {
menuController = new FavouritePointMenuController(mapActivity, pointDescription, (FavouritePoint) object);
} else if (object instanceof SearchHistoryHelper.HistoryEntry) {
menuController = new HistoryMenuController(mapActivity, pointDescription, (SearchHistoryHelper.HistoryEntry) object);
} else if (object instanceof TargetPoint) {
menuController = new TargetPointMenuController(mapActivity, pointDescription, (TargetPoint) object);
} else if (object instanceof Recording) {
menuController = new AudioVideoNoteMenuController(mapActivity, pointDescription, (Recording) object);
} else if (object instanceof OsmPoint) {
menuController = new EditPOIMenuController(mapActivity, pointDescription, (OsmPoint) object);
} else if (object instanceof WptPt) {
menuController = new WptPtMenuController(mapActivity, pointDescription, (WptPt) object);
} else if (object instanceof DownloadMapObject) {
menuController = new MapDataMenuController(mapActivity, pointDescription, (DownloadMapObject) object);
} else if (object instanceof OpenStreetNote) {
menuController = new OsmBugMenuController(mapActivity, pointDescription, (OpenStreetNote) object);
} else if (object instanceof GpxDisplayItem) {
menuController = new GpxItemMenuController(mapActivity, pointDescription, (GpxDisplayItem) object);
} else if (object instanceof MapMarker) {
menuController = new MapMarkerMenuController(mapActivity, pointDescription, (MapMarker) object);
} else if (object instanceof TransportStopRoute) {
menuController = new TransportRouteController(mapActivity, pointDescription, (TransportStopRoute) object);
} else if (object instanceof TransportStop) {
menuController = new TransportStopController(mapActivity, pointDescription, (TransportStop) object);
} else if (object instanceof AMapPoint) {
menuController = new AMapPointMenuController(mapActivity, pointDescription, (AMapPoint) object);
} else if (object instanceof LatLon) {
if (pointDescription.isParking()) {
menuController = new ParkingPositionMenuController(mapActivity, pointDescription);
} else if (pointDescription.isMyLocation()) {
menuController = new MyLocationMenuController(mapActivity, pointDescription);
}
} else if (object instanceof RouteDataObject) {
menuController = new ImpassibleRoadsMenuController(mapActivity, pointDescription, (RouteDataObject) object);
} else if (object instanceof RenderedObject) {
menuController = new RenderedObjectMenuController(mapActivity, pointDescription, (RenderedObject) object);
} else if (object instanceof MapillaryImage) {
menuController = new MapillaryMenuController(mapActivity, pointDescription, (MapillaryImage) object);
}
}
if (menuController == null) {
menuController = new PointDescriptionMenuController(mapActivity, pointDescription);
}
menuController.menuType = menuType;
menuController.setLatLon(latLon);
menuController.onCreated();
return menuController;
}
use of net.osmand.plus.GpxSelectionHelper.GpxDisplayItem in project Osmand by osmandapp.
the class SplitSegmentDialogFragment method getOverviewSegment.
private GpxDisplayItem getOverviewSegment() {
List<GpxDisplayGroup> result = getTrackActivity().getGpxFile(false);
GpxDisplayItem overviewSegment = null;
if (result.size() > 0) {
overviewSegment = result.get(0).getModifiableList().get(0);
}
return overviewSegment;
}
use of net.osmand.plus.GpxSelectionHelper.GpxDisplayItem in project Osmand by osmandapp.
the class SplitSegmentDialogFragment method updateContent.
public void updateContent() {
if (getTrackActivity() != null) {
adapter.clear();
adapter.setNotifyOnChange(false);
GpxDisplayItem overviewSegments = getOverviewSegment();
adapter.add(overviewSegments);
List<GpxDisplayItem> splitSegments = getSplitSegments();
adapter.addAll(splitSegments);
adapter.notifyDataSetChanged();
listView.setSelection(0);
headerView.setTranslationY(0);
updateHeader();
}
}
use of net.osmand.plus.GpxSelectionHelper.GpxDisplayItem in project Osmand by osmandapp.
the class TrackSegmentFragment method updateContent.
public void updateContent() {
adapter.clear();
List<GpxDisplayGroup> groups = getOriginalGroups();
adapter.setNotifyOnChange(false);
for (GpxDisplayItem i : flatten(groups)) {
adapter.add(i);
}
adapter.notifyDataSetChanged();
if (getActivity() != null) {
updateHeader();
}
}
Aggregations