From a8e4722ad2ba75891dfa7a0b0196475394eded52 Mon Sep 17 00:00:00 2001 From: Dmitry Yunitsky Date: Tue, 13 Oct 2015 13:15:04 +0300 Subject: [android] Show exit num. --- .../res/layout-land/layout_turn_instructions.xml | 174 ++++++++++++--------- android/res/layout/layout_routing_full.xml | 71 ++++----- android/res/layout/layout_turn_and_street.xml | 68 +++++--- .../com/mapswithme/maps/routing/RoutingInfo.java | 5 + .../com/mapswithme/maps/widget/RoutingLayout.java | 9 +- 5 files changed, 188 insertions(+), 139 deletions(-) diff --git a/android/res/layout-land/layout_turn_instructions.xml b/android/res/layout-land/layout_turn_instructions.xml index def3d8fedb..fd23f92ad7 100644 --- a/android/res/layout-land/layout_turn_instructions.xml +++ b/android/res/layout-land/layout_turn_instructions.xml @@ -1,101 +1,119 @@ + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="@color/bg_top_panels" + android:elevation="@dimen/appbar_elevation" + android:paddingTop="@dimen/margin_eighth"> + android:id="@+id/fp__route_progress" + android:layout_width="match_parent" + android:layout_height="wrap_content" + app:headRadius="2dp" + app:progressColor="#757575" + app:progressThickness="4dp" + app:secondaryProgressColor="@color/base_black_divider" + app:secondaryProgressThickness="2dp"/> + android:id="@+id/btn__close" + android:layout_width="@dimen/base_block_size" + android:layout_height="@dimen/base_block_size" + android:layout_centerVertical="true" + android:layout_marginBottom="@dimen/margin_base_plus" + android:layout_marginLeft="@dimen/margin_quarter" + android:layout_marginRight="@dimen/margin_base" + android:layout_marginTop="@dimen/margin_base_plus" + android:background="?attr/selectableItemBackgroundBorderless" + android:scaleType="center" + android:src="@drawable/ic_close_routing"/> + + - + tools:src="@drawable/ic_round"/> - + android:visibility="gone" + tools:text="2" + tools:visibility="visible"/> + + + android:id="@+id/tv__turn_distance" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginLeft="@dimen/margin_base" + android:layout_toRightOf="@id/turn" + android:textAppearance="@style/MwmTextAppearance.Display1.Plus" + android:textColor="@color/routing_blue" + tools:text="300 m"/> + android:id="@+id/tv__next_street" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignLeft="@id/tv__turn_distance" + android:layout_alignParentRight="true" + android:layout_below="@id/tv__turn_distance" + android:maxLines="2" + android:textAppearance="@style/MwmTextAppearance.Body2" + android:textSize="@dimen/text_size_title" + tools:text="Oxford str." + tools:visibility="visible"/> + android:id="@+id/tv__total_time" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentRight="true" + android:layout_alignTop="@id/tv__turn_distance" + android:layout_marginRight="@dimen/margin_base" + android:gravity="center_vertical" + android:textAppearance="@style/MwmTextAppearance.RoutingNumber" + tools:text="1,5 min"/> + android:id="@+id/tv__arrival_time" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentRight="true" + android:layout_below="@id/tv__total_time" + android:layout_marginRight="@dimen/margin_base" + android:layout_marginTop="@dimen/margin_eighth" + android:gravity="center_vertical" + android:textAppearance="@style/MwmTextAppearance.RoutingNumber" + tools:text="1:00"/> + + diff --git a/android/res/layout/layout_routing_full.xml b/android/res/layout/layout_routing_full.xml index 1d1a6c801d..db9500cf83 100644 --- a/android/res/layout/layout_routing_full.xml +++ b/android/res/layout/layout_routing_full.xml @@ -1,51 +1,52 @@ + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools"> + android:id="@+id/layout__routing_setup" + layout="@layout/layout_routing_setup"/> + android:id="@+id/layout__turn_instructions" + layout="@layout/layout_turn_instructions" + android:visibility="gone" + tools:visibility="visible"/> + + - - + android:padding="@dimen/margin_quarter" + android:text="@string/next_turn_then" + android:textColor="@android:color/white" + android:textSize="@dimen/text_size_toolbar"/> + android:id="@+id/iv__next_turn" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:contentDescription="@string/next_turn_then" + tools:src="@drawable/ic_round_then"/> diff --git a/android/res/layout/layout_turn_and_street.xml b/android/res/layout/layout_turn_and_street.xml index 4117e95c38..e18f2ee1ad 100644 --- a/android/res/layout/layout_turn_and_street.xml +++ b/android/res/layout/layout_turn_and_street.xml @@ -1,38 +1,56 @@ + android:id="@+id/turns" + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="@dimen/panel_width" + android:layout_height="wrap_content" + android:layout_centerHorizontal="true" + android:padding="@dimen/padding_routing_turns"> + + - + tools:src="@drawable/ic_round"/> - + android:visibility="gone" + tools:text="2" + tools:visibility="visible"/> + + + android:id="@+id/tv__turn_distance" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginLeft="@dimen/margin_base" + android:layout_toRightOf="@+id/turn" + android:textAppearance="@style/MwmTextAppearance.Display1.Plus" + android:textColor="@color/routing_blue" + tools:text="300 m"/> + + \ No newline at end of file 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()) // { -- cgit v1.2.3