From 9c6b3c2d1cb6e8739ae11fd875727aad304e02bb Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Wed, 11 Nov 2015 19:45:54 +0100 Subject: [PATCH] Fix --- OsmAnd/build.xml | 3 +-- OsmAnd/src/net/osmand/plus/GPXUtilities.java | 3 +++ .../plus/activities/IntermediatePointsDialog.java | 4 ---- .../plus/activities/MapActivityActions.java | 15 +++++++++++---- .../plus/mapcontextmenu/MapContextMenu.java | 3 ++- .../osmedit/dialogs/PoiSubTypeDialogFragment.java | 1 - 6 files changed, 17 insertions(+), 12 deletions(-) diff --git a/OsmAnd/build.xml b/OsmAnd/build.xml index 42688a7f7b..3f6cde995d 100644 --- a/OsmAnd/build.xml +++ b/OsmAnd/build.xml @@ -100,9 +100,8 @@ - + - diff --git a/OsmAnd/src/net/osmand/plus/GPXUtilities.java b/OsmAnd/src/net/osmand/plus/GPXUtilities.java index 626d7161d6..4902e9f043 100644 --- a/OsmAnd/src/net/osmand/plus/GPXUtilities.java +++ b/OsmAnd/src/net/osmand/plus/GPXUtilities.java @@ -1,6 +1,8 @@ package net.osmand.plus; +import gnu.trove.list.array.TIntArrayList; + import java.io.BufferedInputStream; import java.io.File; import java.io.FileInputStream; @@ -553,6 +555,7 @@ public class GPXUtilities { public List tracks = new ArrayList(); public List points = new ArrayList(); public List routes = new ArrayList(); + public String warning = null; public String path = ""; public boolean showCurrentTrack; diff --git a/OsmAnd/src/net/osmand/plus/activities/IntermediatePointsDialog.java b/OsmAnd/src/net/osmand/plus/activities/IntermediatePointsDialog.java index 24e4ce0f62..dd7da97335 100644 --- a/OsmAnd/src/net/osmand/plus/activities/IntermediatePointsDialog.java +++ b/OsmAnd/src/net/osmand/plus/activities/IntermediatePointsDialog.java @@ -296,10 +296,6 @@ public class IntermediatePointsDialog { app.getTargetPointsHelper().removeWayPoint(cnt == 0, i); } } - // FIXME delete location when point is removed - // if(mapActivity instanceof MapActivity) { - // ((MapActivity) mapActivity).getMapLayers().getContextMenuLayer().setLocation(null, ""); - // } } } } diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java index 5f72eba459..b67d30051e 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java @@ -144,22 +144,29 @@ public class MapActivityActions implements DialogProvider { builder.create().show(); } - public void directionTo(double latitude, double longitude) { + public void directionTo(double latitude, double longitude, PointDescription pd) { final TargetPointsHelper targets = getMyApplication().getTargetPointsHelper(); - targets.navigateToPoint(new LatLon(latitude, longitude), true, -1, null); + targets.navigateToPoint(new LatLon(latitude, longitude), true, -1, pd); enterRoutePlanningMode(null, null, false); } - public void addAsWaypoint(double latitude, double longitude) { + public void addAsWaypoint(double latitude, double longitude, PointDescription pd) { TargetPointsHelper targets = getMyApplication().getTargetPointsHelper(); boolean destination = (targets.getPointToNavigate() == null); targets.navigateToPoint(new LatLon(latitude, longitude), true, destination ? -1 : targets.getIntermediatePoints().size(), - mapActivity.getContextMenu().getPointDescription()); + pd); openIntermediateEditPointsDialog(); } + + public void addAsTarget(double latitude, double longitude, PointDescription pd) { + TargetPointsHelper targets = getMyApplication().getTargetPointsHelper(); + targets.navigateToPoint(new LatLon(latitude, longitude), true, -1, + pd); + openIntermediateEditPointsDialog(); + } public void editWaypoints() { openIntermediateEditPointsDialog(); diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java index af620089f4..3adad7fed0 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java @@ -351,7 +351,8 @@ public class MapContextMenu extends MenuTitleController { if (pointDescription.isDestination()) { mapActivity.getMapActions().editWaypoints(); } else { - mapActivity.getMapActions().addAsWaypoint(latLon.getLatitude(), latLon.getLongitude()); + mapActivity.getMapActions().addAsTarget(latLon.getLatitude(), latLon.getLongitude(), + pointDescription); } close(); } diff --git a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/PoiSubTypeDialogFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/PoiSubTypeDialogFragment.java index 538c16683b..9bd5ea3084 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/PoiSubTypeDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/PoiSubTypeDialogFragment.java @@ -26,7 +26,6 @@ public class PoiSubTypeDialogFragment extends DialogFragment { AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); final Amenity a = (Amenity) getArguments().getSerializable(KEY_AMENITY); final Map allTranslatedNames = poiTypes.getAllTranslatedNames(a.getType(), true); - // (=^.^=) Set strings = allTranslatedNames.keySet(); final String[] subCats = strings.toArray(new String[strings.size()]); builder.setItems(subCats, new DialogInterface.OnClickListener() {