diff --git a/OsmAnd-java/src/main/java/net/osmand/binary/RouteDataObject.java b/OsmAnd-java/src/main/java/net/osmand/binary/RouteDataObject.java
index 0dfc2e5c83..0fb0bdacf6 100644
--- a/OsmAnd-java/src/main/java/net/osmand/binary/RouteDataObject.java
+++ b/OsmAnd-java/src/main/java/net/osmand/binary/RouteDataObject.java
@@ -1011,6 +1011,17 @@ public class RouteDataObject {
rf == null ? "" : rf);
}
+ public boolean hasNameTagStartsWith(String tagStartsWith) {
+ int[] nextSegmentNameIds = nameIds;
+ for (int nm = 0; nm < nameIds.length; nm++) {
+ RouteTypeRule rtr = region.quickGetEncodingRule(nameIds[nm]);
+ if (rtr != null && rtr.getTag().startsWith(tagStartsWith)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
public static class RestrictionInfo {
public int type;
public long toWay;
diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml
index 1e3708d6fb..42d462d142 100644
--- a/OsmAnd/res/values/strings.xml
+++ b/OsmAnd/res/values/strings.xml
@@ -1294,6 +1294,7 @@
Turn on quick recording
Display a system notification allowing trip recording.
Notifications
+ Resume
Continue
Pause
Paused
@@ -2112,8 +2113,8 @@
Online tracking (GPX required)
Start online tracking
Stop online tracking
- Start GPX logging
- Stop GPX logging
+ Resume GPX logging
+ Pause GPX logging
Start new segment
Buildings
Non-vehicle highways
diff --git a/OsmAnd/src/net/osmand/plus/notifications/GpxNotification.java b/OsmAnd/src/net/osmand/plus/notifications/GpxNotification.java
index 091acd0069..ed39dff767 100644
--- a/OsmAnd/src/net/osmand/plus/notifications/GpxNotification.java
+++ b/OsmAnd/src/net/osmand/plus/notifications/GpxNotification.java
@@ -175,7 +175,7 @@ public class GpxNotification extends OsmandNotification {
PendingIntent.FLAG_UPDATE_CURRENT);
if (recordedDistance > 0) {
notificationBuilder.addAction(R.drawable.ic_notification_rec_start,
- app.getString(R.string.shared_string_continue), startPendingIntent);
+ app.getString(R.string.shared_string_resume), startPendingIntent);
notificationBuilder.addAction(R.drawable.ic_notification_save,
app.getString(R.string.shared_string_save), savePendingIntent);
} else {
diff --git a/OsmAnd/src/net/osmand/plus/routing/RouteCalculationResult.java b/OsmAnd/src/net/osmand/plus/routing/RouteCalculationResult.java
index b4b090442d..30da3fa575 100644
--- a/OsmAnd/src/net/osmand/plus/routing/RouteCalculationResult.java
+++ b/OsmAnd/src/net/osmand/plus/routing/RouteCalculationResult.java
@@ -230,6 +230,7 @@ public class RouteCalculationResult {
RouteDirectionInfo info = new RouteDirectionInfo(localDirections.get(currentDirection).getAverageSpeed(), TurnType.straight());
info.setRef(toSplit.getRef());
info.setStreetName(toSplit.getStreetName());
+ info.setRouteDataObject(toSplit.getRouteDataObject());
info.setDestinationName(toSplit.getDestinationName());
info.routePointOffset = interLocations[currentIntermediate];
info.setDescriptionRoute(ctx.getString(R.string.route_head));//; //$NON-NLS-1$
@@ -412,32 +413,17 @@ public class RouteCalculationResult {
if (ref != null) {
RouteDataObject nextRoad = next.getObject();
- boolean isNextShieldFound = false;
- int[] nextSegmentNameIds = nextRoad.nameIds;
- for (int nm = 0; nm < nextSegmentNameIds.length; nm++) {
- if (nextRoad.region.quickGetEncodingRule(nextSegmentNameIds[nm]).getTag().startsWith("road_ref")) {
- info.setRouteDataObject(nextRoad);
- isNextShieldFound = true;
- }
- }
+ info.setRouteDataObject(nextRoad);
- if (!isNextShieldFound) {
- for (int ind = lind; ind < list.size(); ind++) {
- if (list.get(ind).getTurnType() != null) {
- info.setRouteDataObject(null);
- break;
- } else {
- RouteDataObject obj = list.get(ind).getObject();
- int[] nameIds = obj.nameIds;
- for (int idx = 0; idx < nameIds.length; idx ++) {
- if (obj.region.routeEncodingRules.get(obj.nameIds[idx]).getTag().startsWith("road_ref")) {
- info.setRouteDataObject(obj);
- break;
- }
- }
- if (info.getRouteDataObject() != null) {
- break;
- }
+ boolean isNextShieldFound = nextRoad.hasNameTagStartsWith("road_ref");
+ for (int ind = lind; ind < list.size() && !isNextShieldFound; ind++) {
+ if (list.get(ind).getTurnType() != null) {
+ isNextShieldFound = true;
+ } else {
+ RouteDataObject obj = list.get(ind).getObject();
+ if (obj.hasNameTagStartsWith("road_ref")) {
+ info.setRouteDataObject(obj);
+ isNextShieldFound = true;
}
}
}
@@ -787,6 +773,7 @@ public class RouteCalculationResult {
if (segs != null) {
RouteSegmentResult lastSegmentResult = segs.get(segs.size() - 1);
RouteDataObject routeDataObject = lastSegmentResult.getObject();
+ info.setRouteDataObject(routeDataObject);
info.setRef(routeDataObject.getRef(ctx.getSettings().MAP_PREFERRED_LOCALE.get(),
ctx.getSettings().MAP_TRANSLITERATE_NAMES.get(), lastSegmentResult.isForwardDirection()));
info.setStreetName(routeDataObject.getName(ctx.getSettings().MAP_PREFERRED_LOCALE.get(),
@@ -1143,6 +1130,7 @@ public class RouteCalculationResult {
p = new RouteDirectionInfo(i.getAverageSpeed(), i.getTurnType());
p.routePointOffset = i.routePointOffset;
p.routeEndPointOffset = i.routeEndPointOffset;
+ p.setRouteDataObject(i.getRouteDataObject());
p.setDestinationName(i.getDestinationName());
p.setRef(i.getRef());
p.setStreetName(i.getStreetName());
diff --git a/OsmAnd/src/net/osmand/plus/routing/RouteProvider.java b/OsmAnd/src/net/osmand/plus/routing/RouteProvider.java
index 3d3c75dd5c..353dd7b0e8 100644
--- a/OsmAnd/src/net/osmand/plus/routing/RouteProvider.java
+++ b/OsmAnd/src/net/osmand/plus/routing/RouteProvider.java
@@ -480,7 +480,7 @@ public class RouteProvider {
ch.routeEndPointOffset = info.routeEndPointOffset - startI[0];
}
ch.setDescriptionRoute(info.getDescriptionRoutePart());
-
+ ch.setRouteDataObject(info.getRouteDataObject());
// Issue #2894
if (info.getRef() != null && !"null".equals(info.getRef())) {
ch.setRef(info.getRef());
diff --git a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java
index fb3a7e5de7..60e3093558 100644
--- a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java
+++ b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java
@@ -1145,6 +1145,9 @@ public class MapInfoWidgetsFactory {
additional.append(key).append("=").append(val).append(";");
}
}
+ if(name == null || nameTag == null) {
+ return false;
+ }
Context context = topBar.getContext();
int[] tps = object.getTypes();