Update text color on MainSwitch

Update text color to match Android U color spec. Ref: https://www.figma.com/file/K1w851oavFoPBj1PR31eNF/Android-U-SysUI-Color-Specs?type=design&node-id=25-46825&t=zcgAaU1wt40pgMBB-11

Bug: 281388368

Test: manul visual test
Change-Id: Id0ca56cc91fb724bfdff2982b0857134cd54951d
This commit is contained in:
David Liu
2023-05-11 18:07:40 +00:00
parent 325a4e206c
commit 4a6f89a36e
11 changed files with 265 additions and 2 deletions

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2023 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_enabled="false"
android:color="@android:color/system_accent1_100"
android:alpha="?android:attr/disabledAlpha" />
<item android:color="@android:color/system_accent1_100"/>
</selector>

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2023 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_enabled="false"
android:color="@android:color/black"
android:alpha="?android:attr/disabledAlpha" />
<item android:color="@android:color/black"/>
</selector>

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2023 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_enabled="false"
android:color="@android:color/system_accent1_900"
android:alpha="?android:attr/disabledAlpha" />
<item android:color="@android:color/system_accent1_900"/>
</selector>

View File

@@ -20,6 +20,6 @@
<style name="MainSwitchText.Settingslib" parent="@android:style/TextAppearance.DeviceDefault.Widget.ActionBar.Title.Inverse">
<item name="android:textSize">20sp</item>
<item name="android:fontFamily">@string/settingslib_config_headlineFontFamily</item>
<item name="android:textColor">@android:color/black</item>
<item name="android:textColor">@color/settingslib_main_switch_text_color</item>
</style>
</resources>

View File

@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2023 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">
<!-- Disabled status of thumb -->
<item android:state_enabled="false"
android:color="@android:color/system_neutral2_400"
android:alpha="?android:attr/disabledAlpha" />
<!-- Toggle off status of thumb -->
<item android:state_checked="false"
android:color="@android:color/system_neutral2_400" />
<!-- Enabled or toggle on status of thumb -->
<item android:color="@color/settingslib_track_on_color" />
</selector>

View File

@@ -17,7 +17,8 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Disabled status of thumb -->
<item android:state_enabled="false"
android:color="@color/settingslib_thumb_disabled_color" />
android:color="@color/settingslib_thumb_disabled_color"
android:alpha="?android:attr/disabledAlpha" />
<!-- Toggle off status of thumb -->
<item android:state_checked="false"
android:color="@color/settingslib_thumb_off_color" />

View File

@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2023 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">
<!-- Disabled status of thumb -->
<item android:state_enabled="false"
android:color="@color/settingslib_thumb_disabled_color"
android:alpha="?android:attr/disabledAlpha" />
<!-- Toggle off status of thumb -->
<item android:state_checked="false"
android:color="@color/settingslib_thumb_off_color" />
<!-- Enabled or toggle on status of thumb -->
<item android:color="@color/settingslib_thumb_on_color" />
</selector>

View File

@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2023 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">
<!-- Disabled status of thumb -->
<item android:state_enabled="false"
android:color="@android:color/system_neutral2_500"
android:alpha="?android:attr/disabledAlpha" />
<!-- Toggle off status of thumb -->
<item android:state_checked="false"
android:color="@android:color/system_neutral2_500" />
<!-- Enabled or toggle on status of thumb -->
<item android:color="@color/settingslib_track_on_color" />
</selector>

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2023 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"
android:width="52dp"
android:height="28dp">
<solid android:color="@color/settingslib_switch_track_color" />
<corners android:radius="35dp" />
<stroke android:width="2dp" android:color="@color/settingslib_track_online_color"/>
</shape>

View File

@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2023 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>
<!-- Material next state on color-->
<color name="settingslib_state_on_color">@android:color/system_accent1_700</color>
<!-- Material next state off color-->
<color name="settingslib_state_off_color">@android:color/system_accent1_700</color>
<!-- Material next thumb disable color-->
<color name="settingslib_thumb_disabled_color">@color/settingslib_thumb_off_color</color>
<!-- Material next thumb off color-->
<color name="settingslib_thumb_on_color">@android:color/system_accent1_800</color>
<!-- Material next thumb off color-->
<color name="settingslib_thumb_off_color">@android:color/system_neutral2_400</color>
<!-- Material next track on color-->
<color name="settingslib_track_on_color">@android:color/system_accent1_200</color>
<!-- Material next track off color-->
<color name="settingslib_track_off_color">@android:color/system_surface_container_highest_dark
</color>
</resources>

View File

@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2023 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>
<!-- Material next state on color-->
<color name="settingslib_state_on_color">@android:color/system_accent1_100</color>
<!-- Material next state off color-->
<color name="settingslib_state_off_color">@android:color/system_accent1_100</color>
<!-- Material next thumb disable color-->
<color name="settingslib_thumb_disabled_color">@color/settingslib_thumb_off_color</color>
<!-- Material next thumb off color-->
<color name="settingslib_thumb_on_color">@android:color/system_accent1_0</color>
<!-- Material next thumb off color-->
<color name="settingslib_thumb_off_color">@android:color/system_neutral2_500</color>
<!-- Material next track on color-->
<color name="settingslib_track_on_color">@android:color/system_accent1_600</color>
<!-- Material next track off color-->
<color name="settingslib_track_off_color">@android:color/system_surface_container_highest_light</color>
<!-- Material next track outline color-->
<color name="settingslib_track_online_color">@color/settingslib_switch_track_outline_color</color>
</resources>