summaryrefslogtreecommitdiff
path: root/InCallUI/res/drawable/btn_compound_audio.xml
blob: 51dc2c59efbf663f9c92438a01b2fa7f9c1db81a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2011 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.
-->

<!-- Layers used to render the in-call "Audio mode" compound button.

     This is a multi-mode button:

     - If no bluetooth headset is connected, it behaves like a simple
       "compound button" that switches the speaker on and off.  (This is why
       the button itself is a ToggleButton instance.)

     - But if a bluetooth headset is connected, this becomes a simple
       action button (with no concept of a "checked" state) that brings
       up a popup menu offering you a 3-way choice between earpiece /
       speaker / bluetooth.

     See InCallTouchUi.updateAudioButton() for the corresponding code. -->

<layer-list xmlns:android="http://schemas.android.com/apk/res/android">

    <!-- The standard "compound button" background, used to distinguish
         between the "checked" and "unchecked" states when this button is
         simply an on/off toggle for the speaker.
         (In states where the audio button *not* a toggle, we explicitly
         hide this layer.) -->
    <item android:id="@+id/compoundBackgroundItem"
          android:drawable="@drawable/btn_compound_background" />

    <!-- The little triangle that indicates that this isn't a plain
         button, but will instead pop up a menu.  This layer is *not*
         shown when the audio button is simply an on/off toggle. -->
    <!-- Use an explicit <bitmap> to avoid scaling the icon up to the full
         size of the button. -->
    <item android:id="@+id/moreIndicatorItem">
        <bitmap android:src="@drawable/ic_more_indicator_holo_dark"
                android:gravity="center"
                android:tint="@color/selectable_icon_tint" />
    </item>

    <!-- Finally, the button icon.

         When the audio button is simply an on/off toggle for the speaker,
         the icon is a "speakerphone" regardless of whether the speaker is
         active.  (Instead, the "on/off" indication comes from the
         btn_compound_background selector.)

         But when the audio button is connected to the 3-way popup menu,
         we use the button's icon to indicate the current audio mode
         (i.e. one of { earpiece (or wired headset) , speaker , bluetooth }).

         Here we have separate layers for each possible foreground icon,
         and in InCallTouchUi.updateAudioButton() we hide them all
         *except* the one needed for the current state. -->

    <!-- These all use an explicit <bitmap> to avoid scaling the icon up
         to the full size of the button. -->

    <!-- Bluetooth is active -->
    <item android:id="@+id/bluetoothItem">
        <bitmap android:src="@drawable/ic_sound_bluetooth_holo_dark"
                android:gravity="center"
                android:tint="@color/selectable_icon_tint"  />
    </item>


    <!-- Handset earpiece is active -->
    <item android:id="@+id/handsetItem">
        <bitmap android:src="@drawable/ic_sound_handset_holo_dark"
                android:gravity="center"
                android:tint="@color/selectable_icon_tint" />
    </item>

    <!-- Speakerphone icon showing 'speaker on' state -->
    <item android:id="@+id/speakerphoneOnItem">
        <bitmap android:src="@drawable/ic_sound_speakerphone_holo_dark"
                android:gravity="center"
                android:tint="@color/selectable_icon_tint" />
    </item>

    <!-- Speakerphone icon showing 'speaker off' state -->
    <item android:id="@+id/speakerphoneOffItem">
        <bitmap android:src="@drawable/ic_sound_off_speakerphone_holo_dark"
                android:gravity="center"
                android:tint="@color/selectable_icon_tint" />
    </item>

    <!-- Generic "audio mode" icon.  Looks almost identical to
         ic_sound_speakerphone_holo_dark.png -->
    <!-- TODO: is this actually needed? -->
    <!--
        <item android:id="@+id/soundItem">
            <bitmap android:src="@drawable/ic_sound_holo_dark"
                    android:gravity="center" />
        </item>
    -->

</layer-list>