diff options
author | Roberto Perez <robertoalexis@google.com> | 2018-04-19 13:56:23 -0700 |
---|---|---|
committer | Roberto Perez <robertoalexis@google.com> | 2018-04-23 16:43:42 -0700 |
commit | d1f0ec11284f6e6ed05d6a6fb7e2e086cc4a9837 (patch) | |
tree | 5721e38526d6739035d9e76f88942ee8e9418d34 /res | |
parent | 27683666b9c48dd8c53682f196351c9c1f7b7ee9 (diff) | |
download | Media-d1f0ec11284f6e6ed05d6a6fb7e2e086cc4a9837.tar.gz |
DO NOT MERGE Splitting playback and browse fragments. Implementing Intent handling
for browse and playback usecases. Implementing TabLayout to access
browsing UI.
Bug: 77527398
Test: Tested on BigDog
Change-Id: If217e89ba7ee875239363f9181cd3b7157a7be3d
Diffstat (limited to 'res')
-rw-r--r-- | res/drawable/browse_gradient_scrim.xml | 24 | ||||
-rw-r--r-- | res/layout/fragment_browse.xml | 29 | ||||
-rw-r--r-- | res/layout/fragment_playback.xml | 34 | ||||
-rw-r--r-- | res/layout/media_activity.xml | 48 | ||||
-rw-r--r-- | res/layout/now_playing_screen.xml | 85 | ||||
-rw-r--r-- | res/layout/tab_view.xml | 39 | ||||
-rw-r--r-- | res/values-h1200dp/bools.xml | 20 | ||||
-rw-r--r-- | res/values/bools.xml | 24 | ||||
-rw-r--r-- | res/values/colors.xml | 14 | ||||
-rw-r--r-- | res/values/dimens.xml | 6 | ||||
-rw-r--r-- | res/values/integers.xml | 6 | ||||
-rw-r--r-- | res/values/styles.xml | 10 |
12 files changed, 215 insertions, 124 deletions
diff --git a/res/drawable/browse_gradient_scrim.xml b/res/drawable/browse_gradient_scrim.xml new file mode 100644 index 0000000..a3f0f12 --- /dev/null +++ b/res/drawable/browse_gradient_scrim.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright 2018, The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<shape + xmlns:android="http://schemas.android.com/apk/res/android" + android:shape="rectangle"> + <gradient + android:startColor="#000000" + android:endColor="#00000000" + android:angle="270" /> +</shape>
\ No newline at end of file diff --git a/res/layout/fragment_browse.xml b/res/layout/fragment_browse.xml new file mode 100644 index 0000000..0d1e109 --- /dev/null +++ b/res/layout/fragment_browse.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright 2018, The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<FrameLayout + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + android:layout_width="match_parent" + android:layout_height="match_parent"> + + <androidx.car.widget.PagedListView + android:id="@+id/browse_list" + android:layout_width="match_parent" + android:layout_height="match_parent" + app:showPagedListViewDivider="false"/> + +</FrameLayout>
\ No newline at end of file diff --git a/res/layout/fragment_playback.xml b/res/layout/fragment_playback.xml index 867d0e9..f3a3ee2 100644 --- a/res/layout/fragment_playback.xml +++ b/res/layout/fragment_playback.xml @@ -22,38 +22,6 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - <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: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" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:background="@color/car_dark_blue_grey_900" - android:alpha="@dimen/playback_initial_scrim_alpha"/> - - <View - android:id="@+id/playback_scrim_bottom" - android:layout_width="match_parent" - android:layout_height="@dimen/playback_scrim_transition_height" - android:background="@drawable/car_playback_bottom_scrim" - 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_scrim_bottom" - app:layout_constraintBottom_toBottomOf="parent"/> - <android.support.v4.widget.Space android:id="@+id/app_bar_space" android:layout_width="match_parent" @@ -74,7 +42,7 @@ </FrameLayout> <androidx.car.widget.PagedListView - android:id="@+id/browse_list" + android:id="@+id/queue_list" android:layout_width="match_parent" android:layout_height="0dp" android:layout_marginBottom="@dimen/car_padding_4" diff --git a/res/layout/media_activity.xml b/res/layout/media_activity.xml index 4abfe04..e92308d 100644 --- a/res/layout/media_activity.xml +++ b/res/layout/media_activity.xml @@ -14,8 +14,50 @@ See the License for the specific language governing permissions and limitations under the License. --> -<FrameLayout +<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:id="@+id/fragment_container" + xmlns:app="http://schemas.android.com/apk/res-auto" + android:id="@+id/application" + android:animateLayoutChanges="true" android:layout_width="match_parent" - android:layout_height="match_parent" /> + android:layout_height="match_parent"> + + <com.android.car.media.common.CrossfadeImageView + android:id="@+id/media_background" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="@color/media_template_background" + android:scaleType="centerCrop"/> + + <View + android:id="@+id/media_scrim" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="@color/media_scrim_background" + android:alpha="@dimen/playback_initial_scrim_alpha"/> + + <View + android:id="@+id/browse_scrim" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="@drawable/browse_gradient_scrim"/> + + <android.support.design.widget.TabLayout + android:id="@+id/tabs" + android:layout_width="match_parent" + android:layout_height="@dimen/browse_tab_height" + app:tabIndicatorHeight="0dp" + app:tabGravity="fill" + app:tabMode="fixed" + app:tabPadding="0dp" + app:tabMaxWidth="0dp" + app:layout_constraintTop_toTopOf="parent"/> + + <FrameLayout + android:id="@+id/fragment_container" + android:layout_width="match_parent" + android:layout_height="0dp" + app:layout_constraintTop_toBottomOf="@+id/tabs" + app:layout_constraintBottom_toBottomOf="parent"/> + +</android.support.constraint.ConstraintLayout> diff --git a/res/layout/now_playing_screen.xml b/res/layout/now_playing_screen.xml deleted file mode 100644 index bca7a15..0000000 --- a/res/layout/now_playing_screen.xml +++ /dev/null @@ -1,85 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - Copyright 2016, The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> -<FrameLayout - xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:animateLayoutChanges="true" > - - <com.android.car.media.CrossfadeImageView - android:id="@+id/album_art" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:scaleType="centerCrop" /> - - <View - android:id="@+id/scrim" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:background="@android:color/black" - android:alpha="@dimen/media_scrim_alpha" /> - - <View - android:layout_width="match_parent" - android:layout_height="match_parent" - android:background="@color/album_art_color_overlay" /> - - <LinearLayout - android:layout_marginTop="@dimen/car_app_bar_height" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:orientation="vertical" > - - <FrameLayout - android:id="@+id/metadata" - android:layout_width="@dimen/metadata_width" - android:layout_height="0dp" - android:layout_weight="1" - android:layout_marginStart="@dimen/car_keyline_1" - android:layout_marginTop="@dimen/now_playing_metadata_top_margin" - android:visibility="gone" > - - <LinearLayout - android:layout_gravity="top" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="vertical" > - - <TextView - android:id="@+id/title" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:ellipsize="end" - android:fontFamily="sans-serif-medium" - android:maxLines="@integer/media_title_max_lines" - style="@style/TextAppearance.Car.Headline1.Light" /> - <TextView - android:id="@+id/artist" - android:layout_marginTop="@dimen/metadata_inter_line_space" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:ellipsize="end" - android:maxLines="@integer/media_artist_max_lines" - style="@style/TextAppearance.Car.Headline1.Light" /> - </LinearLayout> - </FrameLayout> - - <include layout="@layout/media_controls" /> - </LinearLayout> - - <include layout="@layout/initial_no_content" /> -</FrameLayout> diff --git a/res/layout/tab_view.xml b/res/layout/tab_view.xml new file mode 100644 index 0000000..68fef69 --- /dev/null +++ b/res/layout/tab_view.xml @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright 2018, The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<merge + xmlns:android="http://schemas.android.com/apk/res/android" > + + <ImageView + android:id="@+id/icon" + android:layout_width="@dimen/car_primary_icon_size" + android:layout_height="@dimen/car_primary_icon_size" + android:scaleType="fitCenter" + android:layout_gravity="center_horizontal" + android:tint="@color/car_tint_inverse" + android:layout_marginTop="@dimen/car_padding_2"/> + + <TextView + android:id="@+id/title" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_horizontal" + android:layout_marginBottom="@dimen/car_padding_1" + android:maxLines="1" + android:ellipsize="end" + android:textAppearance="@style/TextAppearance.Car.Body5.Light"/> + +</merge>
\ No newline at end of file diff --git a/res/values-h1200dp/bools.xml b/res/values-h1200dp/bools.xml new file mode 100644 index 0000000..34eae64 --- /dev/null +++ b/res/values-h1200dp/bools.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright 2018, The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<resources> + <bool name="forward_content_browse_enabled">true</bool> + <bool name="force_browse_tabs">true</bool> +</resources>
\ No newline at end of file diff --git a/res/values/bools.xml b/res/values/bools.xml new file mode 100644 index 0000000..b9bd29e --- /dev/null +++ b/res/values/bools.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright 2018, The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<resources> + <!-- Whether forward content browse is enabled --> + <bool name="forward_content_browse_enabled">false</bool> + + <!-- Force the presentation of tabs even if the number of browsable items exceeds the + maximum number of allowed tabs (this is mainly for demo purposes) --> + <bool name="force_browse_tabs">false</bool> +</resources>
\ No newline at end of file diff --git a/res/values/colors.xml b/res/values/colors.xml index 19a9700..30f7d00 100644 --- a/res/values/colors.xml +++ b/res/values/colors.xml @@ -15,8 +15,16 @@ --> <resources> - <color name="music_default_artwork">#78909c</color> - <color name="music_loading_view_background">#11181d</color> <color name="no_content_text_color">#ffffff</color> - <color name="album_art_color_overlay">#99000000</color> + + <color name="car_body5_light">@android:color/white</color> + <color name="car_body5_dark">@android:color/black</color> + <color name="car_body5">@color/car_body5_dark</color> + + <!-- Color displayed behind the transport controls while browsing --> + <color name="browse_playback_bg">@android:color/black</color> + <!-- Default media background --> + <color name="media_template_background">@color/car_dark_blue_grey_800</color> + <!-- Scrim displayed on top of playback album art background --> + <color name="media_scrim_background">@color/car_dark_blue_grey_900</color> </resources> diff --git a/res/values/dimens.xml b/res/values/dimens.xml index 79da22b..254ebd5 100644 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -33,6 +33,8 @@ <dimen name="controls_spacing_inner">16dp</dimen> <dimen name="controls_spacing_outer">81dp</dimen> + <!-- Playback seekbar height --> + <dimen name="playback_seekbar_height">8dp</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 --> @@ -45,4 +47,8 @@ <dimen name="playback_album_art_height">190dp</dimen> <dimen name="playback_album_art_width">200dp</dimen> + <!-- Tab height --> + <dimen name="browse_tab_height">100dp</dimen> + <!-- Tab max width --> + <dimen name="browse_tab_width">92dp</dimen> </resources> diff --git a/res/values/integers.xml b/res/values/integers.xml index 41eb8a8..13ad859 100644 --- a/res/values/integers.xml +++ b/res/values/integers.xml @@ -23,4 +23,10 @@ <!-- The maximum number of lines for the artist of a currently playing media item. --> <integer name="media_artist_max_lines">1</integer> + + <!-- Maximum number of browse tabs --> + <integer name="max_browse_tabs">4</integer> + + <!-- Number of columns in the browse view --> + <integer name="num_browse_columns">3</integer> </resources> diff --git a/res/values/styles.xml b/res/values/styles.xml index dd0ef69..f58306e 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -25,4 +25,14 @@ <item name="android:textSize">@dimen/car_body2_size</item> <item name="android:textColor">@color/no_content_text_color</item> </style> + + <style name="TextAppearance.Car.Body5"> + <item name="android:textStyle">normal</item> + <item name="android:textSize">@dimen/car_body5_size</item> + <item name="android:textColor">@color/car_body5</item> + </style> + + <style name="TextAppearance.Car.Body5.Light"> + <item name="android:textColor">@color/car_body5_light</item> + </style> </resources> |