Fix turn types

This commit is contained in:
Victor Shcherb 2016-04-14 10:11:53 +02:00
parent 26faa0c73e
commit c6336eed2a
2 changed files with 10 additions and 8 deletions

View file

@ -417,15 +417,14 @@ public class TurnPathHelper {
if (turnIndex == FIRST_TURN) {
if (secondTurnType == 0) {
turnResource = getTallArrow(firstTurnType);
} else if (secondTurnType != TurnType.C) {
} else if (secondTurnType == TurnType.C || thirdTurnType == TurnType.C) {
turnResource = getShortArrow(firstTurnType);
} else {
if (firstTurnType == TurnType.TU || firstTurnType == TurnType.TRU) {
turnResource = getShortArrow(firstTurnType);
} else {
turnResource = getTallArrow(firstTurnType);
}
} else {
// get the small one
turnResource = getShortArrow(firstTurnType);
}
} else if (turnIndex == SECOND_TURN) {
if (TurnType.isLeftTurn(firstTurnType) && TurnType.isLeftTurn(secondTurnType)) {
@ -444,7 +443,7 @@ public class TurnPathHelper {
} else if ((TurnType.isRightTurn(firstTurnType) || TurnType.isRightTurn(secondTurnType)) && TurnType.isRightTurn(thirdTurnType)) {
turnResource = null;
} else {
turnResource = getShortArrow(secondTurnType);
turnResource = getShortArrow(thirdTurnType);
}
}
if (turnResource == null) {

View file

@ -705,7 +705,8 @@ public class RouteInfoWidgetsFactory {
float coef = scaleCoefficient / miniCoeff;
if(thirdTurnType > 0){
Bitmap bSecond = null;
bSecond = TurnPathHelper.getBitmapFromTurnType(ctx.getResources(), bitmapCache, turnType, secondTurnType, thirdTurnType, TurnPathHelper.THIRD_TURN, coef, leftSide);
bSecond = TurnPathHelper.getBitmapFromTurnType(ctx.getResources(), bitmapCache, turnType,
secondTurnType, thirdTurnType, TurnPathHelper.THIRD_TURN, coef, leftSide);
if (bSecond != null){
paintSecondTurn.setColorFilter(new PorterDuffColorFilter(paintSecondTurn.getColor(), PorterDuff.Mode.SRC_ATOP));
canvas.drawBitmap(bSecond, 0f, 0f, paintSecondTurn);
@ -713,13 +714,15 @@ public class RouteInfoWidgetsFactory {
}
if(secondTurnType > 0){
Bitmap bSecond = null;
bSecond = TurnPathHelper.getBitmapFromTurnType(ctx.getResources(), bitmapCache, turnType, secondTurnType, thirdTurnType, TurnPathHelper.SECOND_TURN, coef, leftSide);
bSecond = TurnPathHelper.getBitmapFromTurnType(ctx.getResources(), bitmapCache, turnType,
secondTurnType, thirdTurnType, TurnPathHelper.SECOND_TURN, coef, leftSide);
if (bSecond != null){
paintSecondTurn.setColorFilter(new PorterDuffColorFilter(paintSecondTurn.getColor(), PorterDuff.Mode.SRC_ATOP));
canvas.drawBitmap(bSecond, 0f, 0f, paintSecondTurn);
}
}
Bitmap b = TurnPathHelper.getBitmapFromTurnType(ctx.getResources(), bitmapCache, turnType, secondTurnType, thirdTurnType, TurnPathHelper.FIRST_TURN, coef, leftSide);
Bitmap b = TurnPathHelper.getBitmapFromTurnType(ctx.getResources(), bitmapCache, turnType,
secondTurnType, thirdTurnType, TurnPathHelper.FIRST_TURN, coef, leftSide);
if(b != null) {
paintRouteDirection.setColorFilter(new PorterDuffColorFilter(paintRouteDirection.getColor(), PorterDuff.Mode.SRC_ATOP));
canvas.drawBitmap(b, 0f, 0f, paintRouteDirection);