Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Marchuk <trashkalmar@users.noreply.github.com>2015-10-13 13:49:43 +0300
committerAlexander Marchuk <trashkalmar@users.noreply.github.com>2015-10-13 13:49:43 +0300
commit8cd5d711abc7731cd40e2e20903e39b20c313cf7 (patch)
tree1e4dfbc62328882e5f6c9095ea43ece1344bc8c4 /android/src/com
parent90bdab4e6b095bbc8a445cea52417250cc9af7cb (diff)
parenta8e4722ad2ba75891dfa7a0b0196475394eded52 (diff)
Merge pull request #220 from yunikkk/routing_exit_numandroid-release-514
[android] Show exit num.
Diffstat (limited to 'android/src/com')
-rw-r--r--android/src/com/mapswithme/maps/routing/RoutingInfo.java5
-rw-r--r--android/src/com/mapswithme/maps/widget/RoutingLayout.java9
2 files changed, 13 insertions, 1 deletions
diff --git a/android/src/com/mapswithme/maps/routing/RoutingInfo.java b/android/src/com/mapswithme/maps/routing/RoutingInfo.java
index 1fbdfbe50f..10ff9f1424 100644
--- a/android/src/com/mapswithme/maps/routing/RoutingInfo.java
+++ b/android/src/com/mapswithme/maps/routing/RoutingInfo.java
@@ -98,6 +98,11 @@ public class RoutingInfo
{
return turn == TURN_RIGHT || turn == TURN_SHARP_RIGHT || turn == TURN_SLIGHT_RIGHT;
}
+
+ public static boolean isRoundAbout(VehicleTurnDirection turn)
+ {
+ return turn == ENTER_ROUND_ABOUT || turn == LEAVE_ROUND_ABOUT || turn == STAY_ON_ROUND_ABOUT;
+ }
}
public enum PedestrianTurnDirection
diff --git a/android/src/com/mapswithme/maps/widget/RoutingLayout.java b/android/src/com/mapswithme/maps/widget/RoutingLayout.java
index bb2074338a..c0874ddeed 100644
--- a/android/src/com/mapswithme/maps/widget/RoutingLayout.java
+++ b/android/src/com/mapswithme/maps/widget/RoutingLayout.java
@@ -48,6 +48,7 @@ public class RoutingLayout extends RelativeLayout implements View.OnClickListene
private TextView mTvTotalDistance;
private TextView mTvTotalTime;
private ImageView mIvTurn;
+ private TextView mTvExitNum;
private View mNextTurn;
private ImageView mIvNextTurn;
private TextView mTvTurnDistance;
@@ -145,6 +146,7 @@ public class RoutingLayout extends RelativeLayout implements View.OnClickListene
mTvTotalTime = (TextView) mLayoutTurnInstructions.findViewById(R.id.tv__total_time);
mTvArrivalTime = (TextView) mLayoutTurnInstructions.findViewById(R.id.tv__arrival_time);
mIvTurn = (ImageView) mLayoutTurnInstructions.findViewById(R.id.iv__turn);
+ mTvExitNum = (TextView) mLayoutTurnInstructions.findViewById(R.id.tv__exit_num);
mNextTurn = findViewById(R.id.next_turn);
mIvNextTurn = (ImageView) mNextTurn.findViewById(R.id.iv__next_turn);
mTvTurnDistance = (TextView) mLayoutTurnInstructions.findViewById(R.id.tv__turn_distance);
@@ -205,7 +207,7 @@ public class RoutingLayout extends RelativeLayout implements View.OnClickListene
UiUtils.disappearSlidingUp(this, null);
else
UiUtils.hide(this);
- UiUtils.hide(mBtnStart);
+ UiUtils.hide(mBtnStart, mTvExitNum);
Framework.nativeCloseRouting();
mEndPoint = null;
break;
@@ -311,6 +313,11 @@ public class RoutingLayout extends RelativeLayout implements View.OnClickListene
mTvTurnDistance.setText(buildSpannedText(UiUtils.dimen(R.dimen.text_size_display_1), UiUtils.dimen(R.dimen.text_size_toolbar),
routingInfo.distToTurn, routingInfo.turnUnits));
routingInfo.vehicleTurnDirection.setTurnDrawable(mIvTurn);
+ if (RoutingInfo.VehicleTurnDirection.isRoundAbout(routingInfo.vehicleTurnDirection))
+ UiUtils.setTextAndShow(mTvExitNum, String.valueOf(routingInfo.exitNum));
+ else
+ UiUtils.hide(mTvExitNum);
+
// TODO (marchuk): Uncomment after the second turn notification is fixed.
// if (routingInfo.vehicleNextTurnDirection.containsNextTurn())
// {