diff --git a/OsmAnd/AndroidManifest.xml b/OsmAnd/AndroidManifest.xml index f2d870080b..9adf3b6482 100644 --- a/OsmAnd/AndroidManifest.xml +++ b/OsmAnd/AndroidManifest.xml @@ -484,11 +484,17 @@ - + + + + + + + diff --git a/OsmAnd/res/layout/point_editor_fragment_new.xml b/OsmAnd/res/layout/point_editor_fragment_new.xml index e39a1dbf44..95d1feb56b 100644 --- a/OsmAnd/res/layout/point_editor_fragment_new.xml +++ b/OsmAnd/res/layout/point_editor_fragment_new.xml @@ -150,7 +150,7 @@ + + Point of the track to navigate Navigate from my location to the track Select another track - Choose track file to follow, or import one. + Choose track file to follow or import it from your device. Choose track file to follow Follow track Save as track file @@ -70,22 +70,22 @@ Add to a track file Save as new track file In case of reverse direction - Are you sure you want to close Plan route without saving? You will lose all changes. + Are you sure you want discard all changes in the planned route by closing it? Street-level imagery - Select a track file for which a new segment will be added. + Select a track file to add the new segment to. Navigation profile Threshold distance - To use this option OsmAnd need to snap your track to the map roads. \n\n On the next step you will need to select navigation profile to detect allowed roads and threshold distance to approximate you track with roads. + Next, snap your track to the nearest allowed road with one of your navigation profiles to use this option. Next segment Whole track Select how to connect points, with a straight line, or calculate a route between them with selected profile. - Only next segment will be recalculated using selected profile. - Whole track will be recalculated using selected profile. + Only the next segment will be recalculated using selected profile. + The whole track will be recalculated using the selected profile. Reverse route - Save as new Track + Save as new track Overwrite track Done - Select a track file for open. + Select a track file to open. Create new route Open existing track Import track @@ -96,29 +96,29 @@ Select the desired splitting option: by time or by distance. Select the interval at which marks with distance or time on the track will be displayed. Select width - Show start finish icons - Add to a Track + Show start and finish icons + Add to a track Plan a route Route between points - You need to set working days to continue - Closed OSM Note + Set working days to continue + Closed OSM note Go-cart Wheelchair forward Wheelchair Motor scooter Enduro motorcycle The added point will not be visible on the map, since the selected group is hidden, you can find it in \"%s\". - Get information about points of interest from Wikipedia. It is your pocket offline guide - just enable Wikipedia plugin and enjoy articles about objects around you. + Get info about points of interest from Wikipedia. It is your pocket offline guide - just turn on the Wikipedia plugin and enjoy articles about objects around you. Download Wikipedia maps The current destination point on the route will be deleted. If it will be the Destination, navigation will stop. Please provide a name for the point Volume buttons as zoom - Enable to control the map zoom level with device volume buttons. - Delete next destination point + Control the map-zoom level using the volume buttons on the device. + Delete nearest destination point Inline skates This device doesn\'t have speed cameras. Uninstall and Restart - Restart is needed to completely delete speed camera data. + Restart the app to delete all speed camera data. %1$s deleted Bearing Length limit diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/PointEditorFragmentNew.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/PointEditorFragmentNew.java index 918afaae29..1ba8d3c590 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/PointEditorFragmentNew.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/PointEditorFragmentNew.java @@ -38,6 +38,7 @@ import androidx.fragment.app.FragmentActivity; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; +import com.google.android.material.textfield.TextInputEditText; import com.google.android.material.textfield.TextInputLayout; import net.osmand.AndroidUtils; @@ -276,8 +277,9 @@ public abstract class PointEditorFragmentNew extends BaseOsmAndFragment { if (addressCaption.getVisibility() != View.VISIBLE) { addressCaption.setVisibility(View.VISIBLE); addAddressBtn.setText(view.getResources().getString(R.string.delete_address)); - View addressEdit = view.findViewById(R.id.address_edit); + TextInputEditText addressEdit = view.findViewById(R.id.address_edit); addressEdit.requestFocus(); + addressEdit.setSelection(addressEdit.getText().length()); AndroidUtils.softKeyboardDelayed(requireActivity(),addressEdit); } else { addressCaption.setVisibility(View.GONE); diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementEditingContext.java b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementEditingContext.java index e365348586..105c947ddc 100644 --- a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementEditingContext.java +++ b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementEditingContext.java @@ -743,7 +743,7 @@ public class MeasurementEditingContext { locations.add(l); } pair.second.setTrkPtIndex(locations.size() - 1); - if (i < size - 2) { + if (i < size - 2 && !locations.isEmpty()) { locations.remove(locations.size() - 1); } route.addAll(data.segments); diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java index 33d4f5cf5c..c176275725 100644 --- a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java +++ b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java @@ -166,6 +166,10 @@ public class MeasurementToolFragment extends BaseOsmAndFragment implements Route this.planRouteMode = planRouteMode; } + private void setDirectionMode(boolean directionMode) { + this.directionMode = directionMode; + } + @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @@ -1894,10 +1898,12 @@ public class MeasurementToolFragment extends BaseOsmAndFragment implements Route return showFragment(fragment, fragmentManager); } - public static boolean showInstance(FragmentManager fragmentManager, MeasurementEditingContext editingCtx, boolean planRoute) { + public static boolean showInstance(FragmentManager fragmentManager, MeasurementEditingContext editingCtx, + boolean planRoute, boolean directionMode) { MeasurementToolFragment fragment = new MeasurementToolFragment(); fragment.setEditingCtx(editingCtx); fragment.setPlanRouteMode(planRoute); + fragment.setDirectionMode(directionMode); return showFragment(fragment, fragmentManager); } diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/FollowTrackFragment.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/FollowTrackFragment.java index 12346bcf12..4f9214438e 100644 --- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/FollowTrackFragment.java +++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/FollowTrackFragment.java @@ -82,6 +82,7 @@ public class FollowTrackFragment extends ContextMenuScrollFragment implements Ca private GPXFile gpxFile; + private boolean editingTrack; private boolean selectingTrack; private int menuTitleHeight; @@ -529,6 +530,7 @@ public class FollowTrackFragment extends ContextMenuScrollFragment implements Ca public void openPlanRoute(boolean useAppMode) { MapActivity mapActivity = getMapActivity(); if (mapActivity != null && gpxFile != null) { + editingTrack = true; QuadRect rect = gpxFile.getRect(); TrkSegment segment = gpxFile.getNonEmptyTrkSegment(); ActionType actionType = segment == null ? ActionType.ADD_ROUTE_POINTS : ActionType.EDIT_SEGMENT; @@ -538,7 +540,7 @@ public class FollowTrackFragment extends ContextMenuScrollFragment implements Ca if (useAppMode) { editingContext.setAppMode(app.getRoutingHelper().getAppMode()); } - MeasurementToolFragment.showInstance(mapActivity.getSupportFragmentManager(), editingContext, true); + MeasurementToolFragment.showInstance(mapActivity.getSupportFragmentManager(), editingContext, true, true); } } @@ -609,7 +611,7 @@ public class FollowTrackFragment extends ContextMenuScrollFragment implements Ca private void onDismiss() { try { MapActivity mapActivity = getMapActivity(); - if (mapActivity != null) { + if (mapActivity != null && !editingTrack) { if (!mapActivity.isChangingConfigurations()) { mapActivity.getMapRouteInfoMenu().cancelSelectionFromTracks(); } diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/MapRouteInfoMenu.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/MapRouteInfoMenu.java index 876804b945..f3576af790 100644 --- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/MapRouteInfoMenu.java +++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/MapRouteInfoMenu.java @@ -1566,6 +1566,7 @@ public class MapRouteInfoMenu implements IRouteInformationListener, CardListener if (mapActivity != null) { GPXRouteParamsBuilder routeParams = mapActivity.getRoutingHelper().getCurrentGPXRoute(); if (routeParams != null) { + hide(); selectTrack(); } }