Merge "Create DialogTheme for Theme.SubSettingsBase" into sc-dev

This commit is contained in:
Edgar Wang
2021-06-04 10:25:07 +00:00
committed by Android (Google) Code Review
4 changed files with 46 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2020 The Android Open Source Project
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.
@@ -15,7 +15,7 @@
limitations under the License.
-->
<resources xmlns:androidprv="http://schemas.android.com/apk/prv/res/android">
<resources>
<!-- Material next thumb off color-->
<color name="settingslib_thumb_off_color">@android:color/system_neutral2_300</color>
@@ -24,4 +24,11 @@
<!-- Material next track off color-->
<color name="settingslib_track_off_color">@android:color/system_neutral1_700</color>
<!-- Dialog accent color -->
<color name="settingslib_dialog_accent">@android:color/system_accent1_100</color>
<!-- Dialog background color. -->
<color name="settingslib_dialog_background">@android:color/system_neutral1_800</color>
<!-- Dialog error color. -->
<color name="settingslib_dialog_colorError">#f28b82</color> <!-- Red 300 -->
</resources>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2020 The Android Open Source Project
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.
@@ -30,4 +30,11 @@
<!-- Material next track off color-->
<color name="settingslib_track_off_color">@android:color/system_neutral2_600</color>
<!-- Dialog accent color -->
<color name="settingslib_dialog_accent">@android:color/system_accent1_600</color>
<!-- Dialog background color -->
<color name="settingslib_dialog_background">@android:color/system_neutral1_800</color>
<!-- Dialog error color. -->
<color name="settingslib_dialog_colorError">#d93025</color> <!-- Red 600 -->
</resources>

View File

@@ -33,5 +33,20 @@
<!-- Set up edge-to-edge configuration for top app bar -->
<item name="android:navigationBarColor">@android:color/transparent</item>
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="colorControlNormal">?android:attr/colorControlNormal</item>
<!-- For AndroidX AlertDialog -->
<item name="alertDialogTheme">@style/Theme.AlertDialog.SettingsLib</item>
</style>
<style name="Theme.AlertDialog.SettingsLib" parent="@style/Theme.AppCompat.DayNight.Dialog.Alert">
<item name="colorAccent">@*android:color/accent_device_default_light</item>
<item name="android:colorError">@color/settingslib_dialog_colorError</item>
<item name="android:colorBackground">@color/settingslib_dialog_background</item>
<item name="android:windowSoftInputMode">adjustResize</item>
<item name="android:clipToPadding">true</item>
<item name="android:clipChildren">true</item>
<item name="dialogCornerRadius">@*android:dimen/config_dialogCornerRadius</item>
</style>
</resources>

View File

@@ -26,5 +26,19 @@
<!-- Suppress the built-in action bar -->
<item name="android:windowActionBar">false</item>
<item name="android:windowNoTitle">true</item>
<item name="colorControlNormal">?android:attr/colorControlNormal</item>
<!-- For AndroidX AlertDialog -->
<item name="alertDialogTheme">@style/Theme.AlertDialog.SettingsLib</item>
</style>
<style name="Theme.AlertDialog.SettingsLib" parent="@style/Theme.AppCompat.DayNight.Dialog.Alert">
<!-- TODO(b/189308264): fix the crash in Android R if set the attributes:
<item name="colorAccent">@*android:color/accent_device_default_light</item>
<item name="android:colorBackground">@color/settingslib_dialog_background</item>
<item name="dialogCornerRadius">@*android:dimen/config_dialogCornerRadius</item>
-->
<item name="android:windowSoftInputMode">adjustResize</item>
<item name="android:clipToPadding">true</item>
<item name="android:clipChildren">true</item>
</style>
</resources>