diff --git a/OsmAnd-java/src/net/osmand/router/BinaryRoutePlanner.java b/OsmAnd-java/src/net/osmand/router/BinaryRoutePlanner.java index 8d18346a0d..fd5667f0a4 100644 --- a/OsmAnd-java/src/net/osmand/router/BinaryRoutePlanner.java +++ b/OsmAnd-java/src/net/osmand/router/BinaryRoutePlanner.java @@ -135,6 +135,7 @@ public class BinaryRoutePlanner { checkIfGraphIsEmpty(ctx, ctx.getPlanRoadDirection() >= 0, graphDirectSegments, start, visitedDirectSegments, "Route is not found from selected start point."); if (ctx.planRouteIn2Directions()) { + if(!graphDirectSegments.isEmpty() && !graphReverseSegments.isEmpty()) forwardSearch = (nonHeuristicSegmentsComparator.compare(graphDirectSegments.peek(), graphReverseSegments.peek()) < 0); // if (graphDirectSegments.size() * 2 > graphReverseSegments.size()) { // forwardSearch = false; @@ -206,14 +207,41 @@ public class BinaryRoutePlanner { } } } + + public RouteSegment initRouteSegment(final RoutingContext ctx, RouteSegment segment, boolean positiveDirection) { + if(segment.getSegmentStart() == 0 && !positiveDirection && segment.getRoad().getPointsLength() > 0) { + segment = loadSameSegment(ctx, segment, 1); + } else if(segment.getSegmentStart() == segment.getRoad().getPointsLength() -1 && positiveDirection && segment.getSegmentStart() > 0) { + segment = loadSameSegment(ctx, segment, segment.getSegmentStart() -1); + } + if(segment == null) { + return null; + } + return segment.initRouteSegment(positiveDirection); + } + + + protected RouteSegment loadSameSegment(final RoutingContext ctx, RouteSegment segment, int ind) { + int x31 = segment.getRoad().getPoint31XTile(ind); + int y31 = segment.getRoad().getPoint31YTile(ind); + RouteSegment s = ctx.loadRouteSegment(x31, y31, 0); + while(s != null) { + if(s.getRoad().getId() == segment.getRoad().getId()) { + segment = s; + break; + } + s = s.getNext(); + } + return segment; + } private void initQueuesWithStartEnd(final RoutingContext ctx, RouteSegment start, RouteSegment end, PriorityQueue graphDirectSegments, PriorityQueue graphReverseSegments) { - RouteSegment startPos = start.initRouteSegment(true); - RouteSegment startNeg = start.initRouteSegment(false); - RouteSegment endPos = end.initRouteSegment(true); - RouteSegment endNeg = end.initRouteSegment(false); + RouteSegment startPos = initRouteSegment(ctx, start, true); + RouteSegment startNeg = initRouteSegment(ctx, start, false); + RouteSegment endPos = initRouteSegment(ctx, end, true); + RouteSegment endNeg = initRouteSegment(ctx, end, false); // for start : f(start) = g(start) + h(start) = 0 + h(start) = h(start) if(ctx.config.initialDirection != null) { // mark here as positive for further check diff --git a/OsmAnd/AndroidManifest.xml b/OsmAnd/AndroidManifest.xml index 07a4d91feb..a1c02e9b27 100644 --- a/OsmAnd/AndroidManifest.xml +++ b/OsmAnd/AndroidManifest.xml @@ -2,7 +2,7 @@ @@ -54,18 +54,22 @@ - + + + + + + + + + - - - - - - - - - + diff --git a/OsmAnd/assets/fonts/Roboto-Medium.ttf b/OsmAnd/assets/fonts/Roboto-Medium.ttf new file mode 100644 index 0000000000..a3c1a1f170 Binary files /dev/null and b/OsmAnd/assets/fonts/Roboto-Medium.ttf differ diff --git a/OsmAnd/res/drawable-hdpi/bg_cardui.9.png b/OsmAnd/res/drawable-hdpi/bg_cardui.9.png new file mode 100644 index 0000000000..035983f72e Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/bg_cardui.9.png differ diff --git a/OsmAnd/res/drawable-hdpi/ic_ac_close.png b/OsmAnd/res/drawable-hdpi/ic_ac_close.png new file mode 100644 index 0000000000..f664f8ef8f Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/ic_ac_close.png differ diff --git a/OsmAnd/res/drawable-hdpi/ic_ac_help.png b/OsmAnd/res/drawable-hdpi/ic_ac_help.png new file mode 100644 index 0000000000..746232e70f Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/ic_ac_help.png differ diff --git a/OsmAnd/res/drawable-hdpi/ic_ac_settings.png b/OsmAnd/res/drawable-hdpi/ic_ac_settings.png new file mode 100644 index 0000000000..fbeb62be37 Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/ic_ac_settings.png differ diff --git a/OsmAnd/res/drawable-hdpi/ic_action_bus2.png b/OsmAnd/res/drawable-hdpi/ic_action_bus2.png new file mode 100644 index 0000000000..9192a0f0e5 Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/ic_action_bus2.png differ diff --git a/OsmAnd/res/drawable-hdpi/ic_action_fav2.png b/OsmAnd/res/drawable-hdpi/ic_action_fav2.png new file mode 100644 index 0000000000..58e3f13971 Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/ic_action_fav2.png differ diff --git a/OsmAnd/res/drawable-hdpi/ic_action_history2.png b/OsmAnd/res/drawable-hdpi/ic_action_history2.png new file mode 100644 index 0000000000..02a96c2de4 Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/ic_action_history2.png differ diff --git a/OsmAnd/res/drawable-hdpi/ic_action_home2.png b/OsmAnd/res/drawable-hdpi/ic_action_home2.png new file mode 100644 index 0000000000..cdbbd32c3d Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/ic_action_home2.png differ diff --git a/OsmAnd/res/drawable-hdpi/ic_action_info2.png b/OsmAnd/res/drawable-hdpi/ic_action_info2.png new file mode 100644 index 0000000000..a3cbd96b90 Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/ic_action_info2.png differ diff --git a/OsmAnd/res/drawable-hdpi/ic_action_marker2.png b/OsmAnd/res/drawable-hdpi/ic_action_marker2.png new file mode 100644 index 0000000000..d4ec00b2b0 Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/ic_action_marker2.png differ diff --git a/OsmAnd/res/drawable-hdpi/ic_download_cancel_normal.png b/OsmAnd/res/drawable-hdpi/ic_download_cancel_normal.png new file mode 100644 index 0000000000..debf873368 Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/ic_download_cancel_normal.png differ diff --git a/OsmAnd/res/drawable-hdpi/ic_download_cancel_tap.png b/OsmAnd/res/drawable-hdpi/ic_download_cancel_tap.png new file mode 100644 index 0000000000..af65969b19 Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/ic_download_cancel_tap.png differ diff --git a/OsmAnd/res/drawable-hdpi/ic_download_normal.png b/OsmAnd/res/drawable-hdpi/ic_download_normal.png new file mode 100644 index 0000000000..75fb954a27 Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/ic_download_normal.png differ diff --git a/OsmAnd/res/drawable-hdpi/ic_download_tap.png b/OsmAnd/res/drawable-hdpi/ic_download_tap.png new file mode 100644 index 0000000000..01989dbc8d Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/ic_download_tap.png differ diff --git a/OsmAnd/res/drawable-mdpi/bg_cardui.9.png b/OsmAnd/res/drawable-mdpi/bg_cardui.9.png new file mode 100644 index 0000000000..3232a33d7c Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/bg_cardui.9.png differ diff --git a/OsmAnd/res/drawable-mdpi/ic_ac_close.png b/OsmAnd/res/drawable-mdpi/ic_ac_close.png new file mode 100644 index 0000000000..bd30cd0c92 Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/ic_ac_close.png differ diff --git a/OsmAnd/res/drawable-mdpi/ic_ac_help.png b/OsmAnd/res/drawable-mdpi/ic_ac_help.png new file mode 100644 index 0000000000..8341644395 Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/ic_ac_help.png differ diff --git a/OsmAnd/res/drawable-mdpi/ic_ac_settings.png b/OsmAnd/res/drawable-mdpi/ic_ac_settings.png new file mode 100644 index 0000000000..ff2c85b734 Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/ic_ac_settings.png differ diff --git a/OsmAnd/res/drawable-mdpi/ic_action_bus2.png b/OsmAnd/res/drawable-mdpi/ic_action_bus2.png new file mode 100644 index 0000000000..04e7e89070 Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/ic_action_bus2.png differ diff --git a/OsmAnd/res/drawable-mdpi/ic_action_fav2.png b/OsmAnd/res/drawable-mdpi/ic_action_fav2.png new file mode 100644 index 0000000000..43f6253bf3 Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/ic_action_fav2.png differ diff --git a/OsmAnd/res/drawable-mdpi/ic_action_history2.png b/OsmAnd/res/drawable-mdpi/ic_action_history2.png new file mode 100644 index 0000000000..0c856a653d Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/ic_action_history2.png differ diff --git a/OsmAnd/res/drawable-mdpi/ic_action_home2.png b/OsmAnd/res/drawable-mdpi/ic_action_home2.png new file mode 100644 index 0000000000..04f357959f Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/ic_action_home2.png differ diff --git a/OsmAnd/res/drawable-mdpi/ic_action_info2.png b/OsmAnd/res/drawable-mdpi/ic_action_info2.png new file mode 100644 index 0000000000..eb2e641a74 Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/ic_action_info2.png differ diff --git a/OsmAnd/res/drawable-mdpi/ic_action_marker2.png b/OsmAnd/res/drawable-mdpi/ic_action_marker2.png new file mode 100644 index 0000000000..6789c727ce Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/ic_action_marker2.png differ diff --git a/OsmAnd/res/drawable-mdpi/ic_download_cancel_normal.png b/OsmAnd/res/drawable-mdpi/ic_download_cancel_normal.png new file mode 100644 index 0000000000..fa58c6672c Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/ic_download_cancel_normal.png differ diff --git a/OsmAnd/res/drawable-mdpi/ic_download_cancel_tap.png b/OsmAnd/res/drawable-mdpi/ic_download_cancel_tap.png new file mode 100644 index 0000000000..0c5e6cb7ce Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/ic_download_cancel_tap.png differ diff --git a/OsmAnd/res/drawable-mdpi/ic_download_normal.png b/OsmAnd/res/drawable-mdpi/ic_download_normal.png new file mode 100644 index 0000000000..5ae587c1ba Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/ic_download_normal.png differ diff --git a/OsmAnd/res/drawable-mdpi/ic_download_tap.png b/OsmAnd/res/drawable-mdpi/ic_download_tap.png new file mode 100644 index 0000000000..9d9386906d Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/ic_download_tap.png differ diff --git a/OsmAnd/res/drawable-xhdpi/bg_cardui.9.png b/OsmAnd/res/drawable-xhdpi/bg_cardui.9.png new file mode 100644 index 0000000000..ce357bfa94 Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/bg_cardui.9.png differ diff --git a/OsmAnd/res/drawable-xhdpi/ic_ac_close.png b/OsmAnd/res/drawable-xhdpi/ic_ac_close.png new file mode 100644 index 0000000000..047cc68c60 Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/ic_ac_close.png differ diff --git a/OsmAnd/res/drawable-xhdpi/ic_ac_help.png b/OsmAnd/res/drawable-xhdpi/ic_ac_help.png new file mode 100644 index 0000000000..e8423d305c Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/ic_ac_help.png differ diff --git a/OsmAnd/res/drawable-xhdpi/ic_ac_settings.png b/OsmAnd/res/drawable-xhdpi/ic_ac_settings.png new file mode 100644 index 0000000000..a8376cd0aa Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/ic_ac_settings.png differ diff --git a/OsmAnd/res/drawable-xhdpi/ic_action_bus2.png b/OsmAnd/res/drawable-xhdpi/ic_action_bus2.png new file mode 100644 index 0000000000..466683aee3 Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/ic_action_bus2.png differ diff --git a/OsmAnd/res/drawable-xhdpi/ic_action_fav2.png b/OsmAnd/res/drawable-xhdpi/ic_action_fav2.png new file mode 100644 index 0000000000..82791f9ac7 Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/ic_action_fav2.png differ diff --git a/OsmAnd/res/drawable-xhdpi/ic_action_history2.png b/OsmAnd/res/drawable-xhdpi/ic_action_history2.png new file mode 100644 index 0000000000..b363858797 Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/ic_action_history2.png differ diff --git a/OsmAnd/res/drawable-xhdpi/ic_action_home2.png b/OsmAnd/res/drawable-xhdpi/ic_action_home2.png new file mode 100644 index 0000000000..1d1bfdfc1e Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/ic_action_home2.png differ diff --git a/OsmAnd/res/drawable-xhdpi/ic_action_info2.png b/OsmAnd/res/drawable-xhdpi/ic_action_info2.png new file mode 100644 index 0000000000..f0330ad4b9 Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/ic_action_info2.png differ diff --git a/OsmAnd/res/drawable-xhdpi/ic_action_marker2.png b/OsmAnd/res/drawable-xhdpi/ic_action_marker2.png new file mode 100644 index 0000000000..4eb3cc5e4a Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/ic_action_marker2.png differ diff --git a/OsmAnd/res/drawable-xhdpi/ic_download_cancel_normal.png b/OsmAnd/res/drawable-xhdpi/ic_download_cancel_normal.png new file mode 100644 index 0000000000..7478fc4366 Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/ic_download_cancel_normal.png differ diff --git a/OsmAnd/res/drawable-xhdpi/ic_download_cancel_tap.png b/OsmAnd/res/drawable-xhdpi/ic_download_cancel_tap.png new file mode 100644 index 0000000000..cb72c6ccdb Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/ic_download_cancel_tap.png differ diff --git a/OsmAnd/res/drawable-xhdpi/ic_download_normal.png b/OsmAnd/res/drawable-xhdpi/ic_download_normal.png new file mode 100644 index 0000000000..432cdfc5c7 Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/ic_download_normal.png differ diff --git a/OsmAnd/res/drawable-xhdpi/ic_download_tap.png b/OsmAnd/res/drawable-xhdpi/ic_download_tap.png new file mode 100644 index 0000000000..165e230538 Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/ic_download_tap.png differ diff --git a/OsmAnd/res/drawable-xxhdpi/bg_cardui.9.png b/OsmAnd/res/drawable-xxhdpi/bg_cardui.9.png new file mode 100644 index 0000000000..97fe3d89f1 Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/bg_cardui.9.png differ diff --git a/OsmAnd/res/drawable-xxhdpi/ic_ac_close.png b/OsmAnd/res/drawable-xxhdpi/ic_ac_close.png new file mode 100644 index 0000000000..237956975f Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/ic_ac_close.png differ diff --git a/OsmAnd/res/drawable-xxhdpi/ic_ac_help.png b/OsmAnd/res/drawable-xxhdpi/ic_ac_help.png new file mode 100644 index 0000000000..ec5431de61 Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/ic_ac_help.png differ diff --git a/OsmAnd/res/drawable-xxhdpi/ic_ac_settings.png b/OsmAnd/res/drawable-xxhdpi/ic_ac_settings.png new file mode 100644 index 0000000000..588432071c Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/ic_ac_settings.png differ diff --git a/OsmAnd/res/drawable-xxhdpi/ic_action_bus2.png b/OsmAnd/res/drawable-xxhdpi/ic_action_bus2.png new file mode 100644 index 0000000000..78ee74d36d Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/ic_action_bus2.png differ diff --git a/OsmAnd/res/drawable-xxhdpi/ic_action_fav2.png b/OsmAnd/res/drawable-xxhdpi/ic_action_fav2.png new file mode 100644 index 0000000000..f8ef5ba418 Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/ic_action_fav2.png differ diff --git a/OsmAnd/res/drawable-xxhdpi/ic_action_history2.png b/OsmAnd/res/drawable-xxhdpi/ic_action_history2.png new file mode 100644 index 0000000000..72179cc54b Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/ic_action_history2.png differ diff --git a/OsmAnd/res/drawable-xxhdpi/ic_action_home2.png b/OsmAnd/res/drawable-xxhdpi/ic_action_home2.png new file mode 100644 index 0000000000..e38f14f71c Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/ic_action_home2.png differ diff --git a/OsmAnd/res/drawable-xxhdpi/ic_action_info2.png b/OsmAnd/res/drawable-xxhdpi/ic_action_info2.png new file mode 100644 index 0000000000..459af1e152 Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/ic_action_info2.png differ diff --git a/OsmAnd/res/drawable-xxhdpi/ic_action_marker2.png b/OsmAnd/res/drawable-xxhdpi/ic_action_marker2.png new file mode 100644 index 0000000000..acdda2ad51 Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/ic_action_marker2.png differ diff --git a/OsmAnd/res/drawable-xxhdpi/ic_download_cancel_normal.png b/OsmAnd/res/drawable-xxhdpi/ic_download_cancel_normal.png new file mode 100644 index 0000000000..b63b4024d6 Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/ic_download_cancel_normal.png differ diff --git a/OsmAnd/res/drawable-xxhdpi/ic_download_cancel_tap.png b/OsmAnd/res/drawable-xxhdpi/ic_download_cancel_tap.png new file mode 100644 index 0000000000..265c75b89b Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/ic_download_cancel_tap.png differ diff --git a/OsmAnd/res/drawable-xxhdpi/ic_download_normal.png b/OsmAnd/res/drawable-xxhdpi/ic_download_normal.png new file mode 100644 index 0000000000..e726fdf777 Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/ic_download_normal.png differ diff --git a/OsmAnd/res/drawable-xxhdpi/ic_download_tap.png b/OsmAnd/res/drawable-xxhdpi/ic_download_tap.png new file mode 100644 index 0000000000..2e5bd278ca Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/ic_download_tap.png differ diff --git a/OsmAnd/res/drawable/cancel_button.xml b/OsmAnd/res/drawable/cancel_button.xml new file mode 100644 index 0000000000..3211e6e6cd --- /dev/null +++ b/OsmAnd/res/drawable/cancel_button.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/OsmAnd/res/drawable/dashboard_button.xml b/OsmAnd/res/drawable/dashboard_button.xml new file mode 100644 index 0000000000..8095342d73 --- /dev/null +++ b/OsmAnd/res/drawable/dashboard_button.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/OsmAnd/res/drawable/download_button.xml b/OsmAnd/res/drawable/download_button.xml new file mode 100644 index 0000000000..45ac3cb02a --- /dev/null +++ b/OsmAnd/res/drawable/download_button.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/OsmAnd/res/layout-land/dash_search_fragment.xml b/OsmAnd/res/layout-land/dash_search_fragment.xml new file mode 100644 index 0000000000..27a14f2e74 --- /dev/null +++ b/OsmAnd/res/layout-land/dash_search_fragment.xml @@ -0,0 +1,89 @@ + + + + + + + + + +