• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?xml version="1.0" encoding="utf-8"?>
2<!-- Copyright (C) 2009 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<!-- StateListDrawable used for toggle buttons in the in-call onscreen touch UI. -->
18<selector xmlns:android="http://schemas.android.com/apk/res/android">
19
20    <!-- TODO: For now, we spell out every possible combination of
21         checked/focused/enabled/pressed here, since the assets were
22         created that way.
23         But instead, consider using a <layer-list> here so that the
24         background and the "toggle" indicator can be separate drawables.
25         That way, only the background drawable needs to care about the
26         focused/enabled/pressed state, and only the toggle indicator
27         needs to care about the "checked" state.  This would reduce the
28         number of separate image assets we need by almost half.  (See
29         btn_toggle_bg.xml in the framework for an example of this
30         design.) -->
31
32    <!-- "checked" states -->
33
34    <item android:state_window_focused="false" android:state_enabled="true"
35        android:state_checked="true"
36        android:drawable="@drawable/btn_in_call_switch_on_normal" />
37
38    <item android:state_window_focused="false" android:state_enabled="false"
39        android:state_checked="true"
40        android:drawable="@drawable/btn_in_call_switch_on_disable" />
41
42    <item android:state_pressed="true"
43        android:state_checked="true"
44        android:drawable="@drawable/btn_in_call_switch_on_pressed" />
45
46    <item android:state_focused="true" android:state_enabled="true"
47        android:state_checked="true"
48        android:drawable="@drawable/btn_in_call_switch_on_selected" />
49
50    <item android:state_enabled="true"
51        android:state_checked="true"
52        android:drawable="@drawable/btn_in_call_switch_on_normal" />
53
54    <item android:state_focused="true"
55        android:state_checked="true"
56        android:drawable="@drawable/btn_in_call_switch_on_disable_focused" />
57
58    <item
59        android:state_checked="true"
60        android:drawable="@drawable/btn_in_call_switch_on_disable" />
61
62    <!-- "unchecked" states -->
63
64    <item android:state_window_focused="false" android:state_enabled="true"
65        android:state_checked="false"
66        android:drawable="@drawable/btn_in_call_switch_off_normal" />
67
68    <item android:state_window_focused="false" android:state_enabled="false"
69        android:state_checked="false"
70        android:drawable="@drawable/btn_in_call_switch_off_disable" />
71
72    <item android:state_pressed="true"
73        android:state_checked="false"
74        android:drawable="@drawable/btn_in_call_switch_off_pressed" />
75
76    <item android:state_focused="true" android:state_enabled="true"
77        android:state_checked="false"
78        android:drawable="@drawable/btn_in_call_switch_off_selected" />
79
80    <item android:state_enabled="true"
81        android:state_checked="false"
82        android:drawable="@drawable/btn_in_call_switch_off_normal" />
83
84    <item android:state_focused="true"
85        android:state_checked="false"
86        android:drawable="@drawable/btn_in_call_switch_off_disable_focused" />
87
88    <item
89        android:drawable="@drawable/btn_in_call_switch_off_disable" />
90
91</selector>
92