From 75db5f323b757ff2bda917401ac0ef1ef1a6989e Mon Sep 17 00:00:00 2001 From: Dmitry Donskoy Date: Tue, 20 Aug 2019 14:54:09 +0300 Subject: [PATCH] [android] Modified the layouts according to previous behavior, removed the useless views --- android/res/layout-land/routing_details.xml | 28 +++---------- .../layout-w1020dp-land/routing_details.xml | 20 +--------- android/res/layout/routing_details.xml | 39 ++++--------------- .../routing/RoutingBottomMenuController.java | 30 ++++++++------ 4 files changed, 32 insertions(+), 85 deletions(-) diff --git a/android/res/layout-land/routing_details.xml b/android/res/layout-land/routing_details.xml index b560db4894..370d5ac9a1 100644 --- a/android/res/layout-land/routing_details.xml +++ b/android/res/layout-land/routing_details.xml @@ -6,31 +6,13 @@ android:orientation="vertical" android:layout_width="match_parent" android:layout_height="wrap_content"> - - - - - + tools:text="33 min"/> - - + android:layout_height="wrap_content" + android:layout_marginBottom="@dimen/altitude_chart_time_distance_margin_bottom"> - - - - - - + android:layout_toStartOf="@id/altitude_difference" + android:layout_height="wrap_content"/> diff --git a/android/src/com/mapswithme/maps/routing/RoutingBottomMenuController.java b/android/src/com/mapswithme/maps/routing/RoutingBottomMenuController.java index f51d5ccb55..8198b6a5b7 100644 --- a/android/src/com/mapswithme/maps/routing/RoutingBottomMenuController.java +++ b/android/src/com/mapswithme/maps/routing/RoutingBottomMenuController.java @@ -370,7 +370,14 @@ final class RoutingBottomMenuController implements View.OnClickListener Spanned spanned = makeSpannedRoutingDetails(mContext, rinfo); TextView numbersTime = (TextView) mNumbersFrame.findViewById(R.id.time); - numbersTime.setText(spanned, TextView.BufferType.SPANNABLE); + numbersTime.setText(spanned); + + TextView numbersArrival = (TextView) mNumbersFrame.findViewById(R.id.arrival); + if (numbersArrival != null) + { + String arrivalTime = RoutingController.formatArrivalTime(rinfo.totalTimeInSeconds); + numbersArrival.setText(arrivalTime); + } } @NonNull @@ -388,11 +395,7 @@ final class RoutingBottomMenuController implements View.OnClickListener initDotBuilderSequence(context, dot, builder); String dist = routingInfo.distToTarget + " " + routingInfo.targetUnits; - dist = "asdasdasdasdasdasdasdasdasdadqweqweqweqweqweqweqweqweqweqwe"; - initTailBuilderSequence(context, dist, builder, android.R.attr.textColorPrimary); - - String arrivalTime = RoutingController.formatArrivalTime(routingInfo.totalTimeInSeconds); - initTailBuilderSequence(context, arrivalTime, builder.append(" "), R.attr.secondary); + initDistanceBuilderSequence(context, dist, builder); return builder; } @@ -406,7 +409,8 @@ final class RoutingBottomMenuController implements View.OnClickListener 0, builder.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); - builder.setSpan(new AbsoluteSizeSpan(context.getResources().getDimensionPixelSize(R.dimen.text_size_routing_number)), + builder.setSpan(new AbsoluteSizeSpan(context.getResources() + .getDimensionPixelSize(R.dimen.text_size_routing_number)), 0, builder.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); @@ -414,7 +418,8 @@ final class RoutingBottomMenuController implements View.OnClickListener 0, builder.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); - builder.setSpan(new ForegroundColorSpan(ThemeUtils.getColor(context, android.R.attr.textColorPrimary)), + builder.setSpan(new ForegroundColorSpan(ThemeUtils.getColor(context, + android.R.attr.textColorPrimary)), 0, builder.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); @@ -427,7 +432,8 @@ final class RoutingBottomMenuController implements View.OnClickListener builder.length() - dot.length(), builder.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); - builder.setSpan(new AbsoluteSizeSpan(context.getResources().getDimensionPixelSize(R.dimen.text_size_routing_number)), + builder.setSpan(new AbsoluteSizeSpan(context.getResources() + .getDimensionPixelSize(R.dimen.text_size_routing_number)), builder.length() - dot.length(), builder.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); @@ -437,8 +443,8 @@ final class RoutingBottomMenuController implements View.OnClickListener Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); } - private static void initTailBuilderSequence(@NonNull Context context, @NonNull String arrivalTime, - @NonNull SpannableStringBuilder builder, int textColor) + private static void initDistanceBuilderSequence(@NonNull Context context, @NonNull String arrivalTime, + @NonNull SpannableStringBuilder builder) { builder.append(arrivalTime); builder.setSpan(new TypefaceSpan(context.getResources().getString(R.string.robotoMedium)), @@ -454,7 +460,7 @@ final class RoutingBottomMenuController implements View.OnClickListener builder.length() - arrivalTime.length(), builder.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); - builder.setSpan(new ForegroundColorSpan(ThemeUtils.getColor(context, textColor)), + builder.setSpan(new ForegroundColorSpan(ThemeUtils.getColor(context, android.R.attr.textColorPrimary)), builder.length() - arrivalTime.length(), builder.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);