diff options
author | Dmitry Yunitsky <yunik@mapswithme.com> | 2015-10-13 13:15:04 +0300 |
---|---|---|
committer | Dmitry Yunitsky <yunik@mapswithme.com> | 2015-10-13 13:47:24 +0300 |
commit | a8e4722ad2ba75891dfa7a0b0196475394eded52 (patch) | |
tree | 30ebb37e8c8673464c29972e7becbe0e6be0f852 /android | |
parent | f4f7cbc1d724ff17b55ad7705c99fbf69e456a9e (diff) |
[android] Show exit num.
Diffstat (limited to 'android')
-rw-r--r-- | android/res/layout-land/layout_turn_instructions.xml | 174 | ||||
-rw-r--r-- | android/res/layout/layout_routing_full.xml | 71 | ||||
-rw-r--r-- | android/res/layout/layout_turn_and_street.xml | 68 | ||||
-rw-r--r-- | android/src/com/mapswithme/maps/routing/RoutingInfo.java | 5 | ||||
-rw-r--r-- | android/src/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 @@ <?xml version="1.0" encoding="utf-8"?> <RelativeLayout - 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"> + 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"> <com.mapswithme.maps.widget.FlatProgressView - 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/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"/> <ImageView - 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"/> + 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"/> + + <FrameLayout + android:id="@+id/turn" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginBottom="@dimen/margin_base" + android:layout_marginLeft="@dimen/margin_double_plus" + android:layout_marginTop="@dimen/margin_base" + android:layout_toRightOf="@id/btn__close"> - <com.mapswithme.maps.widget.ArrowView + <com.mapswithme.maps.widget.ArrowView android:id="@+id/iv__turn" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginBottom="@dimen/margin_base" - android:layout_marginLeft="@dimen/margin_double_plus" - android:layout_marginTop="@dimen/margin_base" - android:layout_toRightOf="@id/btn__close" - tools:src="@drawable/ic_slight_left_light"/> + tools:src="@drawable/ic_round"/> - <TextView - android:id="@+id/tv__turn_distance" + <TextView + android:id="@+id/tv__exit_num" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginLeft="@dimen/margin_base" - android:layout_toRightOf="@id/iv__turn" - android:textAppearance="@style/MwmTextAppearance.Display1.Plus" + android:layout_gravity="center" + android:textAppearance="@style/MwmTextAppearance.Title" android:textColor="@color/routing_blue" - tools:text="300 m"/> + android:visibility="gone" + tools:text="2" + tools:visibility="visible"/> + + </FrameLayout> <TextView - 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__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"/> <TextView - 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__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"/> <TextView - 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"/> + 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"/> <TextView - android:id="@+id/tv__total_distance" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_alignTop="@id/tv__arrival_time" - android:layout_marginRight="@dimen/margin_base" - android:layout_toLeftOf="@id/tv__arrival_time" - android:gravity="center_vertical" - android:textAppearance="@style/MwmTextAppearance.RoutingNumber" - tools:text="1.4 km"/> + 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"/> + + <TextView + android:id="@+id/tv__total_distance" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignTop="@id/tv__arrival_time" + android:layout_marginRight="@dimen/margin_base" + android:layout_toLeftOf="@id/tv__arrival_time" + android:gravity="center_vertical" + android:textAppearance="@style/MwmTextAppearance.RoutingNumber" + tools:text="1.4 km"/> </RelativeLayout> 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 @@ <?xml version="1.0" encoding="utf-8"?> <merge - xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:tools="http://schemas.android.com/tools"> + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools"> <include - android:id="@+id/layout__routing_setup" - layout="@layout/layout_routing_setup"/> + android:id="@+id/layout__routing_setup" + layout="@layout/layout_routing_setup"/> <include - android:id="@+id/layout__turn_instructions" - layout="@layout/layout_turn_instructions" - android:visibility="gone" - tools:visibility="visible"/> + android:id="@+id/layout__turn_instructions" + layout="@layout/layout_turn_instructions" + android:visibility="gone" + tools:visibility="visible"/> <LinearLayout - android:id="@+id/next_turn" + android:id="@+id/next_turn" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@id/layout__turn_instructions" + android:layout_centerHorizontal="true" + android:layout_marginTop="@dimen/margin_half" + android:background="@drawable/bg_next_turn" + android:gravity="center_vertical" + android:orientation="horizontal" + android:paddingBottom="@dimen/margin_quarter" + android:paddingLeft="@dimen/margin_base" + android:paddingRight="@dimen/margin_base" + android:paddingTop="@dimen/margin_quarter" + android:visibility="gone" + tools:visibility="visible"> + + <TextView + android:id="@+id/tv__next_turn" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_below="@id/layout__turn_instructions" - android:layout_centerHorizontal="true" - android:layout_marginTop="@dimen/margin_half" - android:background="@drawable/bg_next_turn" android:gravity="center_vertical" - android:orientation="horizontal" - android:paddingBottom="@dimen/margin_quarter" - android:paddingLeft="@dimen/margin_base" - android:paddingRight="@dimen/margin_base" - android:paddingTop="@dimen/margin_quarter" - android:visibility="gone" - tools:visibility="visible"> - - <TextView - android:id="@+id/tv__next_turn" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:gravity="center_vertical" - android:padding="@dimen/margin_quarter" - android:text="@string/next_turn_then" - android:textColor="@android:color/white" - android:textSize="@dimen/text_size_toolbar"/> + android:padding="@dimen/margin_quarter" + android:text="@string/next_turn_then" + android:textColor="@android:color/white" + android:textSize="@dimen/text_size_toolbar"/> <ImageView - android:id="@+id/iv__next_turn" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:contentDescription="@string/next_turn_then" - tools:src="@drawable/ic_round_then"/> + 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"/> </LinearLayout> 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 @@ <?xml version="1.0" encoding="utf-8"?> <RelativeLayout - 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"> + 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"> + + <FrameLayout + android:id="@+id/turn" + android:layout_width="wrap_content" + android:layout_height="wrap_content"> - <com.mapswithme.maps.widget.ArrowView + <com.mapswithme.maps.widget.ArrowView android:id="@+id/iv__turn" android:layout_width="wrap_content" android:layout_height="wrap_content" - tools:src="@drawable/ic_slight_left_light"/> + tools:src="@drawable/ic_round"/> - <TextView - android:id="@+id/tv__turn_distance" + <TextView + android:id="@+id/tv__exit_num" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginLeft="@dimen/margin_base" - android:layout_toRightOf="@+id/iv__turn" - android:textAppearance="@style/MwmTextAppearance.Display1.Plus" + android:layout_gravity="center" + android:textAppearance="@style/MwmTextAppearance.Title" android:textColor="@color/routing_blue" - tools:text="300 m"/> + android:visibility="gone" + tools:text="2" + tools:visibility="visible"/> + + </FrameLayout> <TextView - 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_below="@id/tv__turn_distance" - android:textAppearance="@style/MwmTextAppearance.Body2" - android:textSize="@dimen/text_size_title" - android:maxLines="2" - tools:text="Oxford str." - 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"/> + + <TextView + 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_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"/> </RelativeLayout>
\ 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()) // { |