Set progressBarHorizontal style in Theme.SettingsBase

- Moving theme and style from Settings

Bug: 190467533
Test: manual
Change-Id: Id73e779f784b5280104590a81c157be07a35cb1a
This commit is contained in:
Edgar Wang
2021-06-08 20:07:43 +08:00
parent ed0ba6363b
commit d611f676d3
5 changed files with 48 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
<?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.
-->
<layer-list
xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@android:id/background">
<shape>
<corners android:radius="8dp" />
<solid android:color="@color/settingslib_colorSurfaceVariant" />
</shape>
</item>
<item
android:id="@android:id/progress">
<clip>
<shape>
<corners android:radius="8dp" />
<solid android:color="?android:attr/textColorPrimary" />
</shape>
</clip>
</item>
</layer-list>

View File

@@ -31,4 +31,6 @@
<color name="settingslib_dialog_background">@android:color/system_neutral1_800</color>
<!-- Dialog error color. -->
<color name="settingslib_dialog_colorError">#f28b82</color> <!-- Red 300 -->
<color name="settingslib_colorSurfaceVariant">@android:color/system_neutral1_700</color>
</resources>

View File

@@ -37,4 +37,6 @@
<color name="settingslib_dialog_background">@android:color/system_neutral1_800</color>
<!-- Dialog error color. -->
<color name="settingslib_dialog_colorError">#d93025</color> <!-- Red 600 -->
<color name="settingslib_colorSurfaceVariant">@android:color/system_neutral2_100</color>
</resources>

View File

@@ -28,4 +28,10 @@
<item name="android:track">@drawable/settingslib_switch_track</item>
<item name="android:thumb">@drawable/settingslib_switch_thumb</item>
</style>
<style name="HorizontalProgressBar.SettingsLib"
parent="android:style/Widget.Material.ProgressBar.Horizontal">
<item name="android:progressDrawable">@drawable/settingslib_progress_horizontal</item>
<item name="android:scaleY">0.5</item>
</style>
</resources>

View File

@@ -23,6 +23,7 @@
<item name="android:listPreferredItemPaddingEnd">16dp</item>
<item name="preferenceTheme">@style/PreferenceTheme.SettingsLib</item>
<item name="android:switchStyle">@style/Switch.SettingsLib</item>
<item name="android:progressBarStyleHorizontal">@style/HorizontalProgressBar.SettingsLib</item>
</style>
<!-- Using in SubSettings page including injected settings page -->