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
This commit is contained in:
Galia Peycheva
2020-09-22 14:46:08 +02:00
parent 0667e27013
commit 5b91ff156c
5 changed files with 82 additions and 7 deletions

View File

@@ -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>

View File

@@ -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>

View File

@@ -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

View File

@@ -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>

View File

@@ -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>