Dmitry Donskoy 2020-03-26 18:07:59 +03:00 committed by Vladimir Byko-Ianko
parent 8489050647
commit 85ddb75fe5
2 changed files with 12 additions and 6 deletions

View file

@ -161,10 +161,10 @@
android:layout_marginEnd="@dimen/margin_base"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/difficulty_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:id="@+id/difficulty_container"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
@ -199,6 +199,7 @@
</LinearLayout>
</LinearLayout>
<View
android:id="@+id/medium_divider"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="@dimen/margin_base"

View file

@ -52,6 +52,9 @@ public class ElevationProfileViewRenderer implements PlacePageViewRenderer<Place
@SuppressWarnings("NullableProblems")
@NonNull
private View mTimeContainer;
@SuppressWarnings("NullableProblems")
@NonNull
private View mMediumDivider;
@SuppressLint("SetTextI18n")
@Override
@ -84,12 +87,13 @@ public class ElevationProfileViewRenderer implements PlacePageViewRenderer<Place
mDescent = view.findViewById(R.id.descent);
mMaxAltitude = view.findViewById(R.id.max_altitude);
mMinAltitude = view.findViewById(R.id.min_altitude);
mTime = view.findViewById(R.id.time);
mDifficultyLevels[0] = view.findViewById(R.id.difficulty_level_1);
mDifficultyLevels[1] = view.findViewById(R.id.difficulty_level_2);
mDifficultyLevels[2] = view.findViewById(R.id.difficulty_level_3);
mDifficultyContainer = view.findViewById(R.id.difficulty_container);
mTimeContainer = view.findViewById(R.id.time_container);
mTime = mTimeContainer.findViewById(R.id.time);
mDifficultyContainer = view.findViewById(R.id.difficulty_container);
mDifficultyLevels[0] = mDifficultyContainer.findViewById(R.id.difficulty_level_1);
mDifficultyLevels[1] = mDifficultyContainer.findViewById(R.id.difficulty_level_2);
mDifficultyLevels[2] = mDifficultyContainer.findViewById(R.id.difficulty_level_3);
mMediumDivider = view.findViewById(R.id.medium_divider);
}
@Override
@ -105,6 +109,7 @@ public class ElevationProfileViewRenderer implements PlacePageViewRenderer<Place
boolean invalidDifficulty = level > MAX_DIFFICULTY_LEVEL;
UiUtils.hideIf(invalidDifficulty, mDifficultyContainer);
UiUtils.hideIf(invalidDifficulty, mMediumDivider);
if (invalidDifficulty)
return;