diff options
| author | 2021-06-10 12:56:21 +0000 | |
|---|---|---|
| committer | 2021-06-10 12:56:21 +0000 | |
| commit | fbaec9bd4dc605fc0166857223f88c243cafaf15 (patch) | |
| tree | b3ac205fabe3754de488b1714532e044d3d7c8b2 | |
| parent | 50ae7cbf1bdd18a23c14b82037af9705c4524470 (diff) | |
| parent | d611f676d30a03c613ad6ed92440b08879765886 (diff) | |
Merge "Set progressBarHorizontal style in Theme.SettingsBase" into sc-dev
5 files changed, 48 insertions, 0 deletions
diff --git a/packages/SettingsLib/SettingsTheme/res/drawable-v31/settingslib_progress_horizontal.xml b/packages/SettingsLib/SettingsTheme/res/drawable-v31/settingslib_progress_horizontal.xml new file mode 100644 index 000000000000..a4c780bc20de --- /dev/null +++ b/packages/SettingsLib/SettingsTheme/res/drawable-v31/settingslib_progress_horizontal.xml @@ -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> diff --git a/packages/SettingsLib/SettingsTheme/res/values-night-v31/colors.xml b/packages/SettingsLib/SettingsTheme/res/values-night-v31/colors.xml index 426a2ba447f2..69975cd2dad5 100644 --- a/packages/SettingsLib/SettingsTheme/res/values-night-v31/colors.xml +++ b/packages/SettingsLib/SettingsTheme/res/values-night-v31/colors.xml @@ -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>
\ No newline at end of file diff --git a/packages/SettingsLib/SettingsTheme/res/values-v31/colors.xml b/packages/SettingsLib/SettingsTheme/res/values-v31/colors.xml index fcba6bd95cb6..aed6338495f0 100644 --- a/packages/SettingsLib/SettingsTheme/res/values-v31/colors.xml +++ b/packages/SettingsLib/SettingsTheme/res/values-v31/colors.xml @@ -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> diff --git a/packages/SettingsLib/SettingsTheme/res/values-v31/styles.xml b/packages/SettingsLib/SettingsTheme/res/values-v31/styles.xml index e3a023995e76..9610c9443184 100644 --- a/packages/SettingsLib/SettingsTheme/res/values-v31/styles.xml +++ b/packages/SettingsLib/SettingsTheme/res/values-v31/styles.xml @@ -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> diff --git a/packages/SettingsLib/SettingsTheme/res/values-v31/themes.xml b/packages/SettingsLib/SettingsTheme/res/values-v31/themes.xml index b3378b201f4d..b5cf36881643 100644 --- a/packages/SettingsLib/SettingsTheme/res/values-v31/themes.xml +++ b/packages/SettingsLib/SettingsTheme/res/values-v31/themes.xml @@ -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 --> |