diff --git a/OsmAnd/res/drawable-hdpi/map_turn_forward.png b/OsmAnd/res/drawable-hdpi/map_turn_forward.png new file mode 100644 index 0000000000..39eff5a3ff Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/map_turn_forward.png differ diff --git a/OsmAnd/res/drawable-hdpi/map_turn_forward_right_turn.png b/OsmAnd/res/drawable-hdpi/map_turn_forward_right_turn.png new file mode 100644 index 0000000000..132513feb9 Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/map_turn_forward_right_turn.png differ diff --git a/OsmAnd/res/drawable-hdpi/map_turn_forward_right_turn_small.png b/OsmAnd/res/drawable-hdpi/map_turn_forward_right_turn_small.png new file mode 100644 index 0000000000..a8c31c4d63 Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/map_turn_forward_right_turn_small.png differ diff --git a/OsmAnd/res/drawable-hdpi/map_turn_forward_slight_right_turn.png b/OsmAnd/res/drawable-hdpi/map_turn_forward_slight_right_turn.png new file mode 100644 index 0000000000..61e2369dd5 Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/map_turn_forward_slight_right_turn.png differ diff --git a/OsmAnd/res/drawable-hdpi/map_turn_forward_slight_right_turn_small.png b/OsmAnd/res/drawable-hdpi/map_turn_forward_slight_right_turn_small.png new file mode 100644 index 0000000000..0423af6252 Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/map_turn_forward_slight_right_turn_small.png differ diff --git a/OsmAnd/res/drawable-hdpi/map_turn_forward_small.png b/OsmAnd/res/drawable-hdpi/map_turn_forward_small.png new file mode 100644 index 0000000000..4d8d5d6220 Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/map_turn_forward_small.png differ diff --git a/OsmAnd/res/drawable-hdpi/map_turn_forward_uturn_right.png b/OsmAnd/res/drawable-hdpi/map_turn_forward_uturn_right.png new file mode 100644 index 0000000000..bdb4615100 Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/map_turn_forward_uturn_right.png differ diff --git a/OsmAnd/res/drawable-hdpi/map_turn_forward_uturn_right_small.png b/OsmAnd/res/drawable-hdpi/map_turn_forward_uturn_right_small.png new file mode 100644 index 0000000000..371d917de1 Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/map_turn_forward_uturn_right_small.png differ diff --git a/OsmAnd/res/drawable-hdpi/map_turn_right.png b/OsmAnd/res/drawable-hdpi/map_turn_right.png new file mode 100644 index 0000000000..ebec78a249 Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/map_turn_right.png differ diff --git a/OsmAnd/res/drawable-hdpi/map_turn_right2.png b/OsmAnd/res/drawable-hdpi/map_turn_right2.png new file mode 100644 index 0000000000..d6430b5a27 Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/map_turn_right2.png differ diff --git a/OsmAnd/res/drawable-hdpi/map_turn_right2_small.png b/OsmAnd/res/drawable-hdpi/map_turn_right2_small.png new file mode 100644 index 0000000000..92f9a82bd0 Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/map_turn_right2_small.png differ diff --git a/OsmAnd/res/drawable-hdpi/map_turn_right_small.png b/OsmAnd/res/drawable-hdpi/map_turn_right_small.png new file mode 100644 index 0000000000..036bb98d4f Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/map_turn_right_small.png differ diff --git a/OsmAnd/res/drawable-hdpi/map_turn_slight_right.png b/OsmAnd/res/drawable-hdpi/map_turn_slight_right.png new file mode 100644 index 0000000000..9e1697651e Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/map_turn_slight_right.png differ diff --git a/OsmAnd/res/drawable-hdpi/map_turn_slight_right_small.png b/OsmAnd/res/drawable-hdpi/map_turn_slight_right_small.png new file mode 100644 index 0000000000..75bd68cc5a Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/map_turn_slight_right_small.png differ diff --git a/OsmAnd/res/drawable-hdpi/map_turn_uturn.png b/OsmAnd/res/drawable-hdpi/map_turn_uturn.png new file mode 100644 index 0000000000..7731d4de0f Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/map_turn_uturn.png differ diff --git a/OsmAnd/res/drawable-hdpi/map_turn_uturn_right.png b/OsmAnd/res/drawable-hdpi/map_turn_uturn_right.png new file mode 100644 index 0000000000..e592adb980 Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/map_turn_uturn_right.png differ diff --git a/OsmAnd/res/drawable-hdpi/map_turn_uturn_right_small.png b/OsmAnd/res/drawable-hdpi/map_turn_uturn_right_small.png new file mode 100644 index 0000000000..f7b1638d01 Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/map_turn_uturn_right_small.png differ diff --git a/OsmAnd/res/drawable-hdpi/map_turn_uturn_small.png b/OsmAnd/res/drawable-hdpi/map_turn_uturn_small.png new file mode 100644 index 0000000000..bb3725e373 Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/map_turn_uturn_small.png differ diff --git a/OsmAnd/res/drawable-mdpi/map_turn_forward.png b/OsmAnd/res/drawable-mdpi/map_turn_forward.png new file mode 100644 index 0000000000..bdf4c96ff4 Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/map_turn_forward.png differ diff --git a/OsmAnd/res/drawable-mdpi/map_turn_forward_right_turn.png b/OsmAnd/res/drawable-mdpi/map_turn_forward_right_turn.png new file mode 100644 index 0000000000..baeeca9271 Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/map_turn_forward_right_turn.png differ diff --git a/OsmAnd/res/drawable-mdpi/map_turn_forward_right_turn_small.png b/OsmAnd/res/drawable-mdpi/map_turn_forward_right_turn_small.png new file mode 100644 index 0000000000..fb3fdbefa4 Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/map_turn_forward_right_turn_small.png differ diff --git a/OsmAnd/res/drawable-mdpi/map_turn_forward_slight_right_turn.png b/OsmAnd/res/drawable-mdpi/map_turn_forward_slight_right_turn.png new file mode 100644 index 0000000000..452ecefdec Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/map_turn_forward_slight_right_turn.png differ diff --git a/OsmAnd/res/drawable-mdpi/map_turn_forward_slight_right_turn_small.png b/OsmAnd/res/drawable-mdpi/map_turn_forward_slight_right_turn_small.png new file mode 100644 index 0000000000..dfc000e52d Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/map_turn_forward_slight_right_turn_small.png differ diff --git a/OsmAnd/res/drawable-mdpi/map_turn_forward_small.png b/OsmAnd/res/drawable-mdpi/map_turn_forward_small.png new file mode 100644 index 0000000000..d70eace6b7 Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/map_turn_forward_small.png differ diff --git a/OsmAnd/res/drawable-mdpi/map_turn_forward_uturn_right.png b/OsmAnd/res/drawable-mdpi/map_turn_forward_uturn_right.png new file mode 100644 index 0000000000..c5d5f24f36 Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/map_turn_forward_uturn_right.png differ diff --git a/OsmAnd/res/drawable-mdpi/map_turn_forward_uturn_right_small.png b/OsmAnd/res/drawable-mdpi/map_turn_forward_uturn_right_small.png new file mode 100644 index 0000000000..a2a5cfff46 Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/map_turn_forward_uturn_right_small.png differ diff --git a/OsmAnd/res/drawable-mdpi/map_turn_right.png b/OsmAnd/res/drawable-mdpi/map_turn_right.png new file mode 100644 index 0000000000..cf5e5f0243 Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/map_turn_right.png differ diff --git a/OsmAnd/res/drawable-mdpi/map_turn_right2.png b/OsmAnd/res/drawable-mdpi/map_turn_right2.png new file mode 100644 index 0000000000..594b8c6b8b Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/map_turn_right2.png differ diff --git a/OsmAnd/res/drawable-mdpi/map_turn_right2_small.png b/OsmAnd/res/drawable-mdpi/map_turn_right2_small.png new file mode 100644 index 0000000000..56f5cb01cc Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/map_turn_right2_small.png differ diff --git a/OsmAnd/res/drawable-mdpi/map_turn_right_small.png b/OsmAnd/res/drawable-mdpi/map_turn_right_small.png new file mode 100644 index 0000000000..6a70faf237 Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/map_turn_right_small.png differ diff --git a/OsmAnd/res/drawable-mdpi/map_turn_slight_right.png b/OsmAnd/res/drawable-mdpi/map_turn_slight_right.png new file mode 100644 index 0000000000..45db48c507 Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/map_turn_slight_right.png differ diff --git a/OsmAnd/res/drawable-mdpi/map_turn_slight_right_small.png b/OsmAnd/res/drawable-mdpi/map_turn_slight_right_small.png new file mode 100644 index 0000000000..ce5e3a6992 Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/map_turn_slight_right_small.png differ diff --git a/OsmAnd/res/drawable-mdpi/map_turn_uturn.png b/OsmAnd/res/drawable-mdpi/map_turn_uturn.png new file mode 100644 index 0000000000..e8f4a529e2 Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/map_turn_uturn.png differ diff --git a/OsmAnd/res/drawable-mdpi/map_turn_uturn_right.png b/OsmAnd/res/drawable-mdpi/map_turn_uturn_right.png new file mode 100644 index 0000000000..c1e4ddc1d4 Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/map_turn_uturn_right.png differ diff --git a/OsmAnd/res/drawable-mdpi/map_turn_uturn_right_small.png b/OsmAnd/res/drawable-mdpi/map_turn_uturn_right_small.png new file mode 100644 index 0000000000..252fde0150 Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/map_turn_uturn_right_small.png differ diff --git a/OsmAnd/res/drawable-mdpi/map_turn_uturn_small.png b/OsmAnd/res/drawable-mdpi/map_turn_uturn_small.png new file mode 100644 index 0000000000..badcad0df2 Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/map_turn_uturn_small.png differ diff --git a/OsmAnd/res/drawable-xhdpi/map_turn_forward.png b/OsmAnd/res/drawable-xhdpi/map_turn_forward.png new file mode 100644 index 0000000000..0a222d0a11 Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/map_turn_forward.png differ diff --git a/OsmAnd/res/drawable-xhdpi/map_turn_forward_right_turn.png b/OsmAnd/res/drawable-xhdpi/map_turn_forward_right_turn.png new file mode 100644 index 0000000000..7756a121f4 Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/map_turn_forward_right_turn.png differ diff --git a/OsmAnd/res/drawable-xhdpi/map_turn_forward_right_turn_small.png b/OsmAnd/res/drawable-xhdpi/map_turn_forward_right_turn_small.png new file mode 100644 index 0000000000..1b90789e77 Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/map_turn_forward_right_turn_small.png differ diff --git a/OsmAnd/res/drawable-xhdpi/map_turn_forward_slight_right_turn.png b/OsmAnd/res/drawable-xhdpi/map_turn_forward_slight_right_turn.png new file mode 100644 index 0000000000..97de9a60fe Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/map_turn_forward_slight_right_turn.png differ diff --git a/OsmAnd/res/drawable-xhdpi/map_turn_forward_slight_right_turn_small.png b/OsmAnd/res/drawable-xhdpi/map_turn_forward_slight_right_turn_small.png new file mode 100644 index 0000000000..81a4cbfa68 Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/map_turn_forward_slight_right_turn_small.png differ diff --git a/OsmAnd/res/drawable-xhdpi/map_turn_forward_small.png b/OsmAnd/res/drawable-xhdpi/map_turn_forward_small.png new file mode 100644 index 0000000000..b014067f03 Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/map_turn_forward_small.png differ diff --git a/OsmAnd/res/drawable-xhdpi/map_turn_forward_uturn_right.png b/OsmAnd/res/drawable-xhdpi/map_turn_forward_uturn_right.png new file mode 100644 index 0000000000..d259fdbe3d Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/map_turn_forward_uturn_right.png differ diff --git a/OsmAnd/res/drawable-xhdpi/map_turn_forward_uturn_right_small.png b/OsmAnd/res/drawable-xhdpi/map_turn_forward_uturn_right_small.png new file mode 100644 index 0000000000..a65c919bd2 Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/map_turn_forward_uturn_right_small.png differ diff --git a/OsmAnd/res/drawable-xhdpi/map_turn_right.png b/OsmAnd/res/drawable-xhdpi/map_turn_right.png new file mode 100644 index 0000000000..84b2fe9948 Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/map_turn_right.png differ diff --git a/OsmAnd/res/drawable-xhdpi/map_turn_right2.png b/OsmAnd/res/drawable-xhdpi/map_turn_right2.png new file mode 100644 index 0000000000..28faea75f1 Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/map_turn_right2.png differ diff --git a/OsmAnd/res/drawable-xhdpi/map_turn_right2_small.png b/OsmAnd/res/drawable-xhdpi/map_turn_right2_small.png new file mode 100644 index 0000000000..d8de267510 Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/map_turn_right2_small.png differ diff --git a/OsmAnd/res/drawable-xhdpi/map_turn_right_small.png b/OsmAnd/res/drawable-xhdpi/map_turn_right_small.png new file mode 100644 index 0000000000..a05a592788 Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/map_turn_right_small.png differ diff --git a/OsmAnd/res/drawable-xhdpi/map_turn_slight_right.png b/OsmAnd/res/drawable-xhdpi/map_turn_slight_right.png new file mode 100644 index 0000000000..ca38c26726 Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/map_turn_slight_right.png differ diff --git a/OsmAnd/res/drawable-xhdpi/map_turn_slight_right_small.png b/OsmAnd/res/drawable-xhdpi/map_turn_slight_right_small.png new file mode 100644 index 0000000000..a00bd7cbca Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/map_turn_slight_right_small.png differ diff --git a/OsmAnd/res/drawable-xhdpi/map_turn_uturn.png b/OsmAnd/res/drawable-xhdpi/map_turn_uturn.png new file mode 100644 index 0000000000..0f758155e0 Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/map_turn_uturn.png differ diff --git a/OsmAnd/res/drawable-xhdpi/map_turn_uturn_right.png b/OsmAnd/res/drawable-xhdpi/map_turn_uturn_right.png new file mode 100644 index 0000000000..0870146a93 Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/map_turn_uturn_right.png differ diff --git a/OsmAnd/res/drawable-xhdpi/map_turn_uturn_right_small.png b/OsmAnd/res/drawable-xhdpi/map_turn_uturn_right_small.png new file mode 100644 index 0000000000..daad2b4386 Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/map_turn_uturn_right_small.png differ diff --git a/OsmAnd/res/drawable-xhdpi/map_turn_uturn_small.png b/OsmAnd/res/drawable-xhdpi/map_turn_uturn_small.png new file mode 100644 index 0000000000..c3e50eca92 Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/map_turn_uturn_small.png differ diff --git a/OsmAnd/res/drawable-xxhdpi/map_turn_forward.png b/OsmAnd/res/drawable-xxhdpi/map_turn_forward.png new file mode 100644 index 0000000000..c1015b73dd Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/map_turn_forward.png differ diff --git a/OsmAnd/res/drawable-xxhdpi/map_turn_forward_right_turn.png b/OsmAnd/res/drawable-xxhdpi/map_turn_forward_right_turn.png new file mode 100644 index 0000000000..0435ded215 Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/map_turn_forward_right_turn.png differ diff --git a/OsmAnd/res/drawable-xxhdpi/map_turn_forward_right_turn_small.png b/OsmAnd/res/drawable-xxhdpi/map_turn_forward_right_turn_small.png new file mode 100644 index 0000000000..a744e9f595 Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/map_turn_forward_right_turn_small.png differ diff --git a/OsmAnd/res/drawable-xxhdpi/map_turn_forward_slight_right_turn.png b/OsmAnd/res/drawable-xxhdpi/map_turn_forward_slight_right_turn.png new file mode 100644 index 0000000000..9ecc92c619 Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/map_turn_forward_slight_right_turn.png differ diff --git a/OsmAnd/res/drawable-xxhdpi/map_turn_forward_slight_right_turn_small.png b/OsmAnd/res/drawable-xxhdpi/map_turn_forward_slight_right_turn_small.png new file mode 100644 index 0000000000..a44916e491 Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/map_turn_forward_slight_right_turn_small.png differ diff --git a/OsmAnd/res/drawable-xxhdpi/map_turn_forward_small.png b/OsmAnd/res/drawable-xxhdpi/map_turn_forward_small.png new file mode 100644 index 0000000000..dafb941c83 Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/map_turn_forward_small.png differ diff --git a/OsmAnd/res/drawable-xxhdpi/map_turn_forward_uturn_right.png b/OsmAnd/res/drawable-xxhdpi/map_turn_forward_uturn_right.png new file mode 100644 index 0000000000..62fc53f569 Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/map_turn_forward_uturn_right.png differ diff --git a/OsmAnd/res/drawable-xxhdpi/map_turn_forward_uturn_right_small.png b/OsmAnd/res/drawable-xxhdpi/map_turn_forward_uturn_right_small.png new file mode 100644 index 0000000000..ace2fed237 Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/map_turn_forward_uturn_right_small.png differ diff --git a/OsmAnd/res/drawable-xxhdpi/map_turn_right.png b/OsmAnd/res/drawable-xxhdpi/map_turn_right.png new file mode 100644 index 0000000000..2a7f0fff53 Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/map_turn_right.png differ diff --git a/OsmAnd/res/drawable-xxhdpi/map_turn_right2.png b/OsmAnd/res/drawable-xxhdpi/map_turn_right2.png new file mode 100644 index 0000000000..87a839262d Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/map_turn_right2.png differ diff --git a/OsmAnd/res/drawable-xxhdpi/map_turn_right2_small.png b/OsmAnd/res/drawable-xxhdpi/map_turn_right2_small.png new file mode 100644 index 0000000000..832135fc13 Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/map_turn_right2_small.png differ diff --git a/OsmAnd/res/drawable-xxhdpi/map_turn_right_small.png b/OsmAnd/res/drawable-xxhdpi/map_turn_right_small.png new file mode 100644 index 0000000000..43af5e43a2 Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/map_turn_right_small.png differ diff --git a/OsmAnd/res/drawable-xxhdpi/map_turn_slight_right.png b/OsmAnd/res/drawable-xxhdpi/map_turn_slight_right.png new file mode 100644 index 0000000000..357ed538b8 Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/map_turn_slight_right.png differ diff --git a/OsmAnd/res/drawable-xxhdpi/map_turn_slight_right_small.png b/OsmAnd/res/drawable-xxhdpi/map_turn_slight_right_small.png new file mode 100644 index 0000000000..60f4fee398 Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/map_turn_slight_right_small.png differ diff --git a/OsmAnd/res/drawable-xxhdpi/map_turn_uturn.png b/OsmAnd/res/drawable-xxhdpi/map_turn_uturn.png new file mode 100644 index 0000000000..c645cb9158 Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/map_turn_uturn.png differ diff --git a/OsmAnd/res/drawable-xxhdpi/map_turn_uturn_right.png b/OsmAnd/res/drawable-xxhdpi/map_turn_uturn_right.png new file mode 100644 index 0000000000..018ce214e6 Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/map_turn_uturn_right.png differ diff --git a/OsmAnd/res/drawable-xxhdpi/map_turn_uturn_right_small.png b/OsmAnd/res/drawable-xxhdpi/map_turn_uturn_right_small.png new file mode 100644 index 0000000000..5429bc0dcf Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/map_turn_uturn_right_small.png differ diff --git a/OsmAnd/res/drawable-xxhdpi/map_turn_uturn_small.png b/OsmAnd/res/drawable-xxhdpi/map_turn_uturn_small.png new file mode 100644 index 0000000000..41e2bf50c9 Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/map_turn_uturn_small.png differ diff --git a/OsmAnd/src/net/osmand/plus/views/mapwidgets/RouteInfoWidgetsFactory.java b/OsmAnd/src/net/osmand/plus/views/mapwidgets/RouteInfoWidgetsFactory.java index c34e4207b4..29b91c300e 100644 --- a/OsmAnd/src/net/osmand/plus/views/mapwidgets/RouteInfoWidgetsFactory.java +++ b/OsmAnd/src/net/osmand/plus/views/mapwidgets/RouteInfoWidgetsFactory.java @@ -5,6 +5,8 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import android.content.res.Resources; +import android.graphics.*; import net.osmand.Location; import net.osmand.binary.RouteDataObject; import net.osmand.data.LatLon; @@ -37,13 +39,7 @@ import net.osmand.util.Algorithms; import net.osmand.util.MapUtils; import android.app.Activity; import android.content.Context; -import android.graphics.Canvas; -import android.graphics.Color; -import android.graphics.ColorFilter; -import android.graphics.Matrix; -import android.graphics.Paint; import android.graphics.Paint.Style; -import android.graphics.Path; import android.graphics.drawable.Drawable; import android.text.format.DateFormat; import android.view.View; @@ -518,7 +514,134 @@ public class RouteInfoWidgetsFactory { paths.set(laneType, p); return p; } - + + private static Bitmap getPathBitmapFromTurnType(Resources res, List paths, int laneType, int secondTurnType, Bitmap defaultType, float coef) { + if(laneType == 0) { + return defaultType; + } + /*while (paths.size() <= laneType) { + paths.add(null); + } + + if(secondTurnType == 0) { + Bitmap b = paths.get(laneType); + if (b != null) { + return b; + } + }*/ + + boolean flip = false; + + int turnResourceId = R.drawable.map_turn_right; + if(secondTurnType == 0){ + TurnType tp = TurnType.valueOf(laneType, false); + switch (tp.getValue()){ + case TurnType.C: + turnResourceId = R.drawable.map_turn_forward; + break; + case TurnType.TR: + turnResourceId = R.drawable.map_turn_right; + break; + case TurnType.TL: + turnResourceId = R.drawable.map_turn_right; + flip = true; + break; + case TurnType.KR: + turnResourceId = R.drawable.map_turn_right; + break; + case TurnType.KL: + turnResourceId = R.drawable.map_turn_right; + flip = true; + break; + case TurnType.TSLR: + turnResourceId = R.drawable.map_turn_slight_right; + break; + case TurnType.TSLL: + turnResourceId = R.drawable.map_turn_slight_right; + flip = true; + break; + case TurnType.TRU: + turnResourceId = R.drawable.map_turn_uturn_right; + break; + case TurnType.TU: + turnResourceId = R.drawable.map_turn_uturn; + flip = true; + break; + } + }else{ + TurnType tp = TurnType.valueOf(laneType, false); + switch (tp.getValue()) { + case TurnType.C: + turnResourceId = R.drawable.map_turn_forward; + break; + case TurnType.TR: + turnResourceId = R.drawable.map_turn_forward_right_turn; + break; + case TurnType.TL: + turnResourceId = R.drawable.map_turn_forward_right_turn; + flip = true; + break; + case TurnType.KR: + turnResourceId = R.drawable.map_turn_forward_slight_right_turn; + break; + case TurnType.KL: + turnResourceId = R.drawable.map_turn_forward_slight_right_turn; + flip = true; + break; + case TurnType.TSLR: + turnResourceId = R.drawable.map_turn_forward_slight_right_turn; + break; + case TurnType.TSLL: + turnResourceId = R.drawable.map_turn_forward_slight_right_turn; + flip = true; + break; + case TurnType.TRU: + turnResourceId = R.drawable.map_turn_forward_uturn_right; + break; + case TurnType.TU: + turnResourceId = R.drawable.map_turn_forward_uturn_right; + flip = true; + break; + default: + turnResourceId = R.drawable.map_turn_forward_right_turn; + break; + } + + } + + Bitmap b = flip ? getFlippedBitmap(res, turnResourceId) : BitmapFactory.decodeResource(res, turnResourceId); + + //Maybe redundant scaling + float bRatio = (float)b.getWidth() / (float)b.getHeight(); + float s = 72f * coef; + int wq = Math.round(s / bRatio); + int hq = Math.round(s); + b = Bitmap.createScaledBitmap(b, wq, hq, false); + + //paths.set(laneType, b); + return b; + } + + public static Bitmap getFlippedBitmap(Resources res, int resId){ + + BitmapFactory.Options opt = new BitmapFactory.Options(); + opt.inJustDecodeBounds = true; + //Below line is necessary to fill in opt.outWidth, opt.outHeight + Bitmap b = BitmapFactory.decodeResource(res, resId, opt); + + b = Bitmap.createBitmap(opt.outWidth, opt.outHeight, Bitmap.Config.ARGB_8888); + Canvas canvas = new Canvas(b); + + Matrix flipHorizontalMatrix = new Matrix(); + flipHorizontalMatrix.setScale(-1, 1); + flipHorizontalMatrix.postTranslate(b.getWidth(), 0); + + Bitmap bb = BitmapFactory.decodeResource(res, resId); + canvas.drawBitmap(bb, flipHorizontalMatrix, null); + + return b; + } + public static class LanesControl { private MapViewTrackingUtilities trackingUtilities; private OsmAndLocationProvider locationProvider; @@ -631,32 +754,40 @@ public class RouteInfoWidgetsFactory { private static class LanesDrawable extends Drawable { - int[] lanes = null; + int[] lanes = null; boolean imminent = false; private Context ctx; private ArrayList paths = new ArrayList(); + private ArrayList pathBitmaps = new ArrayList(); private Paint paintBlack; private Path laneStraight; + private final Bitmap laneStraightBitmap; private Paint paintRouteDirection; + private Paint paintSecondTurn; private float scaleCoefficient; private int height; private int width; private static final float miniCoeff = 2f; - + public LanesDrawable(Context ctx, float scaleCoefficent) { this.ctx = ctx; this.scaleCoefficient = scaleCoefficent; laneStraight = getPathFromTurnType(paths, TurnType.C, null, scaleCoefficient / miniCoeff); + laneStraightBitmap = getPathBitmapFromTurnType(ctx.getResources(), pathBitmaps, TurnType.C, 0, null, scaleCoefficient / miniCoeff); paintBlack = new Paint(); paintBlack.setStyle(Style.STROKE); paintBlack.setColor(Color.BLACK); paintBlack.setAntiAlias(true); paintBlack.setStrokeWidth(2.5f); - paintRouteDirection = new Paint(); - paintRouteDirection.setStyle(Style.FILL); + paintRouteDirection = new Paint(Paint.ANTI_ALIAS_FLAG); + paintRouteDirection.setStyle(Style.FILL_AND_STROKE); paintRouteDirection.setColor(ctx.getResources().getColor(R.color.nav_arrow)); - paintRouteDirection.setAntiAlias(true); + + paintSecondTurn = new Paint(Paint.ANTI_ALIAS_FLAG); + paintSecondTurn.setStyle(Style.FILL_AND_STROKE); + paintSecondTurn.setColor(ctx.getResources().getColor(R.color.nav_arrow_distant)); + } public void updateBounds() { @@ -676,8 +807,48 @@ public class RouteInfoWidgetsFactory { return width; } + @Override public void draw(Canvas canvas) { + float w = 72 * scaleCoefficient / miniCoeff; + //to change color immediately when needed + if (lanes != null && lanes.length > 0) { + canvas.save(); + // canvas.translate((int) (16 * scaleCoefficient), 0); + for (int i = 0; i < lanes.length; i++) { + int turnType; + int secondTurnType; + if ((lanes[i] & 1) == 1) { + paintRouteDirection.setColor(imminent ? ctx.getResources().getColor(R.color.nav_arrow_imminent) : + ctx.getResources().getColor(R.color.nav_arrow)); + } else { + paintRouteDirection.setColor(ctx.getResources().getColor(R.color.nav_arrow_distant)); + } + turnType = TurnType.getPrimaryTurn(lanes[i]); + secondTurnType = TurnType.getSecondaryTurn(lanes[i]); + + Bitmap b = getPathBitmapFromTurnType(ctx.getResources(), pathBitmaps, turnType, secondTurnType, laneStraightBitmap, scaleCoefficient / miniCoeff); + + if(secondTurnType > 0){ + Bitmap bSecond = null; + bSecond = getPathBitmapFromTurnType(ctx.getResources(), pathBitmaps, secondTurnType, secondTurnType, laneStraightBitmap, scaleCoefficient / miniCoeff); + if (bSecond != null){ + paintSecondTurn.setColorFilter(new PorterDuffColorFilter(paintSecondTurn.getColor(), PorterDuff.Mode.SRC_ATOP)); + canvas.drawBitmap(bSecond, 0f, 0f, paintSecondTurn); + } + } + + paintRouteDirection.setColorFilter(new PorterDuffColorFilter(paintRouteDirection.getColor(), PorterDuff.Mode.SRC_ATOP)); + canvas.drawBitmap(b, 0f, 0f, paintRouteDirection); + canvas.translate(w, 0); + } + canvas.restore(); + } + + } + + //@Override + public void drawOld(Canvas canvas) { float w = 72 * scaleCoefficient / miniCoeff; //to change color immediately when needed if (lanes != null && lanes.length > 0) { diff --git a/build.gradle b/build.gradle index 73a4bc4761..63e64403d1 100644 --- a/build.gradle +++ b/build.gradle @@ -3,7 +3,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:1.1.0' + classpath 'com.android.tools.build:gradle:1.1.3' } }