replace navigatePointDialog by IntermediatePointsDialog in navpoint and searchadd fragments
This commit is contained in:
parent
917e4fff83
commit
779b677551
3 changed files with 18 additions and 2 deletions
|
@ -1269,6 +1269,7 @@ public class MapActivityActions implements DialogProvider {
|
|||
if (onShow != null) {
|
||||
onShow.onClick(v);
|
||||
}
|
||||
// Issue 1929: Check where this dialohue appears and replace by IntermediatePointsDialog
|
||||
navigatePointDialogAndLaunchMap(activity, location.getLatitude(), location.getLongitude(), name);
|
||||
qa.dismiss();
|
||||
}
|
||||
|
@ -1279,6 +1280,7 @@ public class MapActivityActions implements DialogProvider {
|
|||
|
||||
|
||||
public static void navigatePointDialogAndLaunchMap(final Activity act, final double lat, final double lon, final String name){
|
||||
// Issue 1929: This dialog not needed anymore
|
||||
OsmandApplication ctx = (OsmandApplication) act.getApplication();
|
||||
final TargetPointsHelper targetPointsHelper = ctx.getTargetPointsHelper();
|
||||
final OsmandSettings settings = ctx.getSettings();
|
||||
|
|
|
@ -259,8 +259,15 @@ 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) {
|
||||
//MapActivityActions.navigatePointDialogAndLaunchMap(getActivity(), lat, lon, getString(R.string.point_on_map, lat, lon));
|
||||
// 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));
|
||||
if (targetPointsHelper.getIntermediatePoints().size() == 0) {
|
||||
targetPointsHelper.navigateToPoint(new LatLon(lat, lon), true, -1);
|
||||
} else {
|
||||
targetPointsHelper.navigateToPoint(new LatLon(lat, lon), true, targetPointsHelper.getIntermediatePoints().size());
|
||||
}
|
||||
IntermediatePointsDialog.openIntermediatePointsDialog(mapActivity);
|
||||
MapActivity.launchMapActivityMoveToTop(getActivity());
|
||||
} else if (mode == SHOW_ON_MAP){
|
||||
OsmandApplication app = (OsmandApplication) getActivity().getApplication();
|
||||
app.getSettings().setMapLocationToShow(lat, lon, Math.max(12, app.getSettings().getLastKnownMapZoom()),
|
||||
|
|
|
@ -296,8 +296,15 @@ public class SearchAddressFragment extends SherlockFragment {
|
|||
targetPointsHelper.setSingleDestination(searchPoint.getLatitude(), searchPoint.getLongitude(), historyName);
|
||||
MapActivity.launchMapActivityMoveToTop(getActivity());
|
||||
} else if (mode == ADD_WAYPOINT) {
|
||||
//MapActivityActions.navigatePointDialogAndLaunchMap(getActivity(), searchPoint.getLatitude(), searchPoint.getLongitude(), historyName);
|
||||
// Issue 1929 TODO: show IntermediatePointsDialog here instead of navigatePointDialog, without subsequent Directions
|
||||
MapActivityActions.navigatePointDialogAndLaunchMap(getActivity(), searchPoint.getLatitude(), searchPoint.getLongitude(), historyName);
|
||||
if (targetPointsHelper.getIntermediatePoints().size() == 0) {
|
||||
targetPointsHelper.navigateToPoint(searchPoint, true, -1);
|
||||
} else {
|
||||
targetPointsHelper.navigateToPoint(searchPoint, true, targetPointsHelper.getIntermediatePoints().size());
|
||||
}
|
||||
IntermediatePointsDialog.openIntermediatePointsDialog(mapActivity);
|
||||
MapActivity.launchMapActivityMoveToTop(getActivity());
|
||||
} else if (mode == SHOW_ON_MAP) {
|
||||
osmandSettings.setMapLocationToShow(searchPoint.getLatitude(), searchPoint.getLongitude(), zoom, historyName);
|
||||
MapActivity.launchMapActivityMoveToTop(getActivity());
|
||||
|
|
Loading…
Reference in a new issue