diff options
author | Roberto Perez <robertoalexis@google.com> | 2018-04-26 22:23:24 -0700 |
---|---|---|
committer | Roberto Perez <robertoalexis@google.com> | 2018-05-02 15:27:10 -0700 |
commit | 60561a06d4b8f10ca8c6f09f20c91b50fb6d3fa3 (patch) | |
tree | 55248fc6599b7ebe6fc941b17ee33196d6bb47d8 /res | |
parent | 30ff1007ab6729566d053649d3e973ac9fd33627 (diff) | |
download | Media-60561a06d4b8f10ca8c6f09f20c91b50fb6d3fa3.tar.gz |
DO NOT MERGE Implementing app selection UI.
Bug: 78602199
Test: Launched media template on big dog.
Change-Id: I4bf461a61a01efc68491df0f6446d5563994226a
Diffstat (limited to 'res')
-rw-r--r-- | res/anim/image_in.xml | 32 | ||||
-rw-r--r-- | res/anim/image_out.xml | 23 | ||||
-rw-r--r-- | res/drawable/app_item_background.xml | 27 | ||||
-rw-r--r-- | res/layout/app_selection_item.xml | 48 | ||||
-rw-r--r-- | res/layout/appbar_view.xml | 4 | ||||
-rw-r--r-- | res/layout/fragment_app_selection.xml | 37 | ||||
-rw-r--r-- | res/layout/fragment_browse.xml | 3 | ||||
-rw-r--r-- | res/layout/media_activity.xml | 28 | ||||
-rw-r--r-- | res/layout/media_browse_panel_item.xml | 4 | ||||
-rw-r--r-- | res/layout/tab_view.xml | 2 | ||||
-rw-r--r-- | res/values/colors.xml | 5 | ||||
-rw-r--r-- | res/values/dimens.xml | 4 | ||||
-rw-r--r-- | res/values/integers.xml | 9 |
13 files changed, 150 insertions, 76 deletions
diff --git a/res/anim/image_in.xml b/res/anim/image_in.xml deleted file mode 100644 index 416e251..0000000 --- a/res/anim/image_in.xml +++ /dev/null @@ -1,32 +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. ---> -<set xmlns:android="http://schemas.android.com/apk/res/android"> - <alpha - android:fromAlpha="0.0" - android:toAlpha="1.0" - android:duration="500" - android:startOffset="@integer/new_album_art_fade_in_duration" /> - <scale - android:fromXScale="1.04" - android:toXScale="1.0" - android:fromYScale="1.04" - android:toYScale="1.0" - android:pivotX="50%" - android:pivotY="50%" - android:duration="500" - android:startOffset="@integer/new_album_art_fade_in_duration"/> -</set> diff --git a/res/anim/image_out.xml b/res/anim/image_out.xml deleted file mode 100644 index 2d633c9..0000000 --- a/res/anim/image_out.xml +++ /dev/null @@ -1,23 +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. ---> -<set xmlns:android="http://schemas.android.com/apk/res/android"> - <alpha - android:fromAlpha="1.0" - android:toAlpha="0.0" - android:interpolator="@android:interpolator/fast_out_linear_in" - android:duration="500" /> -</set> diff --git a/res/drawable/app_item_background.xml b/res/drawable/app_item_background.xml new file mode 100644 index 0000000..605c032 --- /dev/null +++ b/res/drawable/app_item_background.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ + ~ Copyright (C) 2018 Google Inc. + ~ + ~ 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. + ~ + --> +<ripple xmlns:android="http://schemas.android.com/apk/res/android" + android:color="@color/app_item_background_color"> + <item android:id="@android:id/mask"> + <shape android:shape="rectangle"> + <solid android:color="?android:colorAccent" /> + <corners android:radius="@dimen/car_radius_2"/> + </shape> + </item> +</ripple> diff --git a/res/layout/app_selection_item.xml b/res/layout/app_selection_item.xml new file mode 100644 index 0000000..69ab513 --- /dev/null +++ b/res/layout/app_selection_item.xml @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ + ~ Copyright (C) 2018 Google Inc. + ~ + ~ 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. + ~ + --> +<LinearLayout + xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/app_item" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginStart="@dimen/car_padding_2" + android:layout_marginEnd="@dimen/car_padding_2" + android:layout_marginBottom="@dimen/car_padding_5" + android:orientation="vertical" + android:background="@drawable/app_item_background" + android:padding="@dimen/car_padding_1" + android:gravity="center"> + + <ImageView + android:id="@+id/app_icon" + android:layout_width="@dimen/car_touch_target_size" + android:layout_height="@dimen/car_touch_target_size" + android:layout_marginBottom="@dimen/car_padding_4" + android:layout_gravity="center_horizontal" /> + + <TextView + android:id="@+id/app_name" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:textAppearance="@style/TextAppearance.Car.Label1" + android:textColor="@color/car_label1_light" + android:gravity="center" + android:ellipsize="end" + android:maxLines="1" /> +</LinearLayout> diff --git a/res/layout/appbar_view.xml b/res/layout/appbar_view.xml index 67b3852..31e965e 100644 --- a/res/layout/appbar_view.xml +++ b/res/layout/appbar_view.xml @@ -41,7 +41,9 @@ android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_centerInParent="true" + android:padding="@dimen/car_padding_1" android:orientation="horizontal" + android:background="@drawable/app_item_background" android:gravity="center"> <ImageView @@ -53,7 +55,7 @@ android:id="@+id/app_switch_icon" android:layout_width="@dimen/car_primary_icon_size" android:layout_height="@dimen/car_primary_icon_size" - android:tint="@color/car_tint_inverse"/> + android:tint="@color/car_body1_light"/> </LinearLayout> diff --git a/res/layout/fragment_app_selection.xml b/res/layout/fragment_app_selection.xml new file mode 100644 index 0000000..eea5f14 --- /dev/null +++ b/res/layout/fragment_app_selection.xml @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ + ~ Copyright (C) 2018 Google Inc. + ~ + ~ 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. + ~ + --> +<android.support.constraint.ConstraintLayout + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + android:background="@color/alpha_fragment_background_color" + android:layout_width="match_parent" + android:layout_height="match_parent"> + + <androidx.car.widget.PagedListView + android:id="@+id/apps_grid" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_marginTop="@dimen/appbar_height" + android:clickable="true" + android:focusable="true" + app:listContentTopOffset="@dimen/car_padding_5" + app:dayNightStyle="force_night" + app:showPagedListViewDivider="false" /> + +</android.support.constraint.ConstraintLayout> diff --git a/res/layout/fragment_browse.xml b/res/layout/fragment_browse.xml index 0d1e109..508292e 100644 --- a/res/layout/fragment_browse.xml +++ b/res/layout/fragment_browse.xml @@ -24,6 +24,9 @@ android:id="@+id/browse_list" android:layout_width="match_parent" android:layout_height="match_parent" + android:clickable="true" + android:focusable="true" + app:dayNightStyle="force_night" app:showPagedListViewDivider="false"/> </FrameLayout>
\ No newline at end of file diff --git a/res/layout/media_activity.xml b/res/layout/media_activity.xml index bf26aa9..62f3fff 100644 --- a/res/layout/media_activity.xml +++ b/res/layout/media_activity.xml @@ -26,28 +26,16 @@ android:id="@+id/media_background" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="@color/media_template_background" + android:background="@android:color/black" 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:background="@drawable/browse_gradient_scrim" android:alpha="@dimen/media_scrim_darkened_alpha"/> - <View - android:id="@+id/browse_scrim" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:background="@drawable/browse_gradient_scrim"/> - - <com.android.car.media.widgets.AppBarView - android:id="@+id/app_bar" - android:layout_height="@dimen/appbar_height" - android:layout_width="match_parent" - app:layout_constraintTop_toTopOf="parent"/> - <FrameLayout android:id="@+id/fragment_container" android:layout_width="match_parent" @@ -81,4 +69,16 @@ android:layout_weight="0.5"/> </LinearLayout> + + <FrameLayout + android:id="@+id/app_selection_container" + android:layout_width="match_parent" + android:layout_height="match_parent" /> + + <com.android.car.media.widgets.AppBarView + android:id="@+id/app_bar" + android:layout_height="@dimen/appbar_height" + android:layout_width="match_parent" + app:layout_constraintTop_toTopOf="parent"/> + </android.support.constraint.ConstraintLayout> diff --git a/res/layout/media_browse_panel_item.xml b/res/layout/media_browse_panel_item.xml index 28c9033..bf6237c 100644 --- a/res/layout/media_browse_panel_item.xml +++ b/res/layout/media_browse_panel_item.xml @@ -23,8 +23,8 @@ android:orientation="horizontal"> <ImageView android:id="@+id/thumbnail" - android:layout_width="@dimen/car_drawer_list_item_icon_size" - android:layout_height="@dimen/car_drawer_list_item_icon_size" + android:layout_width="@dimen/car_primary_icon_size" + android:layout_height="@dimen/car_primary_icon_size" android:layout_marginEnd="@dimen/car_drawer_list_item_icon_end_margin" android:layout_gravity="center_vertical" android:scaleType="centerCrop" /> diff --git a/res/layout/tab_view.xml b/res/layout/tab_view.xml index b93175e..eff03ea 100644 --- a/res/layout/tab_view.xml +++ b/res/layout/tab_view.xml @@ -24,7 +24,7 @@ android:layout_marginBottom="@dimen/car_padding_0" android:scaleType="fitCenter" android:layout_gravity="center_horizontal" - android:tint="@color/car_tint_inverse"/> + android:tint="@color/car_body5_light"/> <TextView android:id="@+id/title" diff --git a/res/values/colors.xml b/res/values/colors.xml index a3c9bd9..41ebd6e 100644 --- a/res/values/colors.xml +++ b/res/values/colors.xml @@ -31,4 +31,9 @@ <color name="progress_bar_background">@color/car_grey_900</color> <!-- Color used on the progress bar --> <color name="progress_bar_highlight">#fafafa</color> + + <!-- App selection backgroun --> + <color name="alpha_fragment_background_color">#ea000000</color> + <!-- App selection items background --> + <color name="app_item_background_color">#66ffffff</color> </resources> diff --git a/res/values/dimens.xml b/res/values/dimens.xml index 65c654d..cf3e68a 100644 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -54,6 +54,10 @@ <dimen name="browse_tab_width">134dp</dimen> <!-- Browse playback controls size --> <dimen name="browse_playback_controls_height">192dp</dimen> + <!-- Selected tab alpha --> + <item name="browse_tab_alpha_selected" format="float" type="dimen">1</item> + <!-- Unselected tab alpha --> + <item name="browse_tab_alpha_unselected" format="float" type="dimen">0.5</item> <!-- App bar --> <dimen name="appbar_height">112dp</dimen> diff --git a/res/values/integers.xml b/res/values/integers.xml index 13ad859..eac1eef 100644 --- a/res/values/integers.xml +++ b/res/values/integers.xml @@ -15,9 +15,6 @@ limitations under the License. --> <resources> - <!-- The amount of time it takes for a new album image to fade in. --> - <integer name="new_album_art_fade_in_duration">250</integer> - <!-- The maximum number of lines for the title of a currently playing media item. --> <integer name="media_title_max_lines">2</integer> @@ -29,4 +26,10 @@ <!-- Number of columns in the browse view --> <integer name="num_browse_columns">3</integer> + + <!-- Number of columns in app selector --> + <integer name="num_app_selector_columns">3</integer> + + <!-- The amount of time it takes for the app selector to fade in and out --> + <integer name="app_selector_fade_duration">500</integer> </resources> |