Fixes #3617.
When showing the elevation details, we need to distinguish between the user arriving by the dashboard or the route info menu. Only in the latter case the menu needs to be closed.
This commit is contained in:
parent
86f423bf13
commit
347b28dd31
1 changed files with 23 additions and 17 deletions
|
@ -386,24 +386,30 @@ public class ShowRouteInfoDialogFragment extends DialogFragment {
|
||||||
final MapActivity activity = (MapActivity)getActivity();
|
final MapActivity activity = (MapActivity)getActivity();
|
||||||
if (activity != null) {
|
if (activity != null) {
|
||||||
dismiss();
|
dismiss();
|
||||||
|
|
||||||
|
final OsmandSettings settings = activity.getMyApplication().getSettings();
|
||||||
|
settings.setMapLocationToShow(location.getLatitude(), location.getLongitude(),
|
||||||
|
settings.getLastKnownMapZoom(),
|
||||||
|
new PointDescription(PointDescription.POINT_TYPE_WPT, gpxItem.name),
|
||||||
|
false,
|
||||||
|
gpxItem);
|
||||||
|
|
||||||
final MapRouteInfoMenu mapRouteInfoMenu = activity.getMapLayers().getMapControlsLayer().getMapRouteInfoMenu();
|
final MapRouteInfoMenu mapRouteInfoMenu = activity.getMapLayers().getMapControlsLayer().getMapRouteInfoMenu();
|
||||||
final LatLon fLocation = location;
|
if (mapRouteInfoMenu.isVisible()) {
|
||||||
mapRouteInfoMenu.setOnDismissListener(new OnDismissListener() {
|
// We arrived here by the route info menu.
|
||||||
@Override
|
// First, we close it and then show the details.
|
||||||
public void onDismiss(DialogInterface dialog) {
|
mapRouteInfoMenu.setOnDismissListener(new OnDismissListener() {
|
||||||
mapRouteInfoMenu.setOnDismissListener(null);
|
@Override
|
||||||
|
public void onDismiss(DialogInterface dialog) {
|
||||||
final OsmandSettings settings = activity.getMyApplication().getSettings();
|
mapRouteInfoMenu.setOnDismissListener(null);
|
||||||
settings.setMapLocationToShow(fLocation.getLatitude(), fLocation.getLongitude(),
|
MapActivity.launchMapActivityMoveToTop(activity);
|
||||||
settings.getLastKnownMapZoom(),
|
}
|
||||||
new PointDescription(PointDescription.POINT_TYPE_WPT, gpxItem.name),
|
});
|
||||||
false,
|
mapRouteInfoMenu.hide();
|
||||||
gpxItem);
|
} else {
|
||||||
|
// We arrived here by the dashboard.
|
||||||
MapActivity.launchMapActivityMoveToTop(activity);
|
MapActivity.launchMapActivityMoveToTop(activity);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
mapRouteInfoMenu.hide();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue