Skip to content

Commit

Permalink
[Switch] Add thumb icon tint to the new switch styles
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 451422588
  • Loading branch information
drchen authored and pekingme committed May 31, 2022
1 parent 69e484d commit 2f33cfc
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2022 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">
<!-- State Disabled, Unchecked -->
<item
android:alpha="@dimen/m3_comp_switch_disabled_unselected_icon_opacity"
android:color="@macro/m3_comp_switch_disabled_unselected_icon_color"
android:state_enabled="false" android:state_checked="false"/>

<!-- State Disabled, Checked -->
<item
android:alpha="@dimen/m3_comp_switch_disabled_selected_icon_opacity"
android:color="@macro/m3_comp_switch_disabled_selected_icon_color"
android:state_enabled="false" android:state_checked="true"/>

<!-- State Checked -->
<item android:color="@macro/m3_comp_switch_selected_icon_color" android:state_checked="true"/>

<!-- State Unchecked -->
<item android:color="@macro/m3_comp_switch_unselected_icon_color"/>
</selector>
Expand Up @@ -19,6 +19,7 @@
<item name="track">@drawable/mtrl_switch_track</item>
<item name="trackDecoration">@drawable/mtrl_switch_track_decoration</item>
<item name="thumbTint">@color/mtrl_switch_thumb_tint</item>
<item name="thumbIconTint">@color/mtrl_switch_thumb_icon_tint</item>
<item name="trackTint">@color/mtrl_switch_track_tint</item>
<item name="trackDecorationTint">@color/mtrl_switch_track_decoration_tint</item>
<item name="switchPadding">@dimen/mtrl_switch_text_padding</item>
Expand Down

0 comments on commit 2f33cfc

Please sign in to comment.