From a47d81ada789228743dca23f6a2be600223eef0d Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Fri, 17 May 2013 23:54:44 +0200 Subject: [PATCH] Update buttons, add streets to info about route, update layout --- OsmAnd-java/src/net/osmand/NativeLibrary.java | 3 -- OsmAnd-java/src/net/osmand/PlatformUtil.java | 29 ---------------- .../plus/routing/RouteCalculationResult.java | 3 +- .../osmand/plus/routing/RouteProvider.java | 10 ------ .../osmand/plus/routing/RoutingHelper.java | 3 ++ OsmAnd/AndroidManifest.xml | 10 ++++++ OsmAnd/res/layout-large/main.xml | 6 ---- OsmAnd/res/layout/main.xml | 10 ------ OsmAnd/res/values/strings.xml | 7 ++-- .../plus/activities/MainMenuActivity.java | 2 +- .../plus/activities/MapActivityActions.java | 10 ++++-- .../plus/activities/SettingsActivity.java | 8 ----- .../activities/ShowRouteInfoActivity.java | 25 ++------------ .../net/osmand/plus/views/RouteInfoLayer.java | 33 ++++++++++++++++--- .../net/osmand/plus/views/TurnPathHelper.java | 6 ++-- 15 files changed, 63 insertions(+), 102 deletions(-) diff --git a/OsmAnd-java/src/net/osmand/NativeLibrary.java b/OsmAnd-java/src/net/osmand/NativeLibrary.java index 5546aa008d..dc433a979c 100644 --- a/OsmAnd-java/src/net/osmand/NativeLibrary.java +++ b/OsmAnd-java/src/net/osmand/NativeLibrary.java @@ -183,9 +183,6 @@ public class NativeLibrary { RenderingRuleSearchRequest request, boolean skipDuplicates, int renderRouteDataFile, Object objectWithInterruptedField, String msgIfNothingFound); - public static native void testRoutingPing(); - - public static native int testNativeRouting(String obfPath, double sLat, double sLon, double eLat, double eLon); /**/ // Empty native impl diff --git a/OsmAnd-java/src/net/osmand/PlatformUtil.java b/OsmAnd-java/src/net/osmand/PlatformUtil.java index e3f2b7bdd1..c7c6145615 100644 --- a/OsmAnd-java/src/net/osmand/PlatformUtil.java +++ b/OsmAnd-java/src/net/osmand/PlatformUtil.java @@ -19,8 +19,6 @@ import org.xmlpull.v1.XmlPullParserException; */ public class PlatformUtil { - public static boolean AVIAN_LIBRARY = false; - public static Log getLog(Class cl){ return LogFactory.getLog(cl); } @@ -30,33 +28,6 @@ public class PlatformUtil { } - // AVIAN missing dependency - /*public static net.osmand.Collator primaryCollator(){ - return new net.osmand.Collator() { - - @Override - public int compare(Object o1, Object o2) { - return compare(o1+"", o2+""); - } - - @Override - public boolean equals(String source, String target) { - if(source == null) { - return source == target; - } - return source.equals(target); - } - - @Override - public int compare(String source, String target) { - if(source == null) { - return source == target ? 0 : -1; - } - return source.compareTo(target); - } - }; - }*/ - public static net.osmand.Collator primaryCollator() { // romanian locale encounters diacritics as differnet symbols final java.text.Collator instance = Locale.getDefault().getLanguage().equals("ro") ? java.text.Collator.getInstance(Locale.US) diff --git a/OsmAnd-java/src/net/osmand/plus/routing/RouteCalculationResult.java b/OsmAnd-java/src/net/osmand/plus/routing/RouteCalculationResult.java index 10052a4cdc..290e241dfa 100644 --- a/OsmAnd-java/src/net/osmand/plus/routing/RouteCalculationResult.java +++ b/OsmAnd-java/src/net/osmand/plus/routing/RouteCalculationResult.java @@ -216,7 +216,8 @@ public class RouteCalculationResult { info.setDestinationName(next.getObject().getDestinationName()); } - String description = toString(turn, ctx); + String description = toString(turn, ctx) + " " + RoutingHelper.formatStreetName(info.getStreetName(), + info.getRef(), info.getDestinationName()); info.setDescriptionRoute(description); info.routePointOffset = prevLocationSize; if(directions.size() > 0 && prevDirectionTime > 0 && prevDirectionDistance > 0) { diff --git a/OsmAnd-java/src/net/osmand/plus/routing/RouteProvider.java b/OsmAnd-java/src/net/osmand/plus/routing/RouteProvider.java index 74657a3e22..2d77b587a3 100644 --- a/OsmAnd-java/src/net/osmand/plus/routing/RouteProvider.java +++ b/OsmAnd-java/src/net/osmand/plus/routing/RouteProvider.java @@ -313,18 +313,8 @@ public class RouteProvider { return new RouteCalculationResult(res, null, params.start, params.end, null, null, params.ctx, params.leftSide, true); } - protected RouteCalculationResult findNewVectorMapsRoute(RouteCalculationParams params) throws IOException { - String path = params.ctx.getAppPath("").getAbsolutePath(); - NativeLibrary.testNativeRouting(path, params.start.getLatitude(), - params.start.getLongitude(), params.end.getLatitude(), - params.end.getLongitude()); - return new RouteCalculationResult("Done "); - } protected RouteCalculationResult findVectorMapsRoute(RouteCalculationParams params) throws IOException { - if(PlatformUtil.AVIAN_LIBRARY) { - return findNewVectorMapsRoute(params); - } BinaryMapIndexReader[] files = params.ctx.getTodoAPI().getRoutingMapFiles(); RoutePlannerFrontEnd router = new RoutePlannerFrontEnd(!params.preciseRouting); OsmandSettings settings = params.ctx.getSettings(); diff --git a/OsmAnd-java/src/net/osmand/plus/routing/RoutingHelper.java b/OsmAnd-java/src/net/osmand/plus/routing/RoutingHelper.java index 95f08c6fe9..84ca8a4c10 100644 --- a/OsmAnd-java/src/net/osmand/plus/routing/RoutingHelper.java +++ b/OsmAnd-java/src/net/osmand/plus/routing/RoutingHelper.java @@ -601,6 +601,9 @@ public class RoutingHelper { } return name; } else { + if(ref == null) { + return ""; + } return ref; } } diff --git a/OsmAnd/AndroidManifest.xml b/OsmAnd/AndroidManifest.xml index cdba874430..da26c2e47b 100644 --- a/OsmAnd/AndroidManifest.xml +++ b/OsmAnd/AndroidManifest.xml @@ -9,6 +9,14 @@ + + + + + + + + @@ -19,6 +27,8 @@ + - -