diff options
Diffstat (limited to 'res')
-rw-r--r-- | res/layout/fragment_playback.xml | 42 | ||||
-rw-r--r-- | res/layout/view_metadata.xml | 33 | ||||
-rw-r--r-- | res/values/dimens.xml | 13 |
3 files changed, 55 insertions, 33 deletions
diff --git a/res/layout/fragment_playback.xml b/res/layout/fragment_playback.xml index 09ce12d..e37a712 100644 --- a/res/layout/fragment_playback.xml +++ b/res/layout/fragment_playback.xml @@ -8,10 +8,14 @@ <com.android.car.media.CrossfadeImageView android:id="@+id/album_background" + android:layout_width="0dp" + android:layout_height="0dp" android:background="@color/car_dark_blue_grey_800" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:scaleType="centerCrop" /> + android:scaleType="centerCrop" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="@+id/playback_scrim_bottom"/> <View android:id="@+id/playback_scrim" @@ -23,17 +27,15 @@ <View android:id="@+id/playback_scrim_bottom" android:layout_width="match_parent" - android:layout_height="0dp" - android:layout_weight="1" + android:layout_height="@dimen/playback_scrim_transition_height" android:background="@drawable/car_playback_bottom_scrim" - app:layout_constraintTop_toTopOf="@+id/playback_controls" - app:layout_constraintBottom_toBottomOf="@+id/playback_controls"/> + app:layout_constraintTop_toBottomOf="@+id/metadata_container"/> <View android:layout_width="match_parent" android:layout_height="0dp" android:background="@android:color/black" - app:layout_constraintTop_toBottomOf="@+id/playback_controls" + app:layout_constraintTop_toBottomOf="@+id/playback_scrim_bottom" app:layout_constraintBottom_toBottomOf="parent"/> <FrameLayout @@ -50,17 +52,6 @@ </FrameLayout> - <com.android.car.media.common.PlaybackControls - android:id="@+id/playback_controls" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:paddingTop="@dimen/playback_controls_margin" - android:paddingBottom="@dimen/playback_controls_margin" - android:layout_marginLeft="@dimen/car_margin" - android:layout_marginRight="@dimen/car_margin" - app:columns="5" - app:layout_constraintTop_toBottomOf="@+id/metadata_container"/> - <androidx.car.widget.PagedListView android:id="@+id/browse_list" android:layout_width="match_parent" @@ -71,7 +62,18 @@ app:layout_behavior="@string/appbar_scrolling_view_behavior" app:dividerStartMargin="@dimen/car_keyline_1" app:dividerEndMargin="@dimen/car_keyline_1" - app:layout_constraintTop_toBottomOf="@+id/playback_controls" + app:layout_constraintTop_toBottomOf="@+id/metadata_container" + app:layout_constraintBottom_toTopOf="@+id/playback_controls"/> + + <com.android.car.media.common.PlaybackControls + android:id="@+id/playback_controls" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginLeft="@dimen/car_margin" + android:layout_marginRight="@dimen/car_margin" + android:layout_marginTop="@dimen/car_padding_1" + android:layout_marginBottom="@dimen/car_padding_1" + app:columns="5" app:layout_constraintBottom_toBottomOf="parent"/> </android.support.constraint.ConstraintLayout> diff --git a/res/layout/view_metadata.xml b/res/layout/view_metadata.xml index 17bb7aa..c503903 100644 --- a/res/layout/view_metadata.xml +++ b/res/layout/view_metadata.xml @@ -15,13 +15,12 @@ android:contentDescription="@string/album_art" android:layout_marginStart="@dimen/car_keyline_1" android:layout_marginEnd="@dimen/car_keyline_1" - android:layout_width="200dp" - android:layout_height="190dp" + android:layout_width="@dimen/playback_album_art_height" + android:layout_height="@dimen/playback_album_art_width" android:scaleType="centerCrop" android:transitionName="@string/album_art"/> - <LinearLayout - android:orientation="vertical" + <RelativeLayout android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginEnd="@dimen/car_keyline_1" @@ -32,33 +31,43 @@ android:id="@+id/title" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:layout_marginBottom="@dimen/car_padding_1" android:textAppearance="@style/TextAppearance.Car.Body1.Light" - android:gravity="start" android:maxLines="@integer/playback_title_text_max_lines" android:ellipsize="end" - android:textAlignment="center" android:includeFontPadding="false"/> <TextView android:id="@+id/subtitle" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginTop="@dimen/playback_secondary_text_margin_top" + android:layout_below="@+id/title" + android:layout_marginBottom="@dimen/car_padding_2" android:textAppearance="@style/TextAppearance.Car.Body2.Light" - android:gravity="start" android:maxLines="@integer/playback_subtitle_text_max_lines" android:ellipsize="end" - android:textAlignment="center"/> + android:includeFontPadding="false"/> + <TextView + android:id="@+id/time" + android:text="3:27 / 4:03" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentEnd="true" + android:layout_below="@+id/title" + android:textAppearance="@style/TextAppearance.Car.Body2.Light" + android:maxLines="@integer/playback_subtitle_text_max_lines" + android:ellipsize="end" + android:includeFontPadding="false"/> <SeekBar android:id="@+id/seek_bar" android:layout_width="match_parent" android:layout_height="@dimen/playback_seekbar_height" - android:layout_marginTop="@dimen/playback_seekbar_margin_top" - android:visibility="invisible" + android:layout_below="@+id/subtitle" android:paddingStart="0dp" android:paddingEnd="0dp" + android:visibility="invisible" android:progressDrawable="@drawable/seekbar_background" android:background="@color/car_grey_900" android:thumb="@null"/> - </LinearLayout> + </RelativeLayout> </LinearLayout> diff --git a/res/values/dimens.xml b/res/values/dimens.xml index c437ace..79da22b 100644 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -33,5 +33,16 @@ <dimen name="controls_spacing_inner">16dp</dimen> <dimen name="controls_spacing_outer">81dp</dimen> - <dimen name="playback_controls_margin">48dp</dimen> + <!-- Height of the gradient scrim over the background image --> + <dimen name="playback_scrim_transition_height">256dp</dimen> + <!-- Image size used to generate the background --> + <dimen name="playback_background_raw_image_size">300px</dimen> + <!-- Blurring radius used to blur background images --> + <item name="playback_background_blur_radius" format="float" type="dimen">25</item> + <!-- Scale to apply to images before blurring them to create the playback background --> + <item name="playback_background_blur_scale" format="float" type="dimen">1</item> + <!-- Size of the album art thumbnail --> + <dimen name="playback_album_art_height">190dp</dimen> + <dimen name="playback_album_art_width">200dp</dimen> + </resources> |