Update the leanback dialog button style.

Bug: 179343577
Test: manual
Change-Id: I8b681213f3f9263f03a7aa02d49693fc2be81da2
This commit is contained in:
Jacqueline Bronger
2021-02-01 10:28:32 +00:00
parent d1fdc4c457
commit 50b5f2fb22
8 changed files with 124 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2021 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.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true"
android:color="@color/btn_leanback_focused" />
<item android:state_enabled="false"
android:color="@android:color/transparent" />
<item android:color="@color/btn_leanback_unfocused" />
</selector>

View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2021 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.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/btn_text_leanback_focused" android:state_focused="true"/>
<item android:color="@color/btn_text_leanback_unfocused"/>
</selector>

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2021 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">
<solid android:color="@color/btn_leanback_color"/>
<corners android:radius="@dimen/leanback_button_radius"/>
</shape>

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (C) 2021 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>
<style name="Widget.DeviceDefault.Button.ButtonBar.AlertDialog"
parent="Widget.Leanback.Button.ButtonBar" />
</resources>

View File

@@ -26,4 +26,9 @@
<color name="secondary_text_leanback_light">#99222222</color>
<color name="primary_text_leanback_formwizard_default_dark">#ffeeeeee</color>
<color name="btn_leanback_focused">#E8EAED</color>
<color name="btn_leanback_unfocused">#1AFFFFFF</color>
<color name="btn_text_leanback_focused">#0E0E0E</color>
<color name="btn_text_leanback_unfocused">#E8EAED</color>
</resources>

View File

@@ -83,4 +83,10 @@
<dimen name="leanback_setup_translation_backward_out_content_end_v4">@integer/leanback_setup_translation_content_cliff_v4</dimen>
<integer name="leanback_setup_translation_backward_out_content_delay">0</integer>
<integer name="leanback_setup_translation_backward_out_content_duration">@integer/leanback_setup_base_animation_duration</integer>
<!-- Button dimens -->
<dimen name="leanback_button_height">42dp</dimen>
<dimen name="leanback_button_radius">55dp</dimen>
<dimen name="leanback_button_padding_horizontal">22dp</dimen>
<dimen name="leanback_button_padding_vertical">11dp</dimen>
</resources>

View File

@@ -21,6 +21,24 @@
<style name="AlertDialog.Leanback.Light">
</style>
<style name="Widget.Leanback.Button" parent="Widget.Material.Button">
<item name="android:background">@drawable/btn_leanback</item>
<item name="android:textColor">@color/btn_leanback_text_color</item>
<item name="android:layout_height">@dimen/leanback_button_height</item>
<item name="android:layout_width">wrap_content</item>
<item name="android:textAllCaps">false</item>
<item name="android:paddingHorizontal">@dimen/leanback_button_padding_horizontal</item>
<item name="android:paddingVertical">@dimen/leanback_button_padding_vertical</item>
</style>
<style name="Widget.Leanback.Button.ButtonBar" parent="Widget.Leanback.Button">
<item name="android:layout_marginStart">10dp</item>
</style>
<style name="Widget.Leanback.ButtonBar" parent="Widget.Material.ButtonBar">
<item name="android:padding">?android:attr/dialogPreferredPadding</item>
</style>
<style name="Widget.Leanback.TimePicker" parent="Widget.Material.TimePicker">
<item name="timePickerMode">spinner</item>
</style>

View File

@@ -22,6 +22,8 @@
<item name="timePickerStyle">@style/Widget.Leanback.TimePicker</item>
<item name="datePickerStyle">@style/Widget.Leanback.DatePicker</item>
<item name="numberPickerStyle">@style/Widget.Leanback.NumberPicker</item>
<item name="buttonBarButtonStyle">@style/Widget.Leanback.Button.ButtonBar</item>
<item name="buttonBarStyle">@style/Widget.Leanback.ButtonBar</item>
</style>
<style name="Theme.Leanback.Light.Dialog" parent="Theme.Material.Light.BaseDialog">
@@ -32,6 +34,8 @@
<item name="timePickerStyle">@style/Widget.Leanback.TimePicker</item>
<item name="datePickerStyle">@style/Widget.Leanback.DatePicker</item>
<item name="numberPickerStyle">@style/Widget.Leanback.NumberPicker</item>
<item name="buttonBarButtonStyle">@style/Widget.Leanback.Button.ButtonBar</item>
<item name="buttonBarStyle">@style/Widget.Leanback.ButtonBar</item>
</style>
<style name="Theme.Leanback.Settings.Dialog" parent="Theme.Material.Settings.BaseDialog">
@@ -42,6 +46,8 @@
<item name="timePickerStyle">@style/Widget.Leanback.TimePicker</item>
<item name="datePickerStyle">@style/Widget.Leanback.DatePicker</item>
<item name="numberPickerStyle">@style/Widget.Leanback.NumberPicker</item>
<item name="buttonBarButtonStyle">@style/Widget.Leanback.Button.ButtonBar</item>
<item name="buttonBarStyle">@style/Widget.Leanback.ButtonBar</item>
</style>
<style name="Theme.Leanback.Dialog.Alert" parent="Theme.Material.Dialog.BaseAlert">
@@ -52,6 +58,8 @@
<item name="timePickerStyle">@style/Widget.Leanback.TimePicker</item>
<item name="datePickerStyle">@style/Widget.Leanback.DatePicker</item>
<item name="numberPickerStyle">@style/Widget.Leanback.NumberPicker</item>
<item name="buttonBarButtonStyle">@style/Widget.Leanback.Button.ButtonBar</item>
<item name="buttonBarStyle">@style/Widget.Leanback.ButtonBar</item>
</style>
<style name="Theme.Leanback.Light.Dialog.Alert" parent="Theme.Material.Light.Dialog.BaseAlert">
@@ -62,6 +70,8 @@
<item name="timePickerStyle">@style/Widget.Leanback.TimePicker</item>
<item name="datePickerStyle">@style/Widget.Leanback.DatePicker</item>
<item name="numberPickerStyle">@style/Widget.Leanback.NumberPicker</item>
<item name="buttonBarButtonStyle">@style/Widget.Leanback.Button.ButtonBar</item>
<item name="buttonBarStyle">@style/Widget.Leanback.ButtonBar</item>
</style>
<style name="Theme.Leanback.Settings.Dialog.Alert" parent="Theme.Material.Settings.Dialog.BaseAlert">
@@ -72,6 +82,8 @@
<item name="timePickerStyle">@style/Widget.Leanback.TimePicker</item>
<item name="datePickerStyle">@style/Widget.Leanback.DatePicker</item>
<item name="numberPickerStyle">@style/Widget.Leanback.NumberPicker</item>
<item name="buttonBarButtonStyle">@style/Widget.Leanback.Button.ButtonBar</item>
<item name="buttonBarStyle">@style/Widget.Leanback.ButtonBar</item>
</style>
<style name="Theme.Leanback.Dialog.AppError" parent="Theme.Leanback.Dialog">