Open track menu on short click

This commit is contained in:
Vitaliy 2021-04-06 16:30:35 +03:00
parent 387de3925f
commit 2838e408a9

View file

@ -44,10 +44,10 @@ import net.osmand.plus.R;
import net.osmand.plus.UiUtilities;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.base.PointImageDrawable;
import net.osmand.plus.itinerary.ItineraryGroup;
import net.osmand.plus.mapcontextmenu.controllers.SelectedGpxMenuController.SelectedGpxPoint;
import net.osmand.plus.mapcontextmenu.other.TrackChartPoints;
import net.osmand.plus.mapmarkers.MapMarker;
import net.osmand.plus.itinerary.ItineraryGroup;
import net.osmand.plus.mapmarkers.MapMarkersHelper;
import net.osmand.plus.render.OsmandRenderer;
import net.osmand.plus.render.OsmandRenderer.RenderingContext;
@ -56,6 +56,7 @@ import net.osmand.plus.settings.backend.CommonPreference;
import net.osmand.plus.track.GradientScaleType;
import net.osmand.plus.track.SaveGpxAsyncTask;
import net.osmand.plus.track.TrackDrawInfo;
import net.osmand.plus.track.TrackMenuFragment;
import net.osmand.plus.views.OsmandMapLayer;
import net.osmand.plus.views.OsmandMapTileView;
import net.osmand.plus.views.Renderable;
@ -1098,9 +1099,17 @@ public class GPXLayer extends OsmandMapLayer implements IContextMenuProvider, IM
}
@Override
public boolean runExclusiveAction(Object o, boolean unknownLocation) {
public boolean runExclusiveAction(Object object, boolean unknownLocation) {
if (unknownLocation || !(object instanceof SelectedGpxPoint)) {
return false;
}
MapActivity mapActivity = (MapActivity) view.getContext();
SelectedGpxPoint point = (SelectedGpxPoint) object;
WptPt wptPt = point.getSelectedPoint();
TrackMenuFragment.showInstance(mapActivity, point.getSelectedGpxFile(),
new LatLon(wptPt.lat, wptPt.lon), null, null);
return true;
}
@Override
public void collectObjectsFromPoint(PointF point, RotatedTileBox tileBox, List<Object> res, boolean unknownLocation) {