1<?xml version="1.0" encoding="utf-8"?> 2<!-- Copyright (C) 2014 The Android Open Source Project 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15--> 16 17<animated-selector xmlns:android="http://schemas.android.com/apk/res/android" 18 android:constantSize="true"> 19 <item android:state_enabled="false" android:id="@+id/off"> 20 <nine-patch 21 android:src="@drawable/btn_switch_to_on_mtrl_00001" 22 android:gravity="center" 23 android:tintMode="multiply" 24 android:tint="?attr/colorSwitchThumbNormal" /> 25 </item> 26 <item 27 android:state_checked="true" 28 android:id="@+id/on"> 29 <nine-patch 30 android:src="@drawable/btn_switch_to_on_mtrl_00012" 31 android:gravity="center" 32 android:tintMode="multiply" 33 android:tint="?attr/colorControlActivated" /> 34 </item> 35 <item android:id="@+id/off"> 36 <nine-patch 37 android:src="@drawable/btn_switch_to_on_mtrl_00001" 38 android:gravity="center" 39 android:tintMode="multiply" 40 android:tint="?attr/colorSwitchThumbNormal" /> 41 </item> 42 <transition 43 android:fromId="@+id/off" 44 android:toId="@+id/on"> 45 <animation-list> 46 <item android:duration="15"> 47 <nine-patch android:src="@drawable/btn_switch_to_on_mtrl_00001" android:gravity="center" android:tintMode="multiply" android:tint="?attr/colorSwitchThumbNormal" /> 48 </item> 49 <item android:duration="15"> 50 <nine-patch android:src="@drawable/btn_switch_to_on_mtrl_00002" android:gravity="center" android:tintMode="multiply" android:tint="?attr/colorSwitchThumbNormal" /> 51 </item> 52 <item android:duration="15"> 53 <nine-patch android:src="@drawable/btn_switch_to_on_mtrl_00003" android:gravity="center" android:tintMode="multiply" android:tint="?attr/colorSwitchThumbNormal" /> 54 </item> 55 <item android:duration="15"> 56 <nine-patch android:src="@drawable/btn_switch_to_on_mtrl_00004" android:gravity="center" android:tintMode="multiply" android:tint="?attr/colorSwitchThumbNormal" /> 57 </item> 58 <item android:duration="15"> 59 <nine-patch android:src="@drawable/btn_switch_to_on_mtrl_00005" android:gravity="center" android:tintMode="multiply" android:tint="?attr/colorSwitchThumbNormal" /> 60 </item> 61 <item android:duration="15"> 62 <nine-patch android:src="@drawable/btn_switch_to_on_mtrl_00006" android:gravity="center" android:tintMode="multiply" android:tint="?attr/colorSwitchThumbNormal" /> 63 </item> 64 <item android:duration="15"> 65 <nine-patch android:src="@drawable/btn_switch_to_on_mtrl_00007" android:gravity="center" android:tintMode="multiply" android:tint="?attr/colorControlActivated" /> 66 </item> 67 <item android:duration="15"> 68 <nine-patch android:src="@drawable/btn_switch_to_on_mtrl_00008" android:gravity="center" android:tintMode="multiply" android:tint="?attr/colorControlActivated" /> 69 </item> 70 <item android:duration="15"> 71 <nine-patch android:src="@drawable/btn_switch_to_on_mtrl_00009" android:gravity="center" android:tintMode="multiply" android:tint="?attr/colorControlActivated" /> 72 </item> 73 <item android:duration="15"> 74 <nine-patch android:src="@drawable/btn_switch_to_on_mtrl_00010" android:gravity="center" android:tintMode="multiply" android:tint="?attr/colorControlActivated" /> 75 </item> 76 <item android:duration="15"> 77 <nine-patch android:src="@drawable/btn_switch_to_on_mtrl_00011" android:gravity="center" android:tintMode="multiply" android:tint="?attr/colorControlActivated" /> 78 </item> 79 <item android:duration="15"> 80 <nine-patch android:src="@drawable/btn_switch_to_on_mtrl_00012" android:gravity="center" android:tintMode="multiply" android:tint="?attr/colorControlActivated" /> 81 </item> 82 </animation-list> 83 </transition> 84 <transition android:fromId="@+id/on" android:toId="@+id/off"> 85 <animation-list> 86 <item android:duration="15"> 87 <nine-patch android:src="@drawable/btn_switch_to_off_mtrl_00001" android:gravity="center" android:tintMode="multiply" android:tint="?attr/colorControlActivated" /> 88 </item> 89 <item android:duration="15"> 90 <nine-patch android:src="@drawable/btn_switch_to_off_mtrl_00002" android:gravity="center" android:tintMode="multiply" android:tint="?attr/colorControlActivated" /> 91 </item> 92 <item android:duration="15"> 93 <nine-patch android:src="@drawable/btn_switch_to_off_mtrl_00003" android:gravity="center" android:tintMode="multiply" android:tint="?attr/colorControlActivated" /> 94 </item> 95 <item android:duration="15"> 96 <nine-patch android:src="@drawable/btn_switch_to_off_mtrl_00004" android:gravity="center" android:tintMode="multiply" android:tint="?attr/colorControlActivated" /> 97 </item> 98 <item android:duration="15"> 99 <nine-patch android:src="@drawable/btn_switch_to_off_mtrl_00005" android:gravity="center" android:tintMode="multiply" android:tint="?attr/colorControlActivated" /> 100 </item> 101 <item android:duration="15"> 102 <nine-patch android:src="@drawable/btn_switch_to_off_mtrl_00006" android:gravity="center" android:tintMode="multiply" android:tint="?attr/colorControlActivated" /> 103 </item> 104 <item android:duration="15"> 105 <nine-patch android:src="@drawable/btn_switch_to_off_mtrl_00007" android:gravity="center" android:tintMode="multiply" android:tint="?attr/colorSwitchThumbNormal" /> 106 </item> 107 <item android:duration="15"> 108 <nine-patch android:src="@drawable/btn_switch_to_off_mtrl_00008" android:gravity="center" android:tintMode="multiply" android:tint="?attr/colorSwitchThumbNormal" /> 109 </item> 110 <item android:duration="15"> 111 <nine-patch android:src="@drawable/btn_switch_to_off_mtrl_00009" android:gravity="center" android:tintMode="multiply" android:tint="?attr/colorSwitchThumbNormal" /> 112 </item> 113 <item android:duration="15"> 114 <nine-patch android:src="@drawable/btn_switch_to_off_mtrl_00010" android:gravity="center" android:tintMode="multiply" android:tint="?attr/colorSwitchThumbNormal" /> 115 </item> 116 <item android:duration="15"> 117 <nine-patch android:src="@drawable/btn_switch_to_off_mtrl_00011" android:gravity="center" android:tintMode="multiply" android:tint="?attr/colorSwitchThumbNormal" /> 118 </item> 119 <item android:duration="15"> 120 <nine-patch android:src="@drawable/btn_switch_to_off_mtrl_00012" android:gravity="center" android:tintMode="multiply" android:tint="?attr/colorSwitchThumbNormal" /> 121 </item> 122 </animation-list> 123 </transition> 124</animated-selector> 125