From 1dc34d28aaa8d1b4f32fa93e2e2c6678a0ece841 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Allan=20Nordh=C3=B8y?= Date: Sat, 22 Aug 2020 22:03:10 +0200 Subject: [PATCH 1/9] New strings reworked --- OsmAnd/res/values/strings.xml | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index a1195b8a20..44c8fca222 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -24,11 +24,11 @@ Point of the track to navigate Navigate from my location to the track Select another track - Choose track file to follow or import it from device. + Choose track file to follow or import it from your device. Choose track file to follow Follow track Save as track file - Trip recoridng + Trip recording Add track waypoint Add track waypoint Import or record track files @@ -42,22 +42,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 @@ -68,29 +68,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 From 943f00a018afe046bad97cefcf204e2939260f53 Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 2 Sep 2020 13:36:24 +0300 Subject: [PATCH 2/9] ui fixes started --- OsmAnd/res/layout/point_editor_fragment_new.xml | 9 +++++++-- OsmAnd/res/values/dimens.xml | 1 + .../mapcontextmenu/editors/PointEditorFragmentNew.java | 4 +++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/OsmAnd/res/layout/point_editor_fragment_new.xml b/OsmAnd/res/layout/point_editor_fragment_new.xml index e39a1dbf44..8ac753afc0 100644 --- a/OsmAnd/res/layout/point_editor_fragment_new.xml +++ b/OsmAnd/res/layout/point_editor_fragment_new.xml @@ -150,7 +150,7 @@ + + 1.2 5dp + 42dp \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/PointEditorFragmentNew.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/PointEditorFragmentNew.java index 4cf98456be..fd1e47e5b2 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; @@ -273,8 +274,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); From afbb7902ac4c55050ea5650e0fcab4c6b7c77473 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Fri, 11 Sep 2020 16:12:42 +0300 Subject: [PATCH 3/9] Fix #9775 --- .../plus/measurementtool/MeasurementToolFragment.java | 8 +++++++- .../plus/routepreparationmenu/FollowTrackFragment.java | 6 ++++-- .../plus/routepreparationmenu/MapRouteInfoMenu.java | 1 + 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java index 8007470ba6..7aee988d21 100644 --- a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java +++ b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java @@ -168,6 +168,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, @@ -1933,10 +1937,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(); } } From 0c42601620724a11ec7f9c58e10ca1ebf9fe0f47 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Fri, 11 Sep 2020 16:57:09 +0300 Subject: [PATCH 4/9] Remove unnecessary dimen resource --- OsmAnd/res/layout/point_editor_fragment_new.xml | 4 ++-- OsmAnd/res/values/dimens.xml | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/OsmAnd/res/layout/point_editor_fragment_new.xml b/OsmAnd/res/layout/point_editor_fragment_new.xml index 8ac753afc0..7dc6929004 100644 --- a/OsmAnd/res/layout/point_editor_fragment_new.xml +++ b/OsmAnd/res/layout/point_editor_fragment_new.xml @@ -150,7 +150,7 @@ 1.2 5dp - 42dp \ No newline at end of file From 7161a08a66b606df0515ca91ea6bc029cd52ca2c Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Fri, 11 Sep 2020 17:04:26 +0300 Subject: [PATCH 5/9] Fix divider padding --- OsmAnd/res/layout/point_editor_fragment_new.xml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/OsmAnd/res/layout/point_editor_fragment_new.xml b/OsmAnd/res/layout/point_editor_fragment_new.xml index 7dc6929004..95d1feb56b 100644 --- a/OsmAnd/res/layout/point_editor_fragment_new.xml +++ b/OsmAnd/res/layout/point_editor_fragment_new.xml @@ -167,9 +167,11 @@ tools:text="@string/add_address" /> + android:layout_width="match_parent" + android:layout_height="1dp" + android:layout_marginLeft="@dimen/content_padding" + android:layout_marginRight="@dimen/content_padding" + android:background="?attr/dashboard_divider" /> Date: Fri, 11 Sep 2020 17:51:36 +0300 Subject: [PATCH 6/9] Fix #9772 --- .../osmand/plus/measurementtool/MeasurementEditingContext.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); From b0e3cc99cbd5b7b5651dcb34e6a70481a122fc41 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Fri, 11 Sep 2020 18:28:06 +0300 Subject: [PATCH 7/9] Fix #9777 --- OsmAnd/AndroidManifest.xml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 @@ - + + + + + + + From 0173e3c8818c9e18ae582399c293a7482579f583 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Fri, 11 Sep 2020 18:12:41 +0200 Subject: [PATCH 8/9] Fix xml --- OsmAnd/res/values/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index aaf33c5e36..0084a20c5a 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -80,7 +80,7 @@ Whole track Select how to connect points, with a straight line, or calculate a route between them with selected profile. Only the next segment will be recalculated using selected profile. - The whole track will be recalculated using the selected profile. + The whole track will be recalculated using the selected profile. Reverse route Save as new track Overwrite track From 45700f4ad906b87ead228855f31c9a283d0bee9e Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Fri, 11 Sep 2020 18:18:04 +0200 Subject: [PATCH 9/9] Fix xml --- OsmAnd/res/values/strings.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index 0084a20c5a..50c8ed0079 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -78,9 +78,9 @@ 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 the next segment will be recalculated using selected profile. - The whole track will be recalculated using the selected profile. + Select how to connect points, with a straight line, or calculate a route between them with 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 Overwrite track