From a186264434015fce5a7cb7aa9c385195a22e6b7c Mon Sep 17 00:00:00 2001 From: Dmitry Donskoy Date: Fri, 10 Apr 2020 00:31:49 +0300 Subject: [PATCH] [android] Fixed bottom ellipsize chart --- android/res/layout/elevation_profile_internal.xml | 14 ++++++-------- .../placepage/ElevationProfileViewRenderer.java | 13 ++++++++----- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/android/res/layout/elevation_profile_internal.xml b/android/res/layout/elevation_profile_internal.xml index 7eaaefbfc0..cbc3c0b2ea 100644 --- a/android/res/layout/elevation_profile_internal.xml +++ b/android/res/layout/elevation_profile_internal.xml @@ -157,7 +157,7 @@ tools:text="10000 m" /> - - android:ellipsize="end" tools:text="3 h. 25 min." /> - + diff --git a/android/src/com/mapswithme/maps/widget/placepage/ElevationProfileViewRenderer.java b/android/src/com/mapswithme/maps/widget/placepage/ElevationProfileViewRenderer.java index 9ab4f3a1ce..827b0974ec 100644 --- a/android/src/com/mapswithme/maps/widget/placepage/ElevationProfileViewRenderer.java +++ b/android/src/com/mapswithme/maps/widget/placepage/ElevationProfileViewRenderer.java @@ -2,6 +2,7 @@ package com.mapswithme.maps.widget.placepage; import android.os.Bundle; import android.view.View; +import android.widget.RelativeLayout; import android.widget.TextView; import androidx.annotation.NonNull; @@ -58,9 +59,6 @@ public class ElevationProfileViewRenderer implements PlacePageViewRenderer MAX_DIFFICULTY_LEVEL || level == UNKNOWN_DIFFICULTY; UiUtils.hideIf(invalidDifficulty, mDifficultyContainer); - UiUtils.hideIf(invalidDifficulty, mMediumDivider); + RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) mTimeContainer.getLayoutParams(); + params.removeRule(RelativeLayout.ALIGN_PARENT_END); + params.removeRule(RelativeLayout.ALIGN_PARENT_RIGHT); + params.removeRule(RelativeLayout.ALIGN_PARENT_START); + params.removeRule(RelativeLayout.LEFT_OF); + params.addRule(invalidDifficulty ? RelativeLayout.ALIGN_PARENT_START : RelativeLayout.ALIGN_PARENT_END); + mTimeContainer.setLayoutParams(params); if (invalidDifficulty) return;