1 <?xml version="1.0" encoding="utf-8"?> 2 <!-- Copyright (C) 2011 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 <!-- Layers used to render the in-call "Audio mode" compound button. 18 19 This is a multi-mode button: 20 21 - If no bluetooth headset is connected, it behaves like a simple 22 "compound button" that switches the speaker on and off. (This is why 23 the button itself is a ToggleButton instance.) 24 25 - But if a bluetooth headset is connected, this becomes a simple 26 action button (with no concept of a "checked" state) that brings 27 up a popup menu offering you a 3-way choice between earpiece / 28 speaker / bluetooth. 29 30 See InCallTouchUi.updateAudioButton() for the corresponding code. --> 31 32 <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> 33 34 <!-- The standard "compound button" background, used to distinguish 35 between the "checked" and "unchecked" states when this button is 36 simply an on/off toggle for the speaker. 37 (In states where the audio button *not* a toggle, we explicitly 38 hide this layer.) --> 39 <item android:id="@+id/compoundBackgroundItem" 40 android:drawable="@drawable/btn_fake_compound_background" /> 41 42 <!-- The little triangle that indicates that this isn't a plain 43 button, but will instead pop up a menu. This layer is *not* 44 shown when the audio button is simply an on/off toggle. --> 45 <!-- Use an explicit <bitmap> to avoid scaling the icon up to the full 46 size of the button. --> 47 <item android:id="@+id/moreIndicatorItem"> 48 <bitmap android:src="@drawable/ic_more_indicator_holo_dark" 49 android:gravity="center" /> 50 </item> 51 52 <!-- Finally, the button icon. 53 54 When the audio button is simply an on/off toggle for the speaker, 55 the icon is a "speakerphone" regardless of whether the speaker is 56 active. (Instead, the "on/off" indication comes from the 57 btn_compound_background selector.) 58 59 But when the audio button is connected to the 3-way popup menu, 60 we use the button's icon to indicate the current audio mode 61 (i.e. one of { earpiece (or wired headset) , speaker , bluetooth }). 62 63 Here we have separate layers for each possible foreground icon, 64 and in InCallTouchUi.updateAudioButton() we hide them all 65 *except* the one needed for the current state. --> 66 67 <!-- These all use an explicit <bitmap> to avoid scaling the icon up 68 to the full size of the button. --> 69 70 <!-- Bluetooth is active --> 71 <item android:id="@+id/bluetoothItem"> 72 <bitmap android:src="@drawable/ic_sound_bluetooth_holo_dark" 73 android:gravity="center" /> 74 </item> 75 76 77 <!-- Handset earpiece is active --> 78 <item android:id="@+id/handsetItem"> 79 <bitmap android:src="@drawable/ic_sound_handset_holo_dark" 80 android:gravity="center" /> 81 </item> 82 83 <!-- Speakerphone icon showing 'speaker on' state --> 84 <item android:id="@+id/speakerphoneOnItem"> 85 <bitmap android:src="@drawable/ic_sound_speakerphone_holo_dark" 86 android:gravity="center" /> 87 </item> 88 89 <!-- Speakerphone icon showing 'speaker off' state --> 90 <item android:id="@+id/speakerphoneOffItem"> 91 <bitmap android:src="@drawable/ic_sound_off_speakerphone_holo_dark" 92 android:gravity="center" /> 93 </item> 94 95 <!-- Generic "audio mode" icon. Looks almost identical to 96 ic_sound_speakerphone_holo_dark.png --> 97 <!-- TODO: is this actually needed? --> 98 <!-- 99 <item android:id="@+id/soundItem"> 100 <bitmap android:src="@drawable/ic_sound_holo_dark" 101 android:gravity="center" /> 102 </item> 103 --> 104 105 </layer-list> 106