Replace tab texts with icons
Also replaces existing "contact card" icons with ":D"
Bug: 5274359
Change-Id: I04b77bfdab17f4a2468e8ecde88fab7477c11e3f
diff --git a/res/drawable-hdpi/ic_ab_show_all_holo_dark.png b/res/drawable-hdpi/ic_ab_show_all_holo_dark.png
new file mode 100644
index 0000000..1893425
--- /dev/null
+++ b/res/drawable-hdpi/ic_ab_show_all_holo_dark.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_ab_show_group_holo_dark.png b/res/drawable-hdpi/ic_ab_show_group_holo_dark.png
new file mode 100644
index 0000000..5a28614
--- /dev/null
+++ b/res/drawable-hdpi/ic_ab_show_group_holo_dark.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_add_contact_holo_dark.png b/res/drawable-hdpi/ic_add_contact_holo_dark.png
index 1190bf6..3583003 100644
--- a/res/drawable-hdpi/ic_add_contact_holo_dark.png
+++ b/res/drawable-hdpi/ic_add_contact_holo_dark.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_contacts_holo_dark.png b/res/drawable-hdpi/ic_contacts_holo_dark.png
index 06dc777..a07b004 100644
--- a/res/drawable-hdpi/ic_contacts_holo_dark.png
+++ b/res/drawable-hdpi/ic_contacts_holo_dark.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_menu_add_contact_holo_dark.png b/res/drawable-hdpi/ic_menu_add_contact_holo_dark.png
index 472d5b4..d8d5c63 100644
--- a/res/drawable-hdpi/ic_menu_add_contact_holo_dark.png
+++ b/res/drawable-hdpi/ic_menu_add_contact_holo_dark.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_menu_add_contact_holo_light.png b/res/drawable-hdpi/ic_menu_add_contact_holo_light.png
index 6335d40..616dd2a 100644
--- a/res/drawable-hdpi/ic_menu_add_contact_holo_light.png
+++ b/res/drawable-hdpi/ic_menu_add_contact_holo_light.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_menu_add_group_holo_dark.png b/res/drawable-hdpi/ic_menu_add_group_holo_dark.png
index 7f92adc..7edb297 100644
--- a/res/drawable-hdpi/ic_menu_add_group_holo_dark.png
+++ b/res/drawable-hdpi/ic_menu_add_group_holo_dark.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_ab_show_all_holo_dark.png b/res/drawable-mdpi/ic_ab_show_all_holo_dark.png
new file mode 100644
index 0000000..eaef05b
--- /dev/null
+++ b/res/drawable-mdpi/ic_ab_show_all_holo_dark.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_ab_show_group_holo_dark.png b/res/drawable-mdpi/ic_ab_show_group_holo_dark.png
new file mode 100644
index 0000000..a461b70
--- /dev/null
+++ b/res/drawable-mdpi/ic_ab_show_group_holo_dark.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_add_contact_holo_dark.png b/res/drawable-mdpi/ic_add_contact_holo_dark.png
index 9aadd04..8118e24 100644
--- a/res/drawable-mdpi/ic_add_contact_holo_dark.png
+++ b/res/drawable-mdpi/ic_add_contact_holo_dark.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_contacts_holo_dark.png b/res/drawable-mdpi/ic_contacts_holo_dark.png
index a089a67..c944456 100644
--- a/res/drawable-mdpi/ic_contacts_holo_dark.png
+++ b/res/drawable-mdpi/ic_contacts_holo_dark.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_menu_add_contact_holo_dark.png b/res/drawable-mdpi/ic_menu_add_contact_holo_dark.png
index 6a7af38..ae22598 100644
--- a/res/drawable-mdpi/ic_menu_add_contact_holo_dark.png
+++ b/res/drawable-mdpi/ic_menu_add_contact_holo_dark.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_menu_add_contact_holo_light.png b/res/drawable-mdpi/ic_menu_add_contact_holo_light.png
index 0a82abd..0cfb71b 100644
--- a/res/drawable-mdpi/ic_menu_add_contact_holo_light.png
+++ b/res/drawable-mdpi/ic_menu_add_contact_holo_light.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_menu_add_group_holo_dark.png b/res/drawable-mdpi/ic_menu_add_group_holo_dark.png
index 16ba126..29369e8 100644
--- a/res/drawable-mdpi/ic_menu_add_group_holo_dark.png
+++ b/res/drawable-mdpi/ic_menu_add_group_holo_dark.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_ab_show_all_holo_dark.png b/res/drawable-xhdpi/ic_ab_show_all_holo_dark.png
new file mode 100644
index 0000000..bc739b1
--- /dev/null
+++ b/res/drawable-xhdpi/ic_ab_show_all_holo_dark.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_ab_show_group_holo_dark.png b/res/drawable-xhdpi/ic_ab_show_group_holo_dark.png
new file mode 100644
index 0000000..fb3338e
--- /dev/null
+++ b/res/drawable-xhdpi/ic_ab_show_group_holo_dark.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_add_contact_holo_dark.png b/res/drawable-xhdpi/ic_add_contact_holo_dark.png
index 2eac542..16454ea 100644
--- a/res/drawable-xhdpi/ic_add_contact_holo_dark.png
+++ b/res/drawable-xhdpi/ic_add_contact_holo_dark.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_contacts_holo_dark.png b/res/drawable-xhdpi/ic_contacts_holo_dark.png
index 0384abc..fe270bf 100644
--- a/res/drawable-xhdpi/ic_contacts_holo_dark.png
+++ b/res/drawable-xhdpi/ic_contacts_holo_dark.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_menu_add_contact_holo_dark.png b/res/drawable-xhdpi/ic_menu_add_contact_holo_dark.png
index e94b91b..6b0bff7 100644
--- a/res/drawable-xhdpi/ic_menu_add_contact_holo_dark.png
+++ b/res/drawable-xhdpi/ic_menu_add_contact_holo_dark.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_menu_add_contact_holo_light.png b/res/drawable-xhdpi/ic_menu_add_contact_holo_light.png
index a28d8f4..f018afd 100644
--- a/res/drawable-xhdpi/ic_menu_add_contact_holo_light.png
+++ b/res/drawable-xhdpi/ic_menu_add_contact_holo_light.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_menu_add_group_holo_dark.png b/res/drawable-xhdpi/ic_menu_add_group_holo_dark.png
index d4bd681..75ba003 100644
--- a/res/drawable-xhdpi/ic_menu_add_group_holo_dark.png
+++ b/res/drawable-xhdpi/ic_menu_add_group_holo_dark.png
Binary files differ
diff --git a/res/drawable/ic_tab_all.xml b/res/drawable/ic_tab_all.xml
new file mode 100644
index 0000000..25a3948
--- /dev/null
+++ b/res/drawable/ic_tab_all.xml
@@ -0,0 +1,20 @@
+<?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.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:drawable="@drawable/ic_ab_show_all_holo_dark" />
+</selector>
+
diff --git a/res/drawable/ic_tab_groups.xml b/res/drawable/ic_tab_groups.xml
new file mode 100644
index 0000000..c562fa3
--- /dev/null
+++ b/res/drawable/ic_tab_groups.xml
@@ -0,0 +1,20 @@
+<?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.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:drawable="@drawable/ic_ab_show_group_holo_dark" />
+</selector>
+
diff --git a/res/values/strings.xml b/res/values/strings.xml
index ec341f4..57ed7c5 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -340,19 +340,44 @@
<item quantity="other"><xliff:g id="count">%d</xliff:g> found</item>
</plurals>
- <!-- The description text for the "all contacts" tab. Space is limited for this string, so the shorter the better -->
+ <!-- The content description for the "all contacts" tab.
+
+ Note: AccessibilityServices use this attribute to announce what the view represents.
+ This is especially valuable for views without textual representation like ImageView.
+
+ [CHAR LIMIT=NONE] -->
<string name="contactsAllLabel">All</string>
- <!-- The description text for the groups tab. Space is limited for this string, so the shorter the better -->
+ <!-- The content description text for the groups tab.
+
+ Note: AccessibilityServices use this attribute to announce what the view represents.
+ This is especially valuable for views without textual representation like ImageView.
+
+ [CHAR LIMIT=NONE] -->
<string name="contactsGroupsLabel">Groups</string>
- <!-- The description text for the favorites tab. Space is limited for this string, so the shorter the better -->
+ <!-- The description text for the favorites tab.
+
+ Note: AccessibilityServices use this attribute to announce what the view represents.
+ This is especially valuable for views without textual representation like ImageView.
+
+ [CHAR LIMIT=NONE] -->
<string name="contactsFavoritesLabel">Favorites</string>
- <!-- The description text for the dialer tab. Space is limited for this string, so the shorter the better -->
+ <!-- The description text for the dialer tab.
+
+ Note: AccessibilityServices use this attribute to announce what the view represents.
+ This is especially valuable for views without textual representation like ImageView.
+
+ [CHAR LIMIT=NONE] -->
<string name="dialerIconLabel">Phone</string>
- <!-- The description text for the call log tab. Space is limited for this string, so the shorter the better -->
+ <!-- The description text for the call log tab.
+
+ Note: AccessibilityServices use this attribute to announce what the view represents.
+ This is especially valuable for views without textual representation like ImageView.
+
+ [CHAR LIMIT=NONE] -->
<string name="recentCallsIconLabel">Call log</string>
<string name="liveFolderAll">All contacts</string>
<string name="liveFolderFavorites">Starred contacts</string>
diff --git a/src/com/android/contacts/activities/ActionBarAdapter.java b/src/com/android/contacts/activities/ActionBarAdapter.java
index edf5519..6d55184 100644
--- a/src/com/android/contacts/activities/ActionBarAdapter.java
+++ b/src/com/android/contacts/activities/ActionBarAdapter.java
@@ -129,9 +129,9 @@
mActionBar.setCustomView(customSearchView, layoutParams);
// Set up tabs
- addTab(TabState.GROUPS, mContext.getString(R.string.contactsGroupsLabel));
- addTab(TabState.ALL, mContext.getString(R.string.contactsAllLabel));
- addTab(TabState.FAVORITES, mContext.getString(R.string.contactsFavoritesLabel));
+ addTab(TabState.GROUPS, R.drawable.ic_tab_groups, R.string.contactsGroupsLabel);
+ addTab(TabState.ALL, R.drawable.ic_tab_all, R.string.contactsAllLabel);
+ addTab(TabState.FAVORITES, R.drawable.ic_tab_starred, R.string.contactsFavoritesLabel);
}
public void initialize(Bundle savedState, ContactsRequest request) {
@@ -153,10 +153,11 @@
mListener = listener;
}
- private void addTab(TabState tabState, String text) {
+ private void addTab(TabState tabState, int icon, int contentDescription) {
final Tab tab = mActionBar.newTab();
tab.setTag(tabState);
- tab.setText(text);
+ tab.setIcon(icon);
+ tab.setContentDescription(contentDescription);
tab.setTabListener(mTabListener);
mActionBar.addTab(tab);
}