[android] Implemented elevation profile properties layout

This commit is contained in:
Александр Зацепин 2020-02-17 14:53:12 +03:00 committed by yoksnod
parent a0ac1cc032
commit b279091cdc
12 changed files with 188 additions and 1 deletions

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/black_4"/>
<corners android:radius="@dimen/margin_quarter"/>
</shape>

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/white_4"/>
<corners android:radius="@dimen/margin_quarter"/>
</shape>

View file

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M10.9896,7.0369C11.2704,6.577 11.2474,5.9931 10.9314,5.5557C10.6153,5.1183 10.068,4.9128 9.5429,5.0345L3.3769,6.4634C2.6571,6.6302 2.2097,7.3491 2.3776,8.0692C2.5456,8.7892 3.2653,9.2377 3.9851,9.0709L7.0422,8.3625L2.1959,16.3014C1.8111,16.9318 2.0107,17.7557 2.6417,18.1415C3.2728,18.5273 4.0964,18.329 4.4812,17.6986L10.9896,7.0369ZM15.229,6.9892C14.7095,6.1212 13.4518,6.1212 12.9323,6.9892L6.3573,17.9743C5.8234,18.8664 6.4661,19.9999 7.5057,19.9999H20.6556C21.6952,19.9999 22.3379,18.8664 21.8039,17.9743L15.229,6.9892Z"
android:fillColor="#ffffff"
android:fillType="evenOdd"/>
</vector>

View file

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M18.7417,16.7927C19.0166,17.2427 19.5407,17.4862 20.0757,17.4125C20.6106,17.3389 21.0542,16.9621 21.2048,16.4536L22.9473,10.5672C23.1559,9.8625 22.7434,9.1338 22.0259,8.9396C21.3084,8.7454 20.5576,9.1593 20.349,9.864L19.478,12.8063L14.4821,4.6289C14.1011,4.0054 13.2712,3.8091 12.6284,4.1906C11.9856,4.5721 11.7734,5.3868 12.1543,6.0104L18.7417,16.7927ZM10.0069,6.237C9.4818,5.3707 8.2248,5.3707 7.6998,6.237L1.2048,16.9526C0.6599,17.8516 1.3071,19.0007 2.3583,19.0007H15.3483C16.3995,19.0007 17.0468,17.8516 16.5019,16.9526L10.0069,6.237Z"
android:fillColor="#ffffff"
android:fillType="evenOdd"/>
</vector>

View file

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M5,4C4.4477,4 4,4.4477 4,5C4,5.5523 4.4477,6 5,6H19C19.5523,6 20,5.5523 20,5C20,4.4477 19.5523,4 19,4H5ZM12.9883,8.7118C12.5491,7.951 11.4509,7.951 11.0117,8.7118L6.0601,17.2882C5.6209,18.049 6.1699,19 7.0484,19H16.9516C17.8301,19 18.3791,18.049 17.9399,17.2882L12.9883,8.7118Z"
android:fillColor="#ffffff"
android:fillType="evenOdd"/>
</vector>

View file

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M19,20C19.5523,20 20,19.5523 20,19C20,18.4477 19.5523,18 19,18L5,18C4.4477,18 4,18.4477 4,19C4,19.5523 4.4477,20 5,20L19,20ZM11.0117,15.2882C11.4509,16.049 12.5491,16.049 12.9883,15.2882L17.9399,6.7118C18.3791,5.951 17.8301,5 16.9516,5L7.0484,5C6.1699,5 5.6209,5.951 6.0601,6.7118L11.0117,15.2882Z"
android:fillColor="#ffffff"
android:fillType="evenOdd"/>
</vector>

View file

@ -8,6 +8,7 @@
android:paddingStart="@dimen/margin_base"
android:paddingEnd="@dimen/margin_base"
android:paddingTop="@dimen/margin_base"
android:paddingBottom="@dimen/margin_base"
android:background="?cardBackground"
app:behavior_defaultState="hidden"
app:behavior_skipCollapsed="true"

View file

@ -8,6 +8,7 @@
android:paddingStart="@dimen/margin_base"
android:paddingEnd="@dimen/margin_base"
android:paddingTop="@dimen/margin_half_plus"
android:paddingBottom="@dimen/margin_base"
android:background="?cardBackground"
app:behavior_defaultState="hidden"
app:behavior_hideable="true"

View file

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<merge
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"
tools:showIn="@layout/elevation_profile_bottom_sheet">
<TextView
@ -15,12 +16,134 @@
android:id="@+id/chart_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="@dimen/elevation_profile_chart_min_height"
android:gravity="center"
android:minHeight="@dimen/elevation_profile_chart_min_height"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Chart is coming soon!" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_base"
android:minHeight="@dimen/elevation_profile_chart_info_min_height"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginEnd="@dimen/margin_quarter"
android:layout_weight="1"
android:background="?elevationProfilePropertyBg"
android:gravity="center_horizontal"
android:orientation="vertical"
android:padding="@dimen/margin_quarter_plus">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:tint="?elevationProfilePropIconTint"
app:srcCompat="@drawable/ic_ascent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_eighth"
android:ellipsize="end"
android:singleLine="true"
android:text="@string/elevation_profile_ascent"
android:textAppearance="@style/MwmTextAppearance.Body5" />
<TextView
android:id="@+id/ascent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:textAppearance"
tools:text="10000 m" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginEnd="@dimen/margin_quarter"
android:layout_weight="1"
android:background="?elevationProfilePropertyBg"
android:gravity="center_horizontal"
android:orientation="vertical"
android:padding="@dimen/margin_quarter_plus">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:tint="?elevationProfilePropIconTint"
app:srcCompat="@drawable/ic_descent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_eighth"
android:ellipsize="end"
android:singleLine="true"
android:text="@string/elevation_profile_descent"
android:textAppearance="@style/MwmTextAppearance.Body5" />
<TextView
android:id="@+id/descent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:textAppearance"
tools:text="10000 m" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginEnd="@dimen/margin_quarter"
android:layout_weight="1"
android:background="?elevationProfilePropertyBg"
android:gravity="center_horizontal"
android:orientation="vertical"
android:padding="@dimen/margin_quarter_plus">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:tint="?elevationProfilePropIconTint"
app:srcCompat="@drawable/ic_maxalt" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_eighth"
android:ellipsize="end"
android:singleLine="true"
android:text="@string/elevation_profile_maxaltitude"
android:textAppearance="@style/MwmTextAppearance.Body5" />
<TextView
android:id="@+id/max_altitude"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:textAppearance"
tools:text="10000 m" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="?elevationProfilePropertyBg"
android:gravity="center_horizontal"
android:orientation="vertical"
android:padding="@dimen/margin_quarter_plus">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:tint="?elevationProfilePropIconTint"
app:srcCompat="@drawable/ic_minalt" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_eighth"
android:ellipsize="end"
android:singleLine="true"
android:text="@string/elevation_profile_minaltitude"
android:textAppearance="@style/MwmTextAppearance.Body5" />
<TextView
android:id="@+id/min_altitude"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:textAppearance"
tools:text="10000 m" />
</LinearLayout>
</LinearLayout>
</merge>

View file

@ -83,6 +83,7 @@
<dimen name="viewport_min_width">300dp</dimen>
<dimen name="elevation_profile_peek_height">269dp</dimen>
<dimen name="elevation_profile_chart_min_height">144dp</dimen>
<dimen name="elevation_profile_chart_info_min_height">68dp</dimen>
<!-- routing layout -->
<dimen name="routing_info_height">48dp</dimen>

View file

@ -138,6 +138,11 @@
<attr name="subscriptionTitleColor" format="color"/>
<attr name="subscriptionSubtitleColor" format="color"/>
</declare-styleable>
<declare-styleable name="ThemeAttrs.ElevationProfile">
<attr name="elevationProfilePropertyBg" format="reference" />
<attr name="elevationProfilePropIconTint" format="color" />
</declare-styleable>
<declare-styleable name="ThemeAttrs.Fonts">
<attr name="fontHeadline1" format="reference"/>

View file

@ -168,6 +168,8 @@
<item name="subscriptionSubtitleColor">@color/bookmarks_subs_subtitle</item>
<item name="bg_crown">@drawable/bg_crown</item>
<item name="bg_dog_btn">@drawable/ic_dog_bg</item>
<item name="elevationProfilePropertyBg">@drawable/bg_rounded_rect</item>
<item name="elevationProfilePropIconTint">@color/black_secondary</item>
</style>
<!-- Night theme -->
@ -335,5 +337,7 @@
<item name="subscriptionSubtitleColor">@color/bookmarks_subs_subtitle_night</item>
<item name="bg_crown">@drawable/bg_crown_night</item>
<item name="bg_dog_btn">@drawable/ic_dog_bg_night</item>
<item name="elevationProfilePropertyBg">@drawable/bg_rounded_rect_night</item>
<item name="elevationProfilePropIconTint">@color/white_secondary</item>
</style>
</resources>