Skip to content

Commit

Permalink
Return previous behaviour on Navigation Screen
Browse files Browse the repository at this point in the history
  • Loading branch information
nazar-kutz committed Mar 3, 2025
1 parent 4807acc commit 34ae743
Showing 1 changed file with 41 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -271,54 +271,54 @@ private void createSelectOnTheMapItem() {
MapActivity activity = (MapActivity) getActivity();
if (activity != null) {
// TODO: -------------------------------------------------------------------
OsmandApplication app = activity.getMyApplication();
MapRouteInfoMenu menu = activity.getMapRouteInfoMenu();
PointNavigationLayer layer = activity.getMapLayers().getNavigationLayer();
menu.selectOnScreen(pointType);
DialogListener listener = getListener();
if (listener != null) {
listener.onSelectOnMap(AddPointBottomSheetDialog.this);
}
dismiss();

SelectLocationController.showDialog(activity, new ILocationSelectionHandler() {
@Nullable
@Override
public Object getCenterPointIcon() {
return switch (pointType) {
case START -> layer.getStartPointIcon();
case INTERMEDIATE -> layer.getIntermediatePointIcon();
case TARGET -> layer.getPointToNavigateIcon();
default -> null;
};
}

@Override
public void onLocationSelected(@NonNull LatLon latLon) {
RotatedTileBox tileBox = app.getOsmandMap().getMapView().getRotatedTileBox();
PointF pointF = new PointF(tileBox.getCenterPixelX(), tileBox.getCenterPixelY());
app.runInUIThread(() -> menu.onSingleTap(pointF, tileBox), 50);
}

@NonNull
@Override
public String getDialogTitle() {
return switch (pointType) {
case START -> app.getString(R.string.add_start_point);
case INTERMEDIATE -> app.getString(R.string.add_intermediate_point);
case TARGET -> app.getString(R.string.add_destination_point);
default -> app.getString(R.string.choose_location);
};
}
});
// OsmandApplication app = activity.getMyApplication();
// MapRouteInfoMenu menu = activity.getMapRouteInfoMenu();
// PointNavigationLayer layer = activity.getMapLayers().getNavigationLayer();
// menu.selectOnScreen(pointType);
// DialogListener listener = getListener();
// if (listener != null) {
// listener.onSelectOnMap(AddPointBottomSheetDialog.this);
// }
// dismiss();
//
// SelectLocationController.showDialog(activity, new ILocationSelectionHandler() {
// @Nullable
// @Override
// public Object getCenterPointIcon() {
// return switch (pointType) {
// case START -> layer.getStartPointIcon();
// case INTERMEDIATE -> layer.getIntermediatePointIcon();
// case TARGET -> layer.getPointToNavigateIcon();
// default -> null;
// };
// }
//
// @Override
// public void onLocationSelected(@NonNull LatLon latLon) {
// RotatedTileBox tileBox = app.getOsmandMap().getMapView().getRotatedTileBox();
// PointF pointF = new PointF(tileBox.getCenterPixelX(), tileBox.getCenterPixelY());
// app.runInUIThread(() -> menu.onSingleTap(pointF, tileBox), 50);
// }
//
// @NonNull
// @Override
// public String getDialogTitle() {
// return switch (pointType) {
// case START -> app.getString(R.string.add_start_point);
// case INTERMEDIATE -> app.getString(R.string.add_intermediate_point);
// case TARGET -> app.getString(R.string.add_destination_point);
// default -> app.getString(R.string.choose_location);
// };
// }
// });
MapRouteInfoMenu menu = activity.getMapRouteInfoMenu();
menu.selectOnScreen(pointType);
DialogListener listener = getListener();
if (listener != null) {
listener.onSelectOnMap(AddPointBottomSheetDialog.this);
}
}
// dismiss();
dismiss();
// TODO: -------------------------------------------------------------------
})
.create();
Expand Down

0 comments on commit 34ae743

Please sign in to comment.