diff --git a/OsmAnd-java/src/net/osmand/router/TurnType.java b/OsmAnd-java/src/net/osmand/router/TurnType.java index ada4a472dc..7e01406590 100644 --- a/OsmAnd-java/src/net/osmand/router/TurnType.java +++ b/OsmAnd-java/src/net/osmand/router/TurnType.java @@ -158,6 +158,7 @@ public class TurnType { // 0 bit - 0/1 - to use or not // 1-5 bits - additional turn info // 6-10 bits - secondary turn + // 11-15 bits - tertiary turn public void setLanes(int[] lanes) { this.lanes = lanes; } @@ -183,6 +184,16 @@ public class TurnType { return (laneValue >> 5); } + public static void setTertiaryTurn(int[] lanes, int lane, int turnType) { + lanes[lane] &= ~(15 << 10); + lanes[lane] |= (turnType << 10); + } + + public static int getTertiaryTurn(int laneValue) { + // Get the primary turn modifier for the lane + return (laneValue >> 10); + } + public int[] getLanes() { return lanes; diff --git a/OsmAnd/res/drawable-hdpi/map_turn_forward_keep_right.png b/OsmAnd/res/drawable-hdpi/map_turn_forward_keep_right.png new file mode 100644 index 0000000000..930a6ed29a Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/map_turn_forward_keep_right.png differ diff --git a/OsmAnd/res/drawable-hdpi/map_turn_forward_keep_right_small.png b/OsmAnd/res/drawable-hdpi/map_turn_forward_keep_right_small.png new file mode 100644 index 0000000000..4f061a8f65 Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/map_turn_forward_keep_right_small.png differ diff --git a/OsmAnd/res/drawable-hdpi/map_turn_forward_turn_sharp.png b/OsmAnd/res/drawable-hdpi/map_turn_forward_turn_sharp.png new file mode 100644 index 0000000000..08cc5042a7 Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/map_turn_forward_turn_sharp.png differ diff --git a/OsmAnd/res/drawable-hdpi/map_turn_forward_turn_sharp_small.png b/OsmAnd/res/drawable-hdpi/map_turn_forward_turn_sharp_small.png new file mode 100644 index 0000000000..4d2072a5dd Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/map_turn_forward_turn_sharp_small.png differ diff --git a/OsmAnd/res/drawable-hdpi/map_turn_keep_right.png b/OsmAnd/res/drawable-hdpi/map_turn_keep_right.png new file mode 100644 index 0000000000..53bf1bbd5a Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/map_turn_keep_right.png differ diff --git a/OsmAnd/res/drawable-hdpi/map_turn_keep_right_small.png b/OsmAnd/res/drawable-hdpi/map_turn_keep_right_small.png new file mode 100644 index 0000000000..4628fa7a9b Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/map_turn_keep_right_small.png differ diff --git a/OsmAnd/res/drawable-hdpi/map_turn_sharp_right.png b/OsmAnd/res/drawable-hdpi/map_turn_sharp_right.png new file mode 100644 index 0000000000..c2bb82a6cf Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/map_turn_sharp_right.png differ diff --git a/OsmAnd/res/drawable-hdpi/map_turn_sharp_right_small.png b/OsmAnd/res/drawable-hdpi/map_turn_sharp_right_small.png new file mode 100644 index 0000000000..0bd7e71845 Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/map_turn_sharp_right_small.png differ diff --git a/OsmAnd/res/drawable-mdpi/map_turn_forward_keep_right.png b/OsmAnd/res/drawable-mdpi/map_turn_forward_keep_right.png new file mode 100644 index 0000000000..a2a0f3d7b8 Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/map_turn_forward_keep_right.png differ diff --git a/OsmAnd/res/drawable-mdpi/map_turn_forward_keep_right_small.png b/OsmAnd/res/drawable-mdpi/map_turn_forward_keep_right_small.png new file mode 100644 index 0000000000..8a339f920c Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/map_turn_forward_keep_right_small.png differ diff --git a/OsmAnd/res/drawable-mdpi/map_turn_forward_turn_sharp.png b/OsmAnd/res/drawable-mdpi/map_turn_forward_turn_sharp.png new file mode 100644 index 0000000000..1f11c2004f Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/map_turn_forward_turn_sharp.png differ diff --git a/OsmAnd/res/drawable-mdpi/map_turn_forward_turn_sharp_small.png b/OsmAnd/res/drawable-mdpi/map_turn_forward_turn_sharp_small.png new file mode 100644 index 0000000000..ed6c1c4cbb Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/map_turn_forward_turn_sharp_small.png differ diff --git a/OsmAnd/res/drawable-mdpi/map_turn_keep_right.png b/OsmAnd/res/drawable-mdpi/map_turn_keep_right.png new file mode 100644 index 0000000000..6775427dd6 Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/map_turn_keep_right.png differ diff --git a/OsmAnd/res/drawable-mdpi/map_turn_keep_right_small.png b/OsmAnd/res/drawable-mdpi/map_turn_keep_right_small.png new file mode 100644 index 0000000000..e2633db319 Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/map_turn_keep_right_small.png differ diff --git a/OsmAnd/res/drawable-mdpi/map_turn_sharp_right.png b/OsmAnd/res/drawable-mdpi/map_turn_sharp_right.png new file mode 100644 index 0000000000..26a5fdeda2 Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/map_turn_sharp_right.png differ diff --git a/OsmAnd/res/drawable-mdpi/map_turn_sharp_right_small.png b/OsmAnd/res/drawable-mdpi/map_turn_sharp_right_small.png new file mode 100644 index 0000000000..dc43a0bd91 Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/map_turn_sharp_right_small.png differ diff --git a/OsmAnd/res/drawable-xhdpi/map_turn_forward_keep_right.png b/OsmAnd/res/drawable-xhdpi/map_turn_forward_keep_right.png new file mode 100644 index 0000000000..5c290d7707 Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/map_turn_forward_keep_right.png differ diff --git a/OsmAnd/res/drawable-xhdpi/map_turn_forward_keep_right_small.png b/OsmAnd/res/drawable-xhdpi/map_turn_forward_keep_right_small.png new file mode 100644 index 0000000000..38ad7adaf4 Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/map_turn_forward_keep_right_small.png differ diff --git a/OsmAnd/res/drawable-xhdpi/map_turn_forward_turn_sharp.png b/OsmAnd/res/drawable-xhdpi/map_turn_forward_turn_sharp.png new file mode 100644 index 0000000000..f3482f0c23 Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/map_turn_forward_turn_sharp.png differ diff --git a/OsmAnd/res/drawable-xhdpi/map_turn_forward_turn_sharp_small.png b/OsmAnd/res/drawable-xhdpi/map_turn_forward_turn_sharp_small.png new file mode 100644 index 0000000000..27bfb349b9 Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/map_turn_forward_turn_sharp_small.png differ diff --git a/OsmAnd/res/drawable-xhdpi/map_turn_keep_right.png b/OsmAnd/res/drawable-xhdpi/map_turn_keep_right.png new file mode 100644 index 0000000000..7277425cc1 Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/map_turn_keep_right.png differ diff --git a/OsmAnd/res/drawable-xhdpi/map_turn_keep_right_small.png b/OsmAnd/res/drawable-xhdpi/map_turn_keep_right_small.png new file mode 100644 index 0000000000..94dee37297 Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/map_turn_keep_right_small.png differ diff --git a/OsmAnd/res/drawable-xhdpi/map_turn_sharp_right.png b/OsmAnd/res/drawable-xhdpi/map_turn_sharp_right.png new file mode 100644 index 0000000000..8c8876b63f Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/map_turn_sharp_right.png differ diff --git a/OsmAnd/res/drawable-xhdpi/map_turn_sharp_right_small.png b/OsmAnd/res/drawable-xhdpi/map_turn_sharp_right_small.png new file mode 100644 index 0000000000..2628857cd5 Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/map_turn_sharp_right_small.png differ diff --git a/OsmAnd/res/drawable-xxhdpi/map_turn_forward_keep_right.png b/OsmAnd/res/drawable-xxhdpi/map_turn_forward_keep_right.png new file mode 100644 index 0000000000..b4ce1ee92f Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/map_turn_forward_keep_right.png differ diff --git a/OsmAnd/res/drawable-xxhdpi/map_turn_forward_keep_right_small.png b/OsmAnd/res/drawable-xxhdpi/map_turn_forward_keep_right_small.png new file mode 100644 index 0000000000..7ee6716151 Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/map_turn_forward_keep_right_small.png differ diff --git a/OsmAnd/res/drawable-xxhdpi/map_turn_forward_turn_sharp.png b/OsmAnd/res/drawable-xxhdpi/map_turn_forward_turn_sharp.png new file mode 100644 index 0000000000..06d941c1ba Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/map_turn_forward_turn_sharp.png differ diff --git a/OsmAnd/res/drawable-xxhdpi/map_turn_forward_turn_sharp_small.png b/OsmAnd/res/drawable-xxhdpi/map_turn_forward_turn_sharp_small.png new file mode 100644 index 0000000000..b9d34a95e5 Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/map_turn_forward_turn_sharp_small.png differ diff --git a/OsmAnd/res/drawable-xxhdpi/map_turn_keep_right.png b/OsmAnd/res/drawable-xxhdpi/map_turn_keep_right.png new file mode 100644 index 0000000000..503cf38469 Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/map_turn_keep_right.png differ diff --git a/OsmAnd/res/drawable-xxhdpi/map_turn_keep_right_small.png b/OsmAnd/res/drawable-xxhdpi/map_turn_keep_right_small.png new file mode 100644 index 0000000000..8ade02d36e Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/map_turn_keep_right_small.png differ diff --git a/OsmAnd/res/drawable-xxhdpi/map_turn_sharp_right.png b/OsmAnd/res/drawable-xxhdpi/map_turn_sharp_right.png new file mode 100644 index 0000000000..bf0582845e Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/map_turn_sharp_right.png differ diff --git a/OsmAnd/res/drawable-xxhdpi/map_turn_sharp_right_small.png b/OsmAnd/res/drawable-xxhdpi/map_turn_sharp_right_small.png new file mode 100644 index 0000000000..0e675dcb8b Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/map_turn_sharp_right_small.png differ diff --git a/OsmAnd/src/net/osmand/plus/views/TurnPathHelper.java b/OsmAnd/src/net/osmand/plus/views/TurnPathHelper.java index fbdde88cba..48afc83a83 100644 --- a/OsmAnd/src/net/osmand/plus/views/TurnPathHelper.java +++ b/OsmAnd/src/net/osmand/plus/views/TurnPathHelper.java @@ -1,18 +1,14 @@ package net.osmand.plus.views; +import android.graphics.*; import net.osmand.plus.R; import net.osmand.router.TurnType; import android.content.res.Resources; -import android.graphics.Canvas; -import android.graphics.ColorFilter; -import android.graphics.Matrix; -import android.graphics.Paint; import android.graphics.Paint.Style; -import android.graphics.Path; -import android.graphics.Rect; -import android.graphics.RectF; import android.graphics.drawable.Drawable; +import java.util.Map; + public class TurnPathHelper { // 72x72 @@ -298,4 +294,187 @@ public class TurnPathHelper { } + public static class TurnResource { + boolean flip; + int resourceId; + + public TurnResource(){} + + public TurnResource(int resourceId, boolean value) { + this.resourceId = resourceId; + this.flip = value; + } + + @Override + public boolean equals(Object o) { + return super.equals(o); + } + + @Override + public int hashCode() { + return resourceId * (flip ? -1 : 1); + } + } + + private static TurnResource getTallArrow(int tt){ + + TurnResource result = new TurnResource(); + + switch (tt){ + case TurnType.C: + result.resourceId = R.drawable.map_turn_forward_small; + break; + case TurnType.TR: + case TurnType.TL: + result.resourceId = R.drawable.map_turn_right2_small; + break; + case TurnType.KR: + case TurnType.KL: + result.resourceId = R.drawable.map_turn_keep_right_small; + break; + case TurnType.TSLR: + case TurnType.TSLL: + result.resourceId = R.drawable.map_turn_slight_right_small; + break; + case TurnType.TSHR: + case TurnType.TSHL: + result.resourceId = R.drawable.map_turn_sharp_right_small; + break; + case TurnType.TRU: + case TurnType.TU: + result.resourceId = R.drawable.map_turn_uturn_small; + break; + default: + result.resourceId = R.drawable.map_turn_forward_small; + break; + } + + if(tt == TurnType.TL || tt == TurnType.KL || tt == TurnType.TSLL + || tt == TurnType.TSHL || tt == TurnType.TU){ + result.flip = true; + } + + return result; + + } + + private static TurnResource getShortArrow(int tt){ + + TurnResource result = new TurnResource(); + + switch (tt) { + case TurnType.C: + result.resourceId = R.drawable.map_turn_forward_small; + break; + case TurnType.TR: + case TurnType.TL: + result.resourceId = R.drawable.map_turn_forward_right_turn_small; + break; + case TurnType.KR: + case TurnType.KL: + result.resourceId = R.drawable.map_turn_forward_keep_right_small; + break; + case TurnType.TSLR: + case TurnType.TSLL: + result.resourceId = R.drawable.map_turn_forward_slight_right_turn_small; + break; + case TurnType.TSHR: + case TurnType.TSHL: + result.resourceId = R.drawable.map_turn_forward_turn_sharp_small; + break; + case TurnType.TRU: + case TurnType.TU: + result.resourceId = R.drawable.map_turn_forward_uturn_right_small; + break; + default: + result.resourceId = R.drawable.map_turn_forward_small; + break; + } + + if(tt == TurnType.TL || tt == TurnType.KL || tt == TurnType.TSLL + || tt == TurnType.TSHL || tt == TurnType.TU){ + result.flip = true; + } + + return result; + + } + + public static Bitmap getBitmapFromTurnType(Resources res, Map cache, int firstTurn, int secondTurn, int thirdTurn, int turn, Bitmap defaultType, float coef, boolean leftSide) { + + int firstTurnType = TurnType.valueOf(firstTurn, leftSide).getValue(); + int secondTurnType = TurnType.valueOf(secondTurn, leftSide).getValue(); + int thirdTurnType = TurnType.valueOf(thirdTurn, leftSide).getValue(); + + TurnResource turnResource = new TurnResource(R.drawable.map_turn_forward_small, false); + + if(turn == 1){ + if(firstTurn == 0) return defaultType; + if(secondTurnType == 0) { + turnResource = getTallArrow(firstTurnType); + }else if(secondTurnType != TurnType.C){ + if(firstTurnType == TurnType.TU || firstTurnType == TurnType.TRU){ + turnResource = getShortArrow(firstTurnType); + }else { + turnResource = getTallArrow(firstTurnType); + } + }else{ + // get the small one + turnResource = getShortArrow(firstTurnType); + } + }else if(turn == 2){ + if(firstTurnType == TurnType.C){ + // get the small one + turnResource = getShortArrow(secondTurnType); + }else{ + turnResource = getTallArrow(secondTurnType); + } + }else if(turn == 3){ + if(secondTurnType == TurnType.C){ + // get the small one + turnResource = getShortArrow(thirdTurnType); + }else{ + // ? slightly turn? + } + } + + Bitmap b = cache.get(turnResource); + if(b == null) { + b = turnResource.flip ? getFlippedBitmap(res, turnResource.resourceId) : BitmapFactory.decodeResource(res, turnResource.resourceId); + cache.put(turnResource, b); + } + + //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); + */ + + 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; + } + + } diff --git a/OsmAnd/src/net/osmand/plus/views/mapwidgets/RouteInfoWidgetsFactory.java b/OsmAnd/src/net/osmand/plus/views/mapwidgets/RouteInfoWidgetsFactory.java index 29b91c300e..96ae130df2 100644 --- a/OsmAnd/src/net/osmand/plus/views/mapwidgets/RouteInfoWidgetsFactory.java +++ b/OsmAnd/src/net/osmand/plus/views/mapwidgets/RouteInfoWidgetsFactory.java @@ -1,12 +1,10 @@ package net.osmand.plus.views.mapwidgets; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; +import java.util.*; -import android.content.res.Resources; import android.graphics.*; +import android.util.ArrayMap; import net.osmand.Location; import net.osmand.binary.RouteDataObject; import net.osmand.data.LatLon; @@ -515,132 +513,6 @@ public class RouteInfoWidgetsFactory { 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; @@ -758,7 +630,7 @@ public class RouteInfoWidgetsFactory { boolean imminent = false; private Context ctx; private ArrayList paths = new ArrayList(); - private ArrayList pathBitmaps = new ArrayList(); + private Map bitmapCache = new ArrayMap(); private Paint paintBlack; private Path laneStraight; private final Bitmap laneStraightBitmap; @@ -768,12 +640,16 @@ public class RouteInfoWidgetsFactory { private int height; private int width; private static final float miniCoeff = 2f; + private final boolean leftSide; - public LanesDrawable(Context ctx, float scaleCoefficent) { + public LanesDrawable(MapActivity ctx, float scaleCoefficent) { this.ctx = ctx; + OsmandSettings settings = ctx.getMyApplication().getSettings(); + leftSide = settings.DRIVING_REGION.get().leftHandDriving; + this.scaleCoefficient = scaleCoefficent; laneStraight = getPathFromTurnType(paths, TurnType.C, null, scaleCoefficient / miniCoeff); - laneStraightBitmap = getPathBitmapFromTurnType(ctx.getResources(), pathBitmaps, TurnType.C, 0, null, scaleCoefficient / miniCoeff); + laneStraightBitmap = TurnPathHelper.getBitmapFromTurnType(ctx.getResources(), bitmapCache, TurnType.C, 0, 0, 1, null, scaleCoefficient / miniCoeff, leftSide); paintBlack = new Paint(); paintBlack.setStyle(Style.STROKE); paintBlack.setColor(Color.BLACK); @@ -827,11 +703,12 @@ public class RouteInfoWidgetsFactory { turnType = TurnType.getPrimaryTurn(lanes[i]); secondTurnType = TurnType.getSecondaryTurn(lanes[i]); - Bitmap b = getPathBitmapFromTurnType(ctx.getResources(), pathBitmaps, turnType, secondTurnType, laneStraightBitmap, scaleCoefficient / miniCoeff); + float coef = scaleCoefficient / miniCoeff; + Bitmap b = TurnPathHelper.getBitmapFromTurnType(ctx.getResources(), bitmapCache, turnType, secondTurnType, 0, 1, laneStraightBitmap, coef, leftSide); if(secondTurnType > 0){ Bitmap bSecond = null; - bSecond = getPathBitmapFromTurnType(ctx.getResources(), pathBitmaps, secondTurnType, secondTurnType, laneStraightBitmap, scaleCoefficient / miniCoeff); + bSecond = TurnPathHelper.getBitmapFromTurnType(ctx.getResources(), bitmapCache, turnType, secondTurnType, 0, 2, laneStraightBitmap, coef, leftSide); if (bSecond != null){ paintSecondTurn.setColorFilter(new PorterDuffColorFilter(paintSecondTurn.getColor(), PorterDuff.Mode.SRC_ATOP)); canvas.drawBitmap(bSecond, 0f, 0f, paintSecondTurn);