From bc18a229b9f29426bca3e4ded45e0fae9a299ed6 Mon Sep 17 00:00:00 2001 From: sonora Date: Wed, 12 Jun 2013 23:59:20 +0200 Subject: [PATCH] simplify by removing one dialogue --- .../plus/activities/MapActivityActions.java | 16 ++++++---------- .../plus/activities/NavigatePointFragment.java | 2 +- .../activities/search/SearchAddressFragment.java | 2 +- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java index 9580dd75c5..f5aac6f887 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java @@ -801,15 +801,13 @@ public class MapActivityActions implements DialogProvider { getDirections(loc, null, true); } } else if (standardId == R.string.context_menu_item_intermediate_point) { - // Issue 1929 TODO: show navigatePointDialog(if needed), then IntermediatePointDialog, but without subsequent Directions: - //targets.navigateToPoint(new LatLon(latitude, longitude), true, targets.getIntermediatePoints().size()); - navigatePointDialogAndLaunchMap(mapActivity, latitude, longitude, null); + // Issue 1929: Consistently show IntermediatePointDialog, without subsequent Directions screen + targets.navigateToPoint(new LatLon(latitude, longitude), true, targets.getIntermediatePoints().size()); IntermediatePointsDialog.openIntermediatePointsDialog(mapActivity); // For button-less search UI } else if (standardId == R.string.context_menu_item_destination_point) { - // Issue 1929 TODO: show navigatePointDialog(if needed), then IntermediatePointDialog, but without subsequent Directions: - //targets.navigateToPoint(new LatLon(latitude, longitude), true, -1); - navigatePointDialogAndLaunchMap(mapActivity, latitude, longitude, null); + // Issue 1929: Consistently show IntermediatePointDialog, without subsequent Directions screen + targets.navigateToPoint(new LatLon(latitude, longitude), true, -1); IntermediatePointsDialog.openIntermediatePointsDialog(mapActivity); } else if (standardId == R.string.context_menu_item_share_location) { shareLocation(latitude, longitude, mapActivity.getMapView().getZoom()); @@ -1309,16 +1307,14 @@ public class MapActivityActions implements DialogProvider { settings.insertIntermediatePoint(lat, lon, name, 0, false); } targetPointsHelper.updatePointsFromSettings(); - // Issue 1929 TODO: call IntermediatePointDialog from here(?) - //MapActivity.launchMapActivityMoveToTop(act); + MapActivity.launchMapActivityMoveToTop(act); } }); builder.show(); } else { settings.setPointToNavigate(lat, lon, false, name); targetPointsHelper.updatePointsFromSettings(); - // Issue 1929 TODO: call IntermediatePointDialog from here(?) - //MapActivity.launchMapActivityMoveToTop(act); + MapActivity.launchMapActivityMoveToTop(act); } } diff --git a/OsmAnd/src/net/osmand/plus/activities/NavigatePointFragment.java b/OsmAnd/src/net/osmand/plus/activities/NavigatePointFragment.java index 351fc01ed3..4d88f547d9 100644 --- a/OsmAnd/src/net/osmand/plus/activities/NavigatePointFragment.java +++ b/OsmAnd/src/net/osmand/plus/activities/NavigatePointFragment.java @@ -259,8 +259,8 @@ public class NavigatePointFragment extends SherlockFragment implements SearchAct targetPointsHelper.setSingleDestination(lat, lon, getString(R.string.point_on_map, lat, lon)); MapActivity.launchMapActivityMoveToTop(getActivity()); } else if (mode == ADD_WAYPOINT) { + // Issue 1929 TODO: show IntermediatePointsDialog here instead of navigatePointDialog, without subsequent Directions MapActivityActions.navigatePointDialogAndLaunchMap(getActivity(), lat, lon, getString(R.string.point_on_map, lat, lon)); - // Issue 1929 TODO: show IntermediatePointsDialog now, but without subsequent Directions } else if (mode == SHOW_ON_MAP){ OsmandApplication app = (OsmandApplication) getActivity().getApplication(); app.getSettings().setMapLocationToShow(lat, lon, Math.max(12, app.getSettings().getLastKnownMapZoom()), diff --git a/OsmAnd/src/net/osmand/plus/activities/search/SearchAddressFragment.java b/OsmAnd/src/net/osmand/plus/activities/search/SearchAddressFragment.java index 4c4dad5d37..88604156ee 100644 --- a/OsmAnd/src/net/osmand/plus/activities/search/SearchAddressFragment.java +++ b/OsmAnd/src/net/osmand/plus/activities/search/SearchAddressFragment.java @@ -296,8 +296,8 @@ public class SearchAddressFragment extends SherlockFragment { targetPointsHelper.setSingleDestination(searchPoint.getLatitude(), searchPoint.getLongitude(), historyName); MapActivity.launchMapActivityMoveToTop(getActivity()); } else if (mode == ADD_WAYPOINT) { + // Issue 1929 TODO: show IntermediatePointsDialog here instead of navigatePointDialog, without subsequent Directions MapActivityActions.navigatePointDialogAndLaunchMap(getActivity(), searchPoint.getLatitude(), searchPoint.getLongitude(), historyName); - // Issue 1929 TODO: show IntermediatePointsDialog now, but without subsequent Directions } else if (mode == SHOW_ON_MAP) { osmandSettings.setMapLocationToShow(searchPoint.getLatitude(), searchPoint.getLongitude(), zoom, historyName); MapActivity.launchMapActivityMoveToTop(getActivity());