diff options
author | Andrew Lee <anwlee@google.com> | 2014-05-01 16:52:01 -0700 |
---|---|---|
committer | Andrew Lee <anwlee@google.com> | 2014-05-01 17:06:57 -0700 |
commit | 9329f6b15b6692187ed69ed8f26d22724bf4ac2a (patch) | |
tree | 538fdaef72384efe43c6705e0cb955a2a8db6ef6 /InCallUI | |
parent | fed16a420cb5ca4b98e74a69a91776a99c22c395 (diff) |
Add fancier press states for buttons.
- Add tint color, which applies 60% opacity in default state.
- Apply tint to dialer call buttons.
- Convert add, swap, and merge icons into drawables.
Bug: 14108639
Change-Id: Id9c08ccb035958e51d28255b8c13644c6c5fca73
Diffstat (limited to 'InCallUI')
-rw-r--r-- | InCallUI/res/color/selectable_icon_tint.xml | 23 | ||||
-rw-r--r-- | InCallUI/res/drawable/btn_add.xml | 29 | ||||
-rw-r--r-- | InCallUI/res/drawable/btn_background.xml | 29 | ||||
-rw-r--r-- | InCallUI/res/drawable/btn_compound_audio.xml | 15 | ||||
-rw-r--r-- | InCallUI/res/drawable/btn_compound_dialpad.xml | 3 | ||||
-rw-r--r-- | InCallUI/res/drawable/btn_compound_hold.xml | 3 | ||||
-rw-r--r-- | InCallUI/res/drawable/btn_compound_mute.xml | 3 | ||||
-rw-r--r-- | InCallUI/res/drawable/btn_merge.xml | 29 | ||||
-rw-r--r-- | InCallUI/res/drawable/btn_swap.xml | 29 | ||||
-rw-r--r-- | InCallUI/res/layout/call_button_fragment.xml | 6 |
10 files changed, 158 insertions, 11 deletions
diff --git a/InCallUI/res/color/selectable_icon_tint.xml b/InCallUI/res/color/selectable_icon_tint.xml new file mode 100644 index 000000000..8665272ec --- /dev/null +++ b/InCallUI/res/color/selectable_icon_tint.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ Copyright (C) 2014 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"> + <item android:color="#ffffffff" android:state_selected="true" /> + <item android:color="#ffffffff" android:state_pressed="true" /> + <item android:color="#99ffffff" /> +</selector> + diff --git a/InCallUI/res/drawable/btn_add.xml b/InCallUI/res/drawable/btn_add.xml new file mode 100644 index 000000000..403fc1cb3 --- /dev/null +++ b/InCallUI/res/drawable/btn_add.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="utf-8"?> + +<!-- + ~ Copyright (C) 2014 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 + --> + +<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> + + <item android:drawable="@drawable/btn_background" /> + + <item> + <bitmap android:src="@drawable/ic_add_contact_holo_dark" + android:gravity="center" + android:tint="@color/selectable_icon_tint" /> + </item> + +</layer-list>
\ No newline at end of file diff --git a/InCallUI/res/drawable/btn_background.xml b/InCallUI/res/drawable/btn_background.xml new file mode 100644 index 000000000..be4644670 --- /dev/null +++ b/InCallUI/res/drawable/btn_background.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ Copyright (C) 2014 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 + --> + +<!-- Background resource for "compound buttons" in the in-call UI. + These buttons have two states (checked and unchecked), and + show a blue bar along the bottom edge when checked. --> +<selector xmlns:android="http://schemas.android.com/apk/res/android"> + + <item android:state_pressed="true" + android:drawable="@color/tab_pressed_color" /> + <item android:state_focused="true" + android:drawable="@drawable/tab_unselected_focused" /> + <item android:drawable="@android:color/transparent" /> + +</selector> diff --git a/InCallUI/res/drawable/btn_compound_audio.xml b/InCallUI/res/drawable/btn_compound_audio.xml index c348c98c1..51dc2c59e 100644 --- a/InCallUI/res/drawable/btn_compound_audio.xml +++ b/InCallUI/res/drawable/btn_compound_audio.xml @@ -46,7 +46,8 @@ size of the button. --> <item android:id="@+id/moreIndicatorItem"> <bitmap android:src="@drawable/ic_more_indicator_holo_dark" - android:gravity="center" /> + android:gravity="center" + android:tint="@color/selectable_icon_tint" /> </item> <!-- Finally, the button icon. @@ -70,26 +71,30 @@ <!-- Bluetooth is active --> <item android:id="@+id/bluetoothItem"> <bitmap android:src="@drawable/ic_sound_bluetooth_holo_dark" - android:gravity="center" /> + 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: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: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:gravity="center" + android:tint="@color/selectable_icon_tint" /> </item> <!-- Generic "audio mode" icon. Looks almost identical to diff --git a/InCallUI/res/drawable/btn_compound_dialpad.xml b/InCallUI/res/drawable/btn_compound_dialpad.xml index b44f2fafe..19668af90 100644 --- a/InCallUI/res/drawable/btn_compound_dialpad.xml +++ b/InCallUI/res/drawable/btn_compound_dialpad.xml @@ -24,7 +24,8 @@ the icon up to the full size of the button. --> <item> <bitmap android:src="@drawable/ic_dialpad_holo_dark" - android:gravity="center" /> + android:gravity="center" + android:tint="@color/selectable_icon_tint" /> </item> </layer-list> diff --git a/InCallUI/res/drawable/btn_compound_hold.xml b/InCallUI/res/drawable/btn_compound_hold.xml index 50161eac8..058db30f4 100644 --- a/InCallUI/res/drawable/btn_compound_hold.xml +++ b/InCallUI/res/drawable/btn_compound_hold.xml @@ -24,7 +24,8 @@ the icon up to the full size of the button. --> <item> <bitmap android:src="@drawable/ic_hold_pause_holo_dark" - android:gravity="center" /> + android:gravity="center" + android:tint="@color/selectable_icon_tint" /> </item> </layer-list> diff --git a/InCallUI/res/drawable/btn_compound_mute.xml b/InCallUI/res/drawable/btn_compound_mute.xml index 4e09bd9c3..53608a13c 100644 --- a/InCallUI/res/drawable/btn_compound_mute.xml +++ b/InCallUI/res/drawable/btn_compound_mute.xml @@ -24,7 +24,8 @@ the icon up to the full size of the button. --> <item> <bitmap android:src="@drawable/ic_mute_holo_dark" - android:gravity="center" /> + android:gravity="center" + android:tint="@color/selectable_icon_tint" /> </item> </layer-list> diff --git a/InCallUI/res/drawable/btn_merge.xml b/InCallUI/res/drawable/btn_merge.xml new file mode 100644 index 000000000..080949ad0 --- /dev/null +++ b/InCallUI/res/drawable/btn_merge.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="utf-8"?> + +<!-- + ~ Copyright (C) 2014 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 + --> + +<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> + + <item android:drawable="@drawable/btn_background" /> + + <item> + <bitmap android:src="@drawable/ic_merge_holo_dark" + android:gravity="center" + android:tint="@color/selectable_icon_tint" /> + </item> + +</layer-list>
\ No newline at end of file diff --git a/InCallUI/res/drawable/btn_swap.xml b/InCallUI/res/drawable/btn_swap.xml new file mode 100644 index 000000000..869b91786 --- /dev/null +++ b/InCallUI/res/drawable/btn_swap.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="utf-8"?> + +<!-- + ~ Copyright (C) 2014 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 + --> + +<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> + + <item android:drawable="@drawable/btn_background" /> + + <item> + <bitmap android:src="@drawable/ic_incall_switch_holo_dark" + android:gravity="center" + android:tint="@color/selectable_icon_tint" /> + </item> + +</layer-list>
\ No newline at end of file diff --git a/InCallUI/res/layout/call_button_fragment.xml b/InCallUI/res/layout/call_button_fragment.xml index 3cfd87f3d..139bdd00d 100644 --- a/InCallUI/res/layout/call_button_fragment.xml +++ b/InCallUI/res/layout/call_button_fragment.xml @@ -124,7 +124,7 @@ <!-- "Swap" (or "Manage calls" in some CDMA states) --> <ImageButton android:id="@+id/swapButton" style="@style/InCallButton" - android:src="@drawable/ic_incall_switch_holo_dark" + android:background="@drawable/btn_swap" android:contentDescription="@string/onscreenSwapCallsText" android:visibility="gone" /> @@ -138,7 +138,7 @@ <!-- "Add Call" --> <ImageButton android:id="@+id/addButton" style="@style/InCallButton" - android:src="@drawable/ic_add_contact_holo_dark" + android:background="@drawable/btn_add" android:contentDescription="@string/onscreenAddCallText" android:visibility="gone" /> @@ -148,7 +148,7 @@ The "Merge" button for CDMA devices is "cdmaMergeButton" above. --> <ImageButton android:id="@+id/mergeButton" style="@style/InCallButton" - android:src="@drawable/ic_merge_holo_dark" + android:background="@drawable/btn_merge" android:contentDescription="@string/onscreenMergeCallsText" android:visibility="gone" /> |