diff --git a/OsmAnd-java/src/main/java/net/osmand/router/BinaryRoutePlanner.java b/OsmAnd-java/src/main/java/net/osmand/router/BinaryRoutePlanner.java index de2da50d79..78966e4b5d 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/BinaryRoutePlanner.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/BinaryRoutePlanner.java @@ -138,7 +138,7 @@ public class BinaryRoutePlanner { checkIfGraphIsEmpty(ctx, ctx.getPlanRoadDirection() >= 0, graphDirectSegments, start, visitedDirectSegments, "Route is not found from selected start point."); if (ctx.planRouteIn2Directions()) { - forwardSearch = (nonHeuristicSegmentsComparator.compare(graphDirectSegments.peek(), graphReverseSegments.peek()) < 0); + forwardSearch = nonHeuristicSegmentsComparator.compare(graphDirectSegments.peek(), graphReverseSegments.peek()) <= 0; // if (graphDirectSegments.size() * 2 > graphReverseSegments.size()) { // forwardSearch = false; // } else if (graphDirectSegments.size() < 2 * graphReverseSegments.size()) { @@ -798,40 +798,41 @@ public class BinaryRoutePlanner { " distToEnd=" + distanceToEnd + " segmentPoint=" + segmentPoint + " -- ", next, true); } - if (!visitedSegments.containsKey(calculateRoutePointId(next, next.isPositive()))) { - if (next.getParentRoute() == null - || ctx.roadPriorityComparator(next.distanceFromStart, next.distanceToEnd, - distFromStart, distanceToEnd) > 0) { - next.distanceFromStart = distFromStart; - next.distanceToEnd = distanceToEnd; - if (TRACE_ROUTING) { - printRoad(" "+segmentPoint+">>" , next, null); - } - // put additional information to recover whole route after - next.setParentRoute(segment); - next.setParentSegmentEnd(segmentPoint); - graphSegments.add(next); - } - } else { + RouteSegment visIt = visitedSegments.get(calculateRoutePointId(next, next.isPositive())); + boolean toAdd = true; + if (visIt != null) { // the segment was already visited! We need to follow better route if it exists - // that is very exceptional situation and almost exception, it can happen + // that is very exceptional situation and almost exception, it can happen // 1. when we underestimate distnceToEnd - wrong h() - // 2. because we process not small segments but the whole road, it could be that + // 2. because we process not small segments but the whole road, it could be that // deviation from the road is faster than following the whole road itself! + if (TRACE_ROUTING) { + printRoad(">?", visitedSegments.get(calculateRoutePointId(next, next.isPositive())), + next.isPositive()); + } if (distFromStart < next.distanceFromStart) { if (ctx.config.heuristicCoefficient <= 1) { System.err.println("! Alert distance from start " + distFromStart + " < " + next.distanceFromStart + " id=" + next.road.id); } - // A: we can't change parent route just here, because we need to update visitedSegments - // presumably we can do visitedSegments.put(calculateRoutePointId(next), next); -// next.distanceFromStart = distFromStart; -// next.setParentRoute(segment); -// next.setParentSegmentEnd(segmentPoint); - if (ctx.visitor != null) { - // ctx.visitor.visitSegment(next, false); - } } + if (distFromStart < visIt.distanceFromStart && next.getParentRoute() == null) { + toAdd = true; + } else { + toAdd = false; + } + } + if (toAdd && (next.getParentRoute() == null || ctx.roadPriorityComparator(next.distanceFromStart, + next.distanceToEnd, distFromStart, distanceToEnd) > 0)) { + next.distanceFromStart = distFromStart; + next.distanceToEnd = distanceToEnd; + if (TRACE_ROUTING) { + printRoad(" " + segmentPoint + ">>", next, null); + } + // put additional information to recover whole route after + next.setParentRoute(segment); + next.setParentSegmentEnd(segmentPoint); + graphSegments.add(next); } } } diff --git a/OsmAnd-java/src/main/java/net/osmand/router/RoutePlannerFrontEnd.java b/OsmAnd-java/src/main/java/net/osmand/router/RoutePlannerFrontEnd.java index 6dd110fc22..3df6b65125 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/RoutePlannerFrontEnd.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/RoutePlannerFrontEnd.java @@ -234,6 +234,7 @@ public class RoutePlannerFrontEnd { if (intermediates != null) { for (LatLon l : intermediates) { if (!addSegment(l, ctx, indexNotFound++, points, false)) { + System.out.println(points.get(points.size() - 1).getRoad().toString()); return null; } } @@ -300,7 +301,8 @@ public class RoutePlannerFrontEnd { int py = MapUtils.get31TileNumberY(point.getLatitude()); int pind = st ? routeSegmentResult.getStartPointIndex() : routeSegmentResult.getEndPointIndex(); - RouteDataObject r = routeSegmentResult.getObject(); + RouteDataObject r = new RouteDataObject(routeSegmentResult.getObject()); + routeSegmentResult.setObject(r); QuadPoint before = null; QuadPoint after = null; if (pind > 0) { @@ -364,7 +366,7 @@ public class RoutePlannerFrontEnd { ctx.calculationProgress.segmentNotFound = indexNotFound; return false; } else { - log.info("Route segment found " + f.getRoad().id + " " + f.getRoad().getName()); + log.info("Route segment found " + f.road); res.add(f); return true; } @@ -383,6 +385,10 @@ public class RoutePlannerFrontEnd { ctx.precalculatedRouteDirection = routeDirection.adopt(ctx); } if (ctx.nativeLib != null) { + ctx.startX = start.preciseX; + ctx.startY = start.preciseY; + ctx.targetX = end.preciseX; + ctx.targetY = end.preciseY; return runNativeRouting(ctx, recalculationEnd); } else { refreshProgressDistance(ctx); diff --git a/OsmAnd-java/src/main/java/net/osmand/router/RouteResultPreparation.java b/OsmAnd-java/src/main/java/net/osmand/router/RouteResultPreparation.java index 9628dff602..14363c39af 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/RouteResultPreparation.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/RouteResultPreparation.java @@ -1,6 +1,24 @@ package net.osmand.router; -import net.osmand.NativeLibrary; +import java.io.FileWriter; +import java.io.IOException; +import java.io.InputStream; +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import org.apache.commons.logging.Log; +import org.xmlpull.v1.XmlPullParser; +import org.xmlpull.v1.XmlPullParserException; + +import gnu.trove.iterator.TIntIterator; +import gnu.trove.list.array.TIntArrayList; +import gnu.trove.set.hash.TIntHashSet; import net.osmand.PlatformUtil; import net.osmand.binary.BinaryMapIndexReader; import net.osmand.binary.BinaryMapRouteReaderAdapter.RouteTypeRule; @@ -19,26 +37,6 @@ import net.osmand.util.Algorithms; import net.osmand.util.MapAlgorithms; import net.osmand.util.MapUtils; -import org.apache.commons.logging.Log; -import org.xmlpull.v1.XmlPullParser; -import org.xmlpull.v1.XmlPullParserException; - -import java.io.FileWriter; -import java.io.IOException; -import java.io.InputStream; -import java.text.MessageFormat; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; - -import gnu.trove.iterator.TIntIterator; -import gnu.trove.list.array.TIntArrayList; -import gnu.trove.set.hash.TIntHashSet; - public class RouteResultPreparation { public static boolean PRINT_TO_CONSOLE_ROUTE_INFORMATION_TO_TEST = false; @@ -396,7 +394,6 @@ public class RouteResultPreparation { } // reverse it just to attach good direction roads Collections.reverse(result); - segment = finalSegment.reverseWaySearch ? finalSegment.opposite.getParentRoute() : finalSegment; int parentSegmentEnd = finalSegment.reverseWaySearch ? finalSegment.opposite.getParentSegmentEnd() : finalSegment.opposite.getSegmentStart(); parentRoutingTime = -1; @@ -623,7 +620,7 @@ public class RouteResultPreparation { // calculateStatistics(result); } - private void calculateStatistics(List result) { + protected void calculateStatistics(List result) { InputStream is = RenderingRulesStorage.class.getResourceAsStream("default.render.xml"); final Map renderingConstants = new LinkedHashMap(); try { @@ -800,13 +797,22 @@ public class RouteResultPreparation { } if (dist < mergeDistance) { mergeTurnLanes(leftside, currentSegment, nextSegment); - inferCommonActiveLane(currentSegment.getTurnType(), nextSegment.getTurnType()); + TurnType turnType = currentSegment.getTurnType(); + TIntHashSet possibleTurn = getPossibleTurnsFromActiveLanes(turnType.getLanes(), true); + if (possibleTurn.size() == 1) { + TurnType tt = TurnType.valueOf(possibleTurn.iterator().next(), currentSegment.getTurnType().isLeftSide()); + tt.setLanes(turnType.getLanes()); + tt.setSkipToSpeak(turnType.isSkipToSpeak()); + currentSegment.setTurnType(tt); + turnType = tt; + } + inferCommonActiveLane(turnType, nextSegment.getTurnType()); merged = true; } } if (!merged) { TurnType tt = currentSegment.getTurnType(); - inferActiveTurnLanesFromTurn(tt, TurnType.C); + inferActiveTurnLanesFromTurn(tt, tt.getValue()); } nextSegment = currentSegment; dist = 0; @@ -984,11 +990,9 @@ public class RouteResultPreparation { if(turnSet.size() == 1) { singleTurn = turnSet.iterator().next(); } else if(currentTurn.goAhead() && turnSet.contains(nextTurn.getValue())) { - if(currentTurn.isPossibleLeftTurn() && - TurnType.isLeftTurn(nextTurn.getValue())) { - singleTurn = nextTurn.getValue(); - } else if(currentTurn.isPossibleLeftTurn() && - TurnType.isLeftTurn(nextTurn.getActiveCommonLaneTurn())) { + if (currentTurn.isPossibleLeftTurn() && TurnType.isLeftTurn(nextTurn.getValue())) { + singleTurn = nextTurn.getValue(); + } else if (currentTurn.isPossibleLeftTurn() && TurnType.isLeftTurn(nextTurn.getActiveCommonLaneTurn())) { singleTurn = nextTurn.getActiveCommonLaneTurn(); } else if(currentTurn.isPossibleRightTurn() && TurnType.isRightTurn(nextTurn.getValue())) { @@ -1054,7 +1058,7 @@ public class RouteResultPreparation { // add description about turn double mpi = MapUtils.degreesDiff(prev.getBearingEnd(), rr.getBearingBegin()); if(noAttachedRoads){ - // TODO VICTOR : look at the comment inside direction route + // VICTOR : look at the comment inside direction route // ? avoid small zigzags is covered at (search for "zigzags") // double begin = rr.getObject().directionRoute(rr.getStartPointIndex(), rr.getStartPointIndex() < // rr.getEndPointIndex(), 25); @@ -1269,17 +1273,8 @@ public class RouteResultPreparation { String[] splitLaneOptions = turnLanes.split("\\|", -1); int activeBeginIndex = findActiveIndex(rawLanes, splitLaneOptions, rs.leftLanes, true, rs.leftLanesInfo, rs.roadsOnLeft, rs.addRoadsOnLeft); - - if(!rs.keepLeft && activeBeginIndex != -1 && - splitLaneOptions.length > 0 && !splitLaneOptions[splitLaneOptions.length - 1].contains(";")) { - activeBeginIndex = Math.max(activeBeginIndex, 1); - } int activeEndIndex = findActiveIndex(rawLanes, splitLaneOptions, rs.rightLanes, false, rs.rightLanesInfo, rs.roadsOnRight, rs.addRoadsOnRight); - if(!rs.keepRight && activeEndIndex != -1 && - splitLaneOptions.length > 0 && !splitLaneOptions[0].contains(";") ) { - activeEndIndex = Math.min(activeEndIndex, rawLanes.length - 1); - } if (activeBeginIndex == -1 || activeEndIndex == -1 || activeBeginIndex > activeEndIndex) { // something went wrong return createSimpleKeepLeftRightTurn(leftSide, prevSegm, currentSegm, rs); @@ -1292,6 +1287,12 @@ public class RouteResultPreparation { int tp = inferSlightTurnFromLanes(rawLanes, rs); if (tp != t.getValue() && tp != 0) { t = TurnType.valueOf(tp, leftSide); + } else { + if (rs.keepRight && TurnType.getSecondaryTurn(rawLanes[activeEndIndex]) == 0) { + t = TurnType.valueOf(TurnType.getPrimaryTurn(rawLanes[activeEndIndex]), leftSide); + } else if (rs.keepLeft && TurnType.getSecondaryTurn(rawLanes[activeBeginIndex]) == 0) { + t = TurnType.valueOf(TurnType.getPrimaryTurn(rawLanes[activeBeginIndex]), leftSide); + } } } else { for (int k = 0; k < rawLanes.length; k++) { @@ -1597,59 +1598,11 @@ public class RouteResultPreparation { } private int inferSlightTurnFromLanes(int[] oLanes, RoadSplitStructure rs) { - TIntHashSet possibleTurns = new TIntHashSet(); - for (int i = 0; i < oLanes.length; i++) { - if ((oLanes[i] & 1) == 0) { - continue; - } - if (possibleTurns.isEmpty()) { - // Nothing is in the list to compare to, so add the first elements - possibleTurns.add(TurnType.getPrimaryTurn(oLanes[i])); - if (TurnType.getSecondaryTurn(oLanes[i]) != 0) { - possibleTurns.add(TurnType.getSecondaryTurn(oLanes[i])); - } - if (TurnType.getTertiaryTurn(oLanes[i]) != 0) { - possibleTurns.add(TurnType.getTertiaryTurn(oLanes[i])); - } - } else { - TIntArrayList laneTurns = new TIntArrayList(); - laneTurns.add(TurnType.getPrimaryTurn(oLanes[i])); - if (TurnType.getSecondaryTurn(oLanes[i]) != 0) { - laneTurns.add(TurnType.getSecondaryTurn(oLanes[i])); - } - if (TurnType.getTertiaryTurn(oLanes[i]) != 0) { - laneTurns.add(TurnType.getTertiaryTurn(oLanes[i])); - } - possibleTurns.retainAll(laneTurns); - if (possibleTurns.isEmpty()) { - // No common turns, so can't determine anything. - return 0; - } - } + TIntHashSet possibleTurns = getPossibleTurnsFromActiveLanes(oLanes, false); + if (possibleTurns.isEmpty()) { + // No common turns, so can't determine anything. + return 0; } - - // Remove all turns from lanes not selected...because those aren't it - for (int i = 0; i < oLanes.length; i++) { - if ((oLanes[i] & 1) == 0 && !possibleTurns.isEmpty()) { - possibleTurns.remove((Integer) TurnType.getPrimaryTurn(oLanes[i])); - if (TurnType.getSecondaryTurn(oLanes[i]) != 0) { - possibleTurns.remove((Integer) TurnType.getSecondaryTurn(oLanes[i])); - } - if (TurnType.getTertiaryTurn(oLanes[i]) != 0) { - possibleTurns.remove((Integer) TurnType.getTertiaryTurn(oLanes[i])); - } - } - } - // remove all non-slight turns // TEST don't pass -// if(possibleTurns.size() > 1) { -// TIntIterator it = possibleTurns.iterator(); -// while(it.hasNext()) { -// int nxt = it.next(); -// if(!TurnType.isSlightTurn(nxt)) { -// it.remove(); -// } -// } -// } int infer = 0; if (possibleTurns.size() == 1) { infer = possibleTurns.iterator().next(); @@ -1688,6 +1641,53 @@ public class RouteResultPreparation { return infer; } + private TIntHashSet getPossibleTurnsFromActiveLanes(int[] oLanes, boolean onlyPrimary) { + TIntHashSet possibleTurns = new TIntHashSet(); + for (int i = 0; i < oLanes.length; i++) { + if ((oLanes[i] & 1) == 0) { + continue; + } + if (possibleTurns.isEmpty()) { + // Nothing is in the list to compare to, so add the first elements + possibleTurns.add(TurnType.getPrimaryTurn(oLanes[i])); + if (!onlyPrimary && TurnType.getSecondaryTurn(oLanes[i]) != 0) { + possibleTurns.add(TurnType.getSecondaryTurn(oLanes[i])); + } + if (!onlyPrimary && TurnType.getTertiaryTurn(oLanes[i]) != 0) { + possibleTurns.add(TurnType.getTertiaryTurn(oLanes[i])); + } + } else { + TIntArrayList laneTurns = new TIntArrayList(); + laneTurns.add(TurnType.getPrimaryTurn(oLanes[i])); + if (!onlyPrimary && TurnType.getSecondaryTurn(oLanes[i]) != 0) { + laneTurns.add(TurnType.getSecondaryTurn(oLanes[i])); + } + if (!onlyPrimary && TurnType.getTertiaryTurn(oLanes[i]) != 0) { + laneTurns.add(TurnType.getTertiaryTurn(oLanes[i])); + } + possibleTurns.retainAll(laneTurns); + if (possibleTurns.isEmpty()) { + // No common turns, so can't determine anything. + return possibleTurns; + } + } + } + + // Remove all turns from lanes not selected...because those aren't it + for (int i = 0; i < oLanes.length; i++) { + if ((oLanes[i] & 1) == 0 && !possibleTurns.isEmpty()) { + possibleTurns.remove((Integer) TurnType.getPrimaryTurn(oLanes[i])); + if (TurnType.getSecondaryTurn(oLanes[i]) != 0) { + possibleTurns.remove((Integer) TurnType.getSecondaryTurn(oLanes[i])); + } + if (TurnType.getTertiaryTurn(oLanes[i]) != 0) { + possibleTurns.remove((Integer) TurnType.getTertiaryTurn(oLanes[i])); + } + } + } + return possibleTurns; + } + private boolean isMotorway(RouteSegmentResult s){ String h = s.getObject().getHighway(); return "motorway".equals(h) || "motorway_link".equals(h) || diff --git a/OsmAnd-java/src/main/java/net/osmand/router/RouteSegmentResult.java b/OsmAnd-java/src/main/java/net/osmand/router/RouteSegmentResult.java index 9b8e72435e..40257c474b 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/RouteSegmentResult.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/RouteSegmentResult.java @@ -21,7 +21,9 @@ import gnu.trove.map.hash.TIntObjectHashMap; public class RouteSegmentResult implements StringExternalizable { - private final RouteDataObject object; + // this should be bigger (50-80m) but tests need to be fixed first + private static final float DIST_BEARING_DETECT = 5; + private RouteDataObject object; private int startPointIndex; private int endPointIndex; private List[] attachedRoutes; @@ -444,11 +446,11 @@ public class RouteSegmentResult implements StringExternalizable } public float getBearingBegin() { - return (float) (object.directionRoute(startPointIndex, startPointIndex < endPointIndex) / Math.PI * 180); + return (float) (object.directionRoute(startPointIndex, startPointIndex < endPointIndex, DIST_BEARING_DETECT) / Math.PI * 180); } public float getBearing(int point, boolean plus) { - return (float) (object.directionRoute(point, plus) / Math.PI * 180); + return (float) (object.directionRoute(point, plus, DIST_BEARING_DETECT) / Math.PI * 180); } public float getDistance(int point, boolean plus) { @@ -456,7 +458,7 @@ public class RouteSegmentResult implements StringExternalizable } public float getBearingEnd() { - return (float) (MapUtils.alignAngleDifference(object.directionRoute(endPointIndex, startPointIndex > endPointIndex) - Math.PI) / Math.PI * 180); + return (float) (MapUtils.alignAngleDifference(object.directionRoute(endPointIndex, startPointIndex > endPointIndex, DIST_BEARING_DETECT) - Math.PI) / Math.PI * 180); } public void setSegmentTime(float segmentTime) { @@ -533,10 +535,16 @@ public class RouteSegmentResult implements StringExternalizable public void setDescription(String description) { this.description = description; } + + public void setObject(RouteDataObject r) { + this.object = r; + } @Override public String toString() { return object.toString() + ": " + startPointIndex + "-" + endPointIndex; } + + } \ No newline at end of file diff --git a/OsmAnd-java/src/main/java/net/osmand/router/RoutingContext.java b/OsmAnd-java/src/main/java/net/osmand/router/RoutingContext.java index 77e08443db..2e657a8c5c 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/RoutingContext.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/RoutingContext.java @@ -436,7 +436,7 @@ public class RoutingContext { } TLongIterator it = ts.iterator(); TLongObjectHashMap excludeDuplications = new TLongObjectHashMap(); - while(it.hasNext()){ + while (it.hasNext()) { getAllObjects(it.next(), toFillIn, excludeDuplications); } timeToFindInitialSegments += (System.nanoTime() - now); @@ -467,15 +467,14 @@ public class RoutingContext { long h2 = runGCUsedMemory(); float mb = (1 << 20); log.warn("Unload tiles : estimated " + (sz1 - sz2) / mb + " ?= " + (h1 - h2) / mb + " actual"); - log.warn("Used after " + h2 / mb + " of " + Runtime.getRuntime().totalMemory() / mb + " max " - + maxMemory() / mb); + log.warn("Used after " + h2 / mb + " of " + Runtime.getRuntime().totalMemory() / mb ); } else { float mb = (1 << 20); int sz2 = getCurrentEstimatedSize(); log.warn("Unload tiles : occupied before " + sz1 / mb + " Mb - now " + sz2 / mb + "MB " + memoryLimit / mb + " limit MB " + config.memoryLimitation / mb); long us2 = (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()); - log.warn("Used memory before " + us1 / mb + "after " + us1 / mb + " of max " + maxMemory() / mb); + log.warn("Used memory before " + us1 / mb + "after " + us1 / mb ); } } if (!indexedSubregions.containsKey(tileId)) { @@ -507,12 +506,6 @@ public class RoutingContext { return tileId; } - private long maxMemory() { - // AVIAN FIXME -// return Runtime.getRuntime().maxMemory(); - return 0; - } - public boolean checkIfMemoryLimitCritical(long memoryLimit) { diff --git a/OsmAnd-java/src/main/java/net/osmand/router/TransportStopsRouteReader.java b/OsmAnd-java/src/main/java/net/osmand/router/TransportStopsRouteReader.java index 63705e250b..616b66aa55 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/TransportStopsRouteReader.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/TransportStopsRouteReader.java @@ -23,7 +23,7 @@ import net.osmand.osm.edit.Way; import net.osmand.util.MapUtils; public class TransportStopsRouteReader { - public static final int MISSING_STOP_SEARCH_RADIUS = 15000; + public static final int MISSING_STOP_SEARCH_RADIUS = 30000; TLongObjectHashMap combinedRoutesCache = new TLongObjectHashMap(); Map> routesFilesCache = new LinkedHashMap>(); diff --git a/OsmAnd-java/src/test/java/net/osmand/router/RouteResultPreparationTest.java b/OsmAnd-java/src/test/java/net/osmand/router/RouteResultPreparationTest.java index 31f4b3b4fa..d745a73327 100644 --- a/OsmAnd-java/src/test/java/net/osmand/router/RouteResultPreparationTest.java +++ b/OsmAnd-java/src/test/java/net/osmand/router/RouteResultPreparationTest.java @@ -38,15 +38,13 @@ public class RouteResultPreparationTest { private static RoutePlannerFrontEnd fe; private static RoutingContext ctx; - private String testName; private LatLon startPoint; private LatLon endPoint; private Map expectedResults; - private Log log = PlatformUtil.getLog(RouteResultPreparationTest.class); + protected Log log = PlatformUtil.getLog(RouteResultPreparationTest.class); public RouteResultPreparationTest(String testName, LatLon startPoint, LatLon endPoint, Map expectedResults) { - this.testName = testName; this.startPoint = startPoint; this.endPoint = endPoint; this.expectedResults = expectedResults; diff --git a/OsmAnd/res/drawable-hdpi/warnings_speed_limit_ca.png b/OsmAnd/res/drawable-hdpi/warnings_speed_limit_ca.png new file mode 100644 index 0000000000..add138f901 Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/warnings_speed_limit_ca.png differ diff --git a/OsmAnd/res/drawable-mdpi/warnings_speed_limit_ca.png b/OsmAnd/res/drawable-mdpi/warnings_speed_limit_ca.png new file mode 100644 index 0000000000..95870a1fe3 Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/warnings_speed_limit_ca.png differ diff --git a/OsmAnd/res/drawable-xhdpi/warnings_speed_limit_ca.png b/OsmAnd/res/drawable-xhdpi/warnings_speed_limit_ca.png new file mode 100644 index 0000000000..ab8c9d20d1 Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/warnings_speed_limit_ca.png differ diff --git a/OsmAnd/res/drawable-xxhdpi/warnings_speed_limit_ca.png b/OsmAnd/res/drawable-xxhdpi/warnings_speed_limit_ca.png new file mode 100644 index 0000000000..eb2a502172 Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/warnings_speed_limit_ca.png differ diff --git a/OsmAnd/res/drawable-xxxhdpi/warnings_speed_limit_ca.png b/OsmAnd/res/drawable-xxxhdpi/warnings_speed_limit_ca.png new file mode 100644 index 0000000000..4692c58ba7 Binary files /dev/null and b/OsmAnd/res/drawable-xxxhdpi/warnings_speed_limit_ca.png differ diff --git a/OsmAnd/res/drawable/img_help_vessel_height_day.xml b/OsmAnd/res/drawable/img_help_vessel_height_day.xml new file mode 100644 index 0000000000..e8706295c9 --- /dev/null +++ b/OsmAnd/res/drawable/img_help_vessel_height_day.xml @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OsmAnd/res/drawable/img_help_vessel_height_night.xml b/OsmAnd/res/drawable/img_help_vessel_height_night.xml new file mode 100644 index 0000000000..d0decd17a9 --- /dev/null +++ b/OsmAnd/res/drawable/img_help_vessel_height_night.xml @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OsmAnd/res/values-ar/strings.xml b/OsmAnd/res/values-ar/strings.xml index f88942fbf9..ef68e86faa 100644 --- a/OsmAnd/res/values-ar/strings.xml +++ b/OsmAnd/res/values-ar/strings.xml @@ -3765,4 +3765,5 @@ التحكم في رؤية التفاصيل الإضافية الظاهرة على الخريطة خريطة ليلية كل الوقت + ذوي الاحتياجات الخاصه. يتطلب \"إبقاء الشاشة قيد تشغيل\" تحت \"المهلة بعد الاستيقاظ\". \ No newline at end of file diff --git a/OsmAnd/res/values-eo/phrases.xml b/OsmAnd/res/values-eo/phrases.xml index 3e2abd6b28..baa3f8cb74 100644 --- a/OsmAnd/res/values-eo/phrases.xml +++ b/OsmAnd/res/values-eo/phrases.xml @@ -253,7 +253,7 @@ Fajrobrigada balailo Fajrobrigada tubo Fajrobrigada akvorezervujo - Salujego + Ujo kun sablo/salo Ambulanca stacio Stacio de civila defendo Vivsava rekonebla signo @@ -2924,7 +2924,7 @@ suki (taja varmega poto) udonoj (japanaj nudeloj) brasserie (steko kun terpomfingroj) - bubble tea/boba (tajvana teo-trinnkaĵo) + bobelteo/boba (tajvana teo-trinnkaĵo) jakitorio (rostita birdaĵo) cidroj (pomvinoj) viando diff --git a/OsmAnd/res/values-eo/strings.xml b/OsmAnd/res/values-eo/strings.xml index c4e4e9f45b..2cd18b210d 100644 --- a/OsmAnd/res/values-eo/strings.xml +++ b/OsmAnd/res/values-eo/strings.xml @@ -1305,7 +1305,14 @@ Intervalo de enreta kurs-registrado Difini intervalon de enreta kurs-registrado. Adreso de enreta kurs-registrado - Difini la retadreson uzante la jenajn argumentojn: latitudo={0}, longitudo={1}, tempomarko={2}, hdop(horizontala diluo de precizo)={3}, altitudo={4}, rapido={5}, birado={6}. + Difini la retadreson uzante la jenajn argumentojn: +\n lat={0} (latitudo), +\n lon={1} (longitudo), +\n timestamp={2} (tempmarko), +\n hdop={3} (horizontala diluo de precizo), +\n altitude={4} (altitudo), +\n speed={5} (rapido), +\n bearing={6} (birado). Ŝanĝi pozicion de marko Nuna spuro Konservu kurson uzante GPX-fenestraĵon aŭ per \'Registrado de kurso\' agordoj. @@ -3768,4 +3775,5 @@ Alĝustigi videblon de pliaj detaloj montrataj sur la mapo Nokta mapo Ĉiam + Malŝaltita. Postulas “teni ekranon aktiva” en la sekcio “aktiveca periodo de ekrano”. \ No newline at end of file diff --git a/OsmAnd/res/values-eu/strings.xml b/OsmAnd/res/values-eu/strings.xml index d53feac5cd..ed61fc2439 100644 --- a/OsmAnd/res/values-eu/strings.xml +++ b/OsmAnd/res/values-eu/strings.xml @@ -1390,7 +1390,7 @@ Lorratza %2$s Editatu GPX bide-puntua Kokapena Irakurri gehiago - Zer berri + Zer da berria Proposatuko objektuak Eguneratu Igo @@ -3233,7 +3233,7 @@ Area honi dagokio: %1$s x %2$s Analitikak Erakutsi mapa blokeo pantailan nabigazioan zehar. Ibilbide ezarpenak hautatutako \"%1$s.\" profilean. - Pantaila denbora-muga pertsonalizatua + Esnatu ondorengo denbora-muga Unitate eta formatuak Itxura Maparen itxura @@ -3520,7 +3520,7 @@ Area honi dagokio: %1$s x %2$s Angelua Nire kokapenaren eta kalkulatutako ibilbidearen artean segmentu zuzen bat agertuko da ibilbidea berriz kalkulatu arte Nire kokapena eta ibilbidearen arteko angelu minimoa - Tasa + Baloratu %1$s %2$s %1$s: %2$s Zure grabatutako lorratzak, %1$s, edo OsmAnd karpetan daude. @@ -3750,7 +3750,7 @@ Area honi dagokio: %1$s x %2$s Hautatu pantailaren denbora-muga esnatu ondoren. (\"%1$s\" ez da aplikatzen denbora-muga.) Mantendu pantaila piztuta Mantendu pantaila itzalita - Hau eraginkorra izateko \"%1$s\" desgaitu behar da. + \"%1$s\" gaituta badago, jarduera denbora bere menpekoa izango da. Sasi-Mercator proiekzioa Irudi fitxategi bat lauzako SQLiteDB fitxategia @@ -3772,9 +3772,16 @@ Area honi dagokio: %1$s x %2$s \nAste bat 10080 minutu dira. \nHilabete bat 43829 minutu dira. Aukeratu nola gorde deskargatutako lauzak. - Sistemako pantailaren denbora-muga + Pantailaren denbora-muga lehenetsia Ekintza azkarrak esportatu edo inportatu ditzakezu aplikazio-profilekin. Ezabatu denak\? Ziur behin betiko ezabatu nahi dituzula %d ekintza azkar\? Pantailaren denbora-muga + Eman ibilgailuaren zabalera, ibilgailu zabalentzako zenbait ibilbide murriztu daitezke. + Eman zure ibilgailuaren altuera, ibilgailu altuetarako zenbait ibilbide murriztu daitezke. + Eman zure ibilgailuaren pisua, ibilgailu astunentzako zenbait ibilbide murriztu daitezke. + Desgaituta. \"Mantendu pantaila piztuta\" behar da \"Esnatu ondorengo denbora-muga\" atalean. + metro + Kontrolatu mapan agertzen diren xehetasun gehigarrien ikusgaitasuna + Gauerako mapa \ No newline at end of file diff --git a/OsmAnd/res/values-fa/phrases.xml b/OsmAnd/res/values-fa/phrases.xml index 187f8db1c8..21fa180479 100644 --- a/OsmAnd/res/values-fa/phrases.xml +++ b/OsmAnd/res/values-fa/phrases.xml @@ -1352,4 +1352,103 @@ لوازم لوله‌کشی لوازم چوب کاشی و موزاییک + خبره + تازه‌کار + پیشرفته + متوسط + آسان + شن‌زار + چمن‌زار + چمن + باغ + دفتر + نقشه + دستی + منبع انرژی: گاز + انار + قهوه + خرما + انبه + کیوی + چای + هلو + گردو + گیلاس + نارگیل + موز + بادام + پرتغال + غیررسمی + ساختمان ویژه + ممنوع + مجاز + محتوا: نمک + محتوا: آب‌جو + محتوا: گاز + پاییز + تابستان + فصل مرطوب + فصل خشک + برند + رها شده + عرض + ارتفاع + بیشیه وزن + بیشینه ارتفاع + همراه + گوگل‌پلاس + اینستاگرام + یوتیوب + اسکایپ + رایانامه + وب‌گاه + تلفن + ساعت باز شد + خروج + ورودی اصلی + محدودکننده ارتفاع + منطقه نظامی + خودپرداز + فضای سیگار کشیدن + فضای بازی + فضای مذهبی + کاتولیک یونان + کلیسای انگلیس + پروتستان + سنی + بهایی + آکواریوم + تانک تاریخی + هواپیمای تاریخی + هاکی روی یخ + دفتر مشاور مالیات + دفتر بنیاد + دفتر حزب سیاسی + سیلو + رادار + کانال + علفزار + جنگل با مدیریت انسانی + خرده‌فروشی + درختان کریسمس + لامپ‌های کم‌مصرف + بسته‌بندی کاغذی + بسته‌بندی پلاستیکی + زباله سبز + زباله (کیسه‌های سیاه) + برجک برق + تیر برق + گاز مایع (ال‌پی‌جی) + دیزل + فشار + ویدئو + وضعیت + نوع + نوع + برداشت وجه + دسترسی معلولان + دسترسی موتور سیکلت + دسترسی کاروان + دسترسی اتوبوس + بله \ No newline at end of file diff --git a/OsmAnd/res/values-fa/strings.xml b/OsmAnd/res/values-fa/strings.xml index 03a1324459..9079d3c8d1 100644 --- a/OsmAnd/res/values-fa/strings.xml +++ b/OsmAnd/res/values-fa/strings.xml @@ -3770,9 +3770,9 @@ فشردن دکمهٔ خاموش/روشن دستگاه، صفحه را روشن می‌کند و OsmAnd را روی صفحهٔ قفل نمایش می‌دهد. دکمهٔ خاموش/روشن حسگر مجاورتی - صفحه را روشن نگه دار + روشن نگه داشتن صفحه صفحه را خاموش نگه دار - + فراتابی مرکاتور یک فایل تصویر برای هر کاشی این پارامترها هنگام استفاده از منبع به‌عنوان نقشه یا رولایه/زیرلایه، بر نمایش آن اثر می‌گذارند. \n @@ -3805,4 +3805,8 @@ نمایانی جزئیات اضافه‌تر روی نقشه را کنترل کنید نقشهٔ شب همیشه + غیرفعال است. به گزینهٔ «روشن نگه داشتن صفحه» در قسمت «زمان خاموشی پس از بیدارباش» نیاز دارد. + فراتابی شبه مرکاتور + اتصال + اتصال \ No newline at end of file diff --git a/OsmAnd/res/values-fr/strings.xml b/OsmAnd/res/values-fr/strings.xml index b0a88081b8..38a353e94a 100644 --- a/OsmAnd/res/values-fr/strings.xml +++ b/OsmAnd/res/values-fr/strings.xml @@ -766,7 +766,7 @@ Arrêter \n l\'exécution de l\'application en arrière-plan L\'écran est verrouillé - Positionner l\'intervalle d\'activation : + Définir l\'intervalle d\'activation : Configurer l\'écran Voies de circulation Éviter les voies non revêtues @@ -3715,7 +3715,7 @@ \n \n%2$s : Niveaux de zoom auxquels les tuiles originales seront visibles. En dehors de ces valeurs, il y aura une augmentation ou une diminution d\'échelle. L\'écran s\'allumera pour afficher les instructions de navigation. - Sélectionnez le temps d\'affichage de l\'écran après allumage (\"%1$s\" signifie pas d\'extinction). + Sélectionnez la durée d\'affichage de l\'écran après allumage (\"%1$s\" signifie pas d\'extinction). Si l\'option \"%1$s\" est activée, le temps d\'activité en dépendra. Délai d\'expiration en minutes. Les tuiles en cache seront rechargées après ce délai. Laissez ce champ vide pour ne jamais rafraîchir les tuiles pour cette source. \n @@ -3726,7 +3726,7 @@ Contrôle de l\'écran Utiliser le délai système pour l’extinction de l\'écran Options de réveil de l\'écran : - Sélectionnez les options de réveil de l’écran (assurez-vous qu’OsmAnd est au premier plan au moment du verrouillage de l’appareil) : + Sélectionnez les options d\'allumage de l’écran (assurez-vous qu’OsmAnd est au premier plan au moment du verrouillage de l’appareil) : Instructions de navigation Appuyez sur le bouton d\'alimentation de l\'appareil pour allumer l\'écran avec OsmAnd par dessus l’écran de verrouillage. Bouton marche / arrêt @@ -3757,4 +3757,5 @@ Contrôler la visibilité des autres détails affichés sur la carte Carte nocturne Tout le temps + Désactivé. Nécessite l\'option « Garder l\'écran allumé » sous « Délai d\'affichage de l\'écran ». \ No newline at end of file diff --git a/OsmAnd/res/values-he/strings.xml b/OsmAnd/res/values-he/strings.xml index b0ff9c5495..fc67204fef 100644 --- a/OsmAnd/res/values-he/strings.xml +++ b/OsmAnd/res/values-he/strings.xml @@ -3783,4 +3783,5 @@ שליטה בהופעה של פירוט נוסף על המפה מפת לילה כל הזמן + מושבת. נדרשת ההגדרה ‚להשאיר את המסך פעיל’ תחת ‚תפוגת זמן לאחר התעוררות’. \ No newline at end of file diff --git a/OsmAnd/res/values-is/strings.xml b/OsmAnd/res/values-is/strings.xml index e15cf86006..6b0602d089 100644 --- a/OsmAnd/res/values-is/strings.xml +++ b/OsmAnd/res/values-is/strings.xml @@ -3257,7 +3257,7 @@ Greiningar Birta kort á læsiskjá á meðan leiðsögn stendur. Stillingar leiðarvals í valda sniðinu \"%1$s\". - Vökutími + Tímamörk eftir vöknun Einingar og snið þeirra Útlit Útlit landakorts @@ -3724,13 +3724,13 @@ Óstudd tegund Leiðsagnarleiðbeiningar Eftirlæti - Takmarkað af \"%1$s\", ef það er virkt. + Ef \"%1$s\" valkosturinn er virkur, mun tími virkni vera háður honum. Leiðsagnarsnið Halda áfram OsmAnd + Mapillary Bæta við / breyta eftirlæti Birta almenningssamgöngur - Tímamörk kerfis fyrir skjá + Sjálfgefin tímamörk fyrir skjá Hnappur til að birta eða fela almenningssamgöngur á kortinu. Nálægðarskynjari Ferðalög (Wikipedia og Wikivoyage) @@ -3746,4 +3746,13 @@ \nEin vika er 10.080 mínútur. \nEinn mánuður er 43 829 mínútur. Til baka í breytingar + Slekkur á skjánum eftir að tímamörkum kerfis fyrir skjá er náð. + Ertu viss um að þú viljir eyða %d flýtiaðgerðum\? + Ef ýtt er á þennan aðgerðahnapp verður skipt á milli valinna notkunarsniða. + Eyða öllu\? + Tímamörk skjás + tónar + metrar + Stýra sýnileika viðbótaratriða sem birtast á kortinu + Næturkort \ No newline at end of file diff --git a/OsmAnd/res/values-pt-rBR/strings.xml b/OsmAnd/res/values-pt-rBR/strings.xml index 965c1cc574..152001e041 100644 --- a/OsmAnd/res/values-pt-rBR/strings.xml +++ b/OsmAnd/res/values-pt-rBR/strings.xml @@ -3762,4 +3762,5 @@ Pôr do Sol: %2$s Controlar a visibilidade dos detalhes adicionais mostrados no mapa Mapa noturno Tempo todo + Desativado. Requer \'manter a tela ligada\' em \'tempo limite após a ativação\'. \ No newline at end of file diff --git a/OsmAnd/res/values-ru/strings.xml b/OsmAnd/res/values-ru/strings.xml index 519310fe54..c563959468 100644 --- a/OsmAnd/res/values-ru/strings.xml +++ b/OsmAnd/res/values-ru/strings.xml @@ -3774,4 +3774,5 @@ Управление отображением дополнительных деталей на карте Всё время Ночная карта + Отключено. Необходимо включить «Держать экран включённым» в разделе «Время работы после пробуждения». \ No newline at end of file diff --git a/OsmAnd/res/values-sc/strings.xml b/OsmAnd/res/values-sc/strings.xml index 122f3b87d3..2be4a3bbb3 100644 --- a/OsmAnd/res/values-sc/strings.xml +++ b/OsmAnd/res/values-sc/strings.xml @@ -3733,4 +3733,8 @@ Iscantzellare totu\? Ses seguru de chèrrere iscantzellare definitivamente %d atziones lestras\? Totu su tempus + metros + Controlla sa visibilidade de delàllios additzionales ammustrados in sa mapa + Mapa noturna + sonerias \ No newline at end of file diff --git a/OsmAnd/res/values-sk/strings.xml b/OsmAnd/res/values-sk/strings.xml index 84f6528fa6..ba762b9aa4 100644 --- a/OsmAnd/res/values-sk/strings.xml +++ b/OsmAnd/res/values-sk/strings.xml @@ -3773,4 +3773,5 @@ Ovládajte viditeľnosť ďalších detailov zobrazených na mape Nočná mapa Vždy + Vypnuté. Vyžaduje \"Nechať obrazovku zapnutú\" pod \"Časový limit obrazovky po prebudení\". \ No newline at end of file diff --git a/OsmAnd/res/values-tr/strings.xml b/OsmAnd/res/values-tr/strings.xml index a5ff6e6f75..cc8c066cc7 100644 --- a/OsmAnd/res/values-tr/strings.xml +++ b/OsmAnd/res/values-tr/strings.xml @@ -3730,4 +3730,5 @@ Gece haritası Her zaman ton + Devre dışı. \'Uyandıktan sonra zaman aşımı\' altındaki \'Ekranı açık tut\' seçeneği gerekir. \ No newline at end of file diff --git a/OsmAnd/res/values-uk/strings.xml b/OsmAnd/res/values-uk/strings.xml index b253f4049f..751ebdfae2 100644 --- a/OsmAnd/res/values-uk/strings.xml +++ b/OsmAnd/res/values-uk/strings.xml @@ -3269,7 +3269,7 @@ Це налаштування вибране як усталене для профілів: %s Показати мапу на екрані блокування під час навігації. Налаштування для маршрутизації у вибраному профілі: %1$s. - Час очікування екрана + Час очікування після пробудження Попередження відображаються внизу зліва під час навігації. Мова та вивід Впливає на весь застосунок @@ -3738,7 +3738,7 @@ Час очікування екрану після увімкнення. («%1$s» вимикає вимкнення екрану.) Тримати екран увімкненим Тримати екран вимкненим - Використовується, тільки якщо \"%1$s\" вимкнено. + Якщо функцію \"%1$s\" увімкнено, час роботи залежатиме від неї. Псевдопроєкція Меркатора Один файл зображення на плитку Файл SQLiteDB @@ -3760,9 +3760,17 @@ \nОдин тиждень - 10 080 хвилин. \nОдин місяць - 43 829 хвилин. Виберіть спосіб зберігання завантажених плиток. - Системний час очікування екрану + Усталений час очікування екрану Ви можете експортувати або імпортувати швидкі дії з профілями застосунку. Видалити все\? Ви дійсно бажаєте безповоротно видалити %d швидких дій\? Час очікування екрана + Вкажіть вагу транспортного засобу, для важких транспортних засобів можуть застосовуватися деякі обмеження на маршрути. + тонни + метри + Керування відображенням додаткових деталей на мапі + Нічна мапа + Вкажіть ширину автомобіля, для великих транспортних засобів можуть застосовуватися обмеження на деяких маршрутах. + Вкажіть висоту автомобіля, для великих транспортних засобів можуть застосовуватися обмеження на деяких маршрутах. + Вимкнено. Потребує \'Тримати екран увімкненим\' у розділі \'Час очікування після пробудження\'. \ No newline at end of file diff --git a/OsmAnd/res/values-zh-rTW/strings.xml b/OsmAnd/res/values-zh-rTW/strings.xml index a99010cf29..c8f65f5731 100644 --- a/OsmAnd/res/values-zh-rTW/strings.xml +++ b/OsmAnd/res/values-zh-rTW/strings.xml @@ -3770,4 +3770,5 @@ 控制地圖上顯示的額外詳細資訊可見程度 夜晚地圖 全部時間 + 已停用。需要「喚醒後逾時」的「保持螢幕開啟」。 \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/OsmandApplication.java b/OsmAnd/src/net/osmand/plus/OsmandApplication.java index 4f1962166c..10d52563d1 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandApplication.java +++ b/OsmAnd/src/net/osmand/plus/OsmandApplication.java @@ -985,15 +985,14 @@ public class OsmandApplication extends MultiDexApplication { public void setupDrivingRegion(WorldRegion reg) { OsmandSettings.DrivingRegion drg = null; WorldRegion.RegionParams params = reg.getParams(); - boolean americanSigns = "american".equals(params.getRegionRoadSigns()); +// boolean americanSigns = "american".equals(params.getRegionRoadSigns()); boolean leftHand = "yes".equals(params.getRegionLeftHandDriving()); OsmandSettings.MetricsConstants mc1 = "miles".equals(params.getRegionMetric()) ? OsmandSettings.MetricsConstants.MILES_AND_FEET : OsmandSettings.MetricsConstants.KILOMETERS_AND_METERS; OsmandSettings.MetricsConstants mc2 = "miles".equals(params.getRegionMetric()) ? OsmandSettings.MetricsConstants.MILES_AND_METERS : OsmandSettings.MetricsConstants.KILOMETERS_AND_METERS; for (OsmandSettings.DrivingRegion r : OsmandSettings.DrivingRegion.values()) { - if (r.americanSigns == americanSigns && r.leftHandDriving == leftHand && - (r.defMetrics == mc1 || r.defMetrics == mc2)) { + if (r.leftHandDriving == leftHand && (r.defMetrics == mc1 || r.defMetrics == mc2)) { drg = r; break; } diff --git a/OsmAnd/src/net/osmand/plus/development/TestVoiceActivity.java b/OsmAnd/src/net/osmand/plus/development/TestVoiceActivity.java index b22717e079..3d29541be4 100644 --- a/OsmAnd/src/net/osmand/plus/development/TestVoiceActivity.java +++ b/OsmAnd/src/net/osmand/plus/development/TestVoiceActivity.java @@ -239,7 +239,7 @@ public class TestVoiceActivity extends OsmandActionBarActivity { addButton(ll, "\u25BA (11.1) (TAP TO FULLY POPULATE)\n" + getVoiceSystemInfo(), builder(p).attention("")); addButton(ll, "\u25BA (11.2) (TAP TO CHANGE)\n \u25CF Voice prompt delay for selected output: " + ((OsmandApplication) getApplication()).getSettings().VOICE_PROMPT_DELAY[((OsmandApplication) getApplication()).getSettings().AUDIO_MANAGER_STREAM.get()].get() + - "\u00A0ms.\nAvoids car stereo cutting off prompts. Default is 1500\u00A0ms for Phone call audio, or else 0\u00A0ms.", builder(p).attention("")); + "\u00A0ms\n (Avoids car stereo cutting off prompts. Default is 1500\u00A0ms for Phone call audio, or else 0\u00A0ms.)", builder(p).attention("")); addButton(ll, "\u25BA (11.3) (TAP TO TOGGLE)\n \u25CF Display each TTS utterance on screen: " + ((OsmandApplication) getApplication()).getSettings().DISPLAY_TTS_UTTERANCE.get().toString(), builder(p).attention("")); ll.forceLayout(); @@ -310,7 +310,7 @@ public class TestVoiceActivity extends OsmandActionBarActivity { } buttonDelay.setText("\u25BA (11.2) (TAP TO CHANGE)\n \u25CF Voice prompt delay for selected output: " + ((OsmandApplication) getApplication()).getSettings().VOICE_PROMPT_DELAY[((OsmandApplication) getApplication()).getSettings().AUDIO_MANAGER_STREAM.get()].get() + - "\u00A0ms.\nAvoids car stereo cutting off prompts. Default is 1500\u00A0ms for Phone call audio, or else 0\u00A0ms."); + "\u00A0ms\n (Avoids car stereo cutting off prompts. Default is 1500\u00A0ms for Phone call audio, or else 0\u00A0ms.)"); } if (description.startsWith("\u25BA (11.3)")) { if (((OsmandApplication) getApplication()).getSettings().DISPLAY_TTS_UTTERANCE.get() == false) { diff --git a/OsmAnd/src/net/osmand/plus/helpers/WaypointHelper.java b/OsmAnd/src/net/osmand/plus/helpers/WaypointHelper.java index 5cd0ce4b39..31dde7f59e 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/WaypointHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/WaypointHelper.java @@ -790,18 +790,19 @@ public class WaypointHelper { } else if (type == ALARMS) { //assign alarm list icons manually for now String typeString = ((AlarmInfo) point).getType().toString(); + OsmandSettings.DrivingRegion region = app.getSettings().DRIVING_REGION.get(); if (typeString.equals("SPEED_CAMERA")) { return AppCompatResources.getDrawable(uiCtx, R.drawable.mx_highway_speed_camera); } else if (typeString.equals("BORDER_CONTROL")) { return AppCompatResources.getDrawable(uiCtx, R.drawable.mx_barrier_border_control); } else if (typeString.equals("RAILWAY")) { - if (app.getSettings().DRIVING_REGION.get().americanSigns) { + if (region.isAmericanTypeSigns()) { return AppCompatResources.getDrawable(uiCtx, R.drawable.list_warnings_railways_us); } else { return AppCompatResources.getDrawable(uiCtx, R.drawable.list_warnings_railways); } } else if (typeString.equals("TRAFFIC_CALMING")) { - if (app.getSettings().DRIVING_REGION.get().americanSigns) { + if (region.isAmericanTypeSigns()) { return AppCompatResources.getDrawable(uiCtx, R.drawable.list_warnings_traffic_calming_us); } else { return AppCompatResources.getDrawable(uiCtx, R.drawable.list_warnings_traffic_calming); @@ -811,13 +812,13 @@ public class WaypointHelper { } else if (typeString.equals("STOP")) { return AppCompatResources.getDrawable(uiCtx, R.drawable.list_stop); } else if (typeString.equals("PEDESTRIAN")) { - if (app.getSettings().DRIVING_REGION.get().americanSigns) { + if (region.isAmericanTypeSigns()) { return AppCompatResources.getDrawable(uiCtx, R.drawable.list_warnings_pedestrian_us); } else { return AppCompatResources.getDrawable(uiCtx, R.drawable.list_warnings_pedestrian); } } else if (typeString.equals("TUNNEL")) { - if (app.getSettings().DRIVING_REGION.get().americanSigns) { + if (region.isAmericanTypeSigns()) { return AppCompatResources.getDrawable(uiCtx, R.drawable.list_warnings_tunnel_us); } else { return AppCompatResources.getDrawable(uiCtx, R.drawable.list_warnings_tunnel); diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/OsmandSettings.java b/OsmAnd/src/net/osmand/plus/settings/backend/OsmandSettings.java index 55d211417a..532dd0a245 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/OsmandSettings.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/OsmandSettings.java @@ -3794,7 +3794,7 @@ public class OsmandSettings { // this value string is synchronized with settings_pref.xml preference name public final OsmandPreference SAFE_MODE = new BooleanPreference("safe_mode", false).makeGlobal(); - public final OsmandPreference PT_SAFE_MODE = new BooleanPreference("pt_safe_mode", true).makeGlobal(); + public final OsmandPreference PT_SAFE_MODE = new BooleanPreference("pt_safe_mode", false).makeGlobal(); public final OsmandPreference NATIVE_RENDERING_FAILED = new BooleanPreference("native_rendering_failed_init", false).makeGlobal(); public final OsmandPreference USE_OPENGL_RENDER = new BooleanPreference("use_opengl_render", @@ -4138,23 +4138,27 @@ public class OsmandSettings { */ public enum DrivingRegion { - EUROPE_ASIA(R.string.driving_region_europe_asia, MetricsConstants.KILOMETERS_AND_METERS, false, false), - US(R.string.driving_region_us, MetricsConstants.MILES_AND_FEET, false, true), - CANADA(R.string.driving_region_canada, MetricsConstants.KILOMETERS_AND_METERS, false, true), - UK_AND_OTHERS(R.string.driving_region_uk, MetricsConstants.MILES_AND_METERS, true, false), - JAPAN(R.string.driving_region_japan, MetricsConstants.KILOMETERS_AND_METERS, true, false), - AUSTRALIA(R.string.driving_region_australia, MetricsConstants.KILOMETERS_AND_METERS, true, true); + EUROPE_ASIA(R.string.driving_region_europe_asia, MetricsConstants.KILOMETERS_AND_METERS, false), + US(R.string.driving_region_us, MetricsConstants.MILES_AND_FEET, false), + CANADA(R.string.driving_region_canada, MetricsConstants.KILOMETERS_AND_METERS, false), + UK_AND_OTHERS(R.string.driving_region_uk, MetricsConstants.MILES_AND_METERS, true), + JAPAN(R.string.driving_region_japan, MetricsConstants.KILOMETERS_AND_METERS, true), + AUSTRALIA(R.string.driving_region_australia, MetricsConstants.KILOMETERS_AND_METERS, true); public final boolean leftHandDriving; - public final boolean americanSigns; public final MetricsConstants defMetrics; public final int name; - DrivingRegion(int name, MetricsConstants def, boolean leftHandDriving, boolean americanSigns) { + DrivingRegion(int name, MetricsConstants def, boolean leftHandDriving) { this.name = name; defMetrics = def; this.leftHandDriving = leftHandDriving; - this.americanSigns = americanSigns; + } + + public boolean isAmericanTypeSigns() { + return this == OsmandSettings.DrivingRegion.AUSTRALIA || + this == OsmandSettings.DrivingRegion.US || + this == OsmandSettings.DrivingRegion.CANADA; } public String getDescription(Context ctx) { diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/ScreenAlertsFragment.java b/OsmAnd/src/net/osmand/plus/settings/fragments/ScreenAlertsFragment.java index 4752a11590..901d0cfdc9 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/ScreenAlertsFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/ScreenAlertsFragment.java @@ -149,7 +149,7 @@ public class ScreenAlertsFragment extends BaseSettingsFragment implements OnSpee private Drawable getWarningIcon() { ApplicationMode selectedMode = getSelectedAppMode(); - boolean americanSigns = settings.DRIVING_REGION.getModeValue(selectedMode).americanSigns; + boolean americanSigns = settings.DRIVING_REGION.getModeValue(selectedMode).isAmericanTypeSigns(); if (settings.SHOW_TRAFFIC_WARNINGS.getModeValue(selectedMode)) { return getIcon(americanSigns ? R.drawable.warnings_traffic_calming_us : R.drawable.warnings_traffic_calming); } else if (settings.SHOW_PEDESTRIAN.getModeValue(selectedMode)) { diff --git a/OsmAnd/src/net/osmand/plus/views/mapwidgets/RouteInfoWidgetsFactory.java b/OsmAnd/src/net/osmand/plus/views/mapwidgets/RouteInfoWidgetsFactory.java index 66467d6cf7..75c6fb9bef 100644 --- a/OsmAnd/src/net/osmand/plus/views/mapwidgets/RouteInfoWidgetsFactory.java +++ b/OsmAnd/src/net/osmand/plus/views/mapwidgets/RouteInfoWidgetsFactory.java @@ -1290,8 +1290,12 @@ public class RouteInfoWidgetsFactory { int locimgId = R.drawable.warnings_limit; String text = ""; String bottomText = ""; + OsmandSettings.DrivingRegion region = settings.DRIVING_REGION.get(); + boolean americanType = region.isAmericanTypeSigns(); if(alarm.getType() == AlarmInfoType.SPEED_LIMIT) { - if(settings.DRIVING_REGION.get().americanSigns){ + if(region == OsmandSettings.DrivingRegion.CANADA) { + locimgId = R.drawable.warnings_speed_limit_ca; + } else if(americanType){ locimgId = R.drawable.warnings_speed_limit_us; //else case is done by drawing red ring } @@ -1301,7 +1305,7 @@ public class RouteInfoWidgetsFactory { } else if(alarm.getType() == AlarmInfoType.BORDER_CONTROL) { locimgId = R.drawable.warnings_border_control; } else if(alarm.getType() == AlarmInfoType.HAZARD) { - if(settings.DRIVING_REGION.get().americanSigns){ + if (americanType) { locimgId = R.drawable.warnings_hazard_us; } else { locimgId = R.drawable.warnings_hazard; @@ -1310,7 +1314,7 @@ public class RouteInfoWidgetsFactory { //image done by drawing red ring text = "$"; } else if(alarm.getType() == AlarmInfoType.TRAFFIC_CALMING) { - if(settings.DRIVING_REGION.get().americanSigns){ + if (americanType) { locimgId = R.drawable.warnings_traffic_calming_us; } else { locimgId = R.drawable.warnings_traffic_calming; @@ -1318,19 +1322,19 @@ public class RouteInfoWidgetsFactory { } else if(alarm.getType() == AlarmInfoType.STOP) { locimgId = R.drawable.warnings_stop; } else if(alarm.getType() == AlarmInfoType.RAILWAY) { - if(settings.DRIVING_REGION.get().americanSigns){ + if (americanType) { locimgId = R.drawable.warnings_railways_us; } else { locimgId = R.drawable.warnings_railways; } } else if(alarm.getType() == AlarmInfoType.PEDESTRIAN) { - if(settings.DRIVING_REGION.get().americanSigns){ + if (americanType) { locimgId = R.drawable.warnings_pedestrian_us; } else { locimgId = R.drawable.warnings_pedestrian; } } else if(alarm.getType() == AlarmInfoType.TUNNEL) { - if(settings.DRIVING_REGION.get().americanSigns){ + if (americanType) { locimgId = R.drawable.warnings_tunnel_us; } else { locimgId = R.drawable.warnings_tunnel; @@ -1360,7 +1364,7 @@ public class RouteInfoWidgetsFactory { if (!Algorithms.objectEquals(text, this.textString)) { textString = text; this.text.setText(this.textString); - if (alarm.getType() == AlarmInfoType.SPEED_LIMIT && settings.DRIVING_REGION.get().americanSigns) { + if (alarm.getType() == AlarmInfoType.SPEED_LIMIT && americanType) { this.text.setPadding(0, AndroidUtils.dpToPx(layout.getContext(), 20f), 0, 0); } else { this.text.setPadding(0, 0, 0, 0); @@ -1370,7 +1374,7 @@ public class RouteInfoWidgetsFactory { bottomTextString = bottomText; this.bottomText.setText(this.bottomTextString); this.bottomText.setTextColor(ContextCompat.getColor(layout.getContext(), - settings.DRIVING_REGION.get().americanSigns ? R.color.color_black : R.color.color_white)); + americanType ? R.color.color_black : R.color.color_white)); } } }