summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Galia Peycheva <galinap@google.com> 2020-09-22 14:46:08 +0200
committer Galia Peycheva <galinap@google.com> 2020-09-24 11:39:16 +0200
commit5b91ff156ceb82a85e3bcf6786d535ccae0746e6 (patch)
treeba3e557c0b4399191c9a8e015a35df5e388621b7
parent0667e2701316e0d150db963b346b428829e68856 (diff)
Adjust volume ui on TV
1. Add dedicated drawable for the seek bar track 2. Add dedicated drawable for the seek bar thumb with appropriate focus ring and shadow 3. Adjust dps and colors according to mock Bug: 167732325 Test: m & flash & verify that looks like the mock Change-Id: I7827c622da4e76726c5d7ee52185bf7554b894c7
-rw-r--r--packages/SystemUI/res/drawable/tv_volume_row_seek_bar.xml32
-rw-r--r--packages/SystemUI/res/drawable/tv_volume_row_seek_thumb.xml26
-rw-r--r--packages/SystemUI/res/layout-land-television/volume_dialog_row.xml8
-rw-r--r--packages/SystemUI/res/values-land-television/dimens.xml19
-rw-r--r--packages/SystemUI/res/values/colors_tv.xml4
5 files changed, 82 insertions, 7 deletions
diff --git a/packages/SystemUI/res/drawable/tv_volume_row_seek_bar.xml b/packages/SystemUI/res/drawable/tv_volume_row_seek_bar.xml
new file mode 100644
index 000000000000..fe76b639f15a
--- /dev/null
+++ b/packages/SystemUI/res/drawable/tv_volume_row_seek_bar.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2020 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.
+-->
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:id="@android:id/background">
+ <shape android:shape="rectangle">
+ <solid android:color="@color/tv_volume_dialog_seek_bar_background" />
+ <corners android:radius="@dimen/tv_volume_seek_bar_width" />
+ </shape>
+ </item>
+ <item android:id="@android:id/progress">
+ <clip>
+ <shape android:shape="rectangle">
+ <solid android:color="@color/tv_volume_dialog_seek_bar_fill" />
+ <corners android:radius="@dimen/tv_volume_seek_bar_width" />
+ </shape>
+ </clip>
+ </item>
+</layer-list>
diff --git a/packages/SystemUI/res/drawable/tv_volume_row_seek_thumb.xml b/packages/SystemUI/res/drawable/tv_volume_row_seek_thumb.xml
new file mode 100644
index 000000000000..588782ddf316
--- /dev/null
+++ b/packages/SystemUI/res/drawable/tv_volume_row_seek_thumb.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2020 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="oval">
+ <solid android:color="@color/tv_volume_dialog_accent" />
+ <size android:width="@dimen/tv_volume_seek_bar_thumb_diameter"
+ android:height="@dimen/tv_volume_seek_bar_thumb_diameter" />
+ <stroke android:width="@dimen/tv_volume_seek_bar_thumb_focus_ring_width"
+ android:color="@color/tv_volume_dialog_seek_thumb_focus_ring"/>
+ <item name="android:shadowColor">@color/tv_volume_dialog_seek_thumb_shadow</item>
+ <item name="android:shadowRadius">@dimen/tv_volume_seek_bar_thumb_shadow_radius</item>
+ <item name="android:shadowDy">@dimen/tv_volume_seek_bar_thumb_shadow_dy</item>
+</shape>
diff --git a/packages/SystemUI/res/layout-land-television/volume_dialog_row.xml b/packages/SystemUI/res/layout-land-television/volume_dialog_row.xml
index d28d5664d725..4f6cb0140d09 100644
--- a/packages/SystemUI/res/layout-land-television/volume_dialog_row.xml
+++ b/packages/SystemUI/res/layout-land-television/volume_dialog_row.xml
@@ -40,7 +40,7 @@
android:fontFeatureSettings="tnum"
android:background="@drawable/tv_volume_dialog_circle"
android:textSize="@dimen/tv_volume_number_text_size"
- android:textColor="@color/accent_tint_color_selector"/>
+ android:textColor="@color/tv_volume_dialog_accent"/>
<TextView
android:id="@+id/volume_row_header"
android:layout_width="wrap_content"
@@ -61,6 +61,12 @@
android:layout_width="@dimen/volume_dialog_row_height"
android:layout_height="match_parent"
android:layout_gravity="center"
+ android:layoutDirection="ltr"
+ android:maxHeight="@dimen/tv_volume_seek_bar_width"
+ android:minHeight="@dimen/tv_volume_seek_bar_width"
+ android:thumb="@drawable/tv_volume_row_seek_thumb"
+ android:progressDrawable="@drawable/tv_volume_row_seek_bar"
+ android:splitTrack="false"
android:rotation="270" />
</FrameLayout>
<com.android.keyguard.AlphaOptimizedImageButton
diff --git a/packages/SystemUI/res/values-land-television/dimens.xml b/packages/SystemUI/res/values-land-television/dimens.xml
index 8237919990de..9502e09e22be 100644
--- a/packages/SystemUI/res/values-land-television/dimens.xml
+++ b/packages/SystemUI/res/values-land-television/dimens.xml
@@ -16,10 +16,17 @@
<resources>
<!-- Height of volume bar -->
- <dimen name="volume_dialog_row_height">200dp</dimen>
- <dimen name="volume_dialog_panel_transparent_padding">17dp</dimen>
- <dimen name="tv_volume_dialog_bubble_size">36dp</dimen>
- <dimen name="tv_volume_dialog_corner_radius">40dp</dimen>
- <dimen name="tv_volume_dialog_row_padding">5dp</dimen>
- <dimen name="tv_volume_number_text_size">16dp</dimen>
+ <dimen name="volume_dialog_row_height">224dp</dimen>
+ <dimen name="volume_dialog_row_width">58dp</dimen>
+ <dimen name="volume_dialog_panel_transparent_padding">20dp</dimen>
+ <dimen name="tv_volume_dialog_bubble_size">42dp</dimen>
+ <dimen name="tv_volume_dialog_corner_radius">42dp</dimen>
+ <dimen name="tv_volume_dialog_row_padding">8dp</dimen>
+ <dimen name="tv_volume_number_text_size">19sp</dimen>
+ <dimen name="tv_volume_seek_bar_width">5dp</dimen>
+ <dimen name="tv_volume_seek_bar_thumb_diameter">30dp</dimen>
+ <dimen name="tv_volume_seek_bar_thumb_focus_ring_width">11dp</dimen>
+ <dimen name="tv_volume_icons_size">24dp</dimen>
+ <dimen name="tv_volume_seek_bar_thumb_shadow_radius">4.0</dimen>
+ <dimen name="tv_volume_seek_bar_thumb_shadow_dy">4.0</dimen>
</resources>
diff --git a/packages/SystemUI/res/values/colors_tv.xml b/packages/SystemUI/res/values/colors_tv.xml
index cb49918e4e3f..22b09b31b867 100644
--- a/packages/SystemUI/res/values/colors_tv.xml
+++ b/packages/SystemUI/res/values/colors_tv.xml
@@ -30,5 +30,9 @@
<color name="red">#FFCC0000</color>
<color name="tv_volume_dialog_background">#E61F232B</color>
<color name="tv_volume_dialog_circle">#08FFFFFF</color>
+ <color name="tv_volume_dialog_seek_thumb_focus_ring">#1AFFFFFF</color>
+ <color name="tv_volume_dialog_seek_thumb_shadow">#40000000</color>
+ <color name="tv_volume_dialog_seek_bar_background">#193C4043</color>
+ <color name="tv_volume_dialog_seek_bar_fill">#FFF8F9FA</color>
<color name="tv_volume_dialog_accent">#FFDADCE0</color>
</resources>