Merge "Import revised translations."
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 9d5381a..0e28ae8 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -16,15 +16,16 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.contacts"
- android:sharedUserId="android.uid.shared"
- android:sharedUserLabel="@string/sharedUserLabel"
->
+ android:sharedUserId="android.uid.shared">
<original-package android:name="com.android.contacts" />
<uses-permission android:name="android.permission.CALL_PRIVILEGED" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
+ <uses-permission android:name="android.permission.GET_ACCOUNTS" />
+ <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
+ <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.READ_PROFILE" />
<uses-permission android:name="android.permission.WRITE_PROFILE" />
<uses-permission android:name="android.permission.INTERNET" />
@@ -48,7 +49,6 @@
android:name="com.android.contacts.ContactsApplication"
android:label="@string/contactsList"
android:icon="@mipmap/ic_launcher_contacts"
- android:process="android.process.acore"
android:taskAffinity="android.task.contacts"
android:hardwareAccelerated="true"
>
@@ -389,7 +389,7 @@
<!-- Create a new or edit an existing group -->
<activity
android:name=".activities.GroupEditorActivity"
- android:theme="@style/ContactEditorActivityTheme"
+ android:theme="@style/EditorActivityTheme"
android:windowSoftInputMode="adjustResize" />
<!-- Used to show QuickContact window over a translucent activity, which is a
@@ -503,7 +503,7 @@
<!-- Create a new or edit an existing contact -->
<activity
android:name=".activities.ContactEditorActivity"
- android:theme="@style/ContactEditorActivityTheme"
+ android:theme="@style/EditorActivityTheme"
android:uiOptions="splitActionBarWhenNarrow"
android:windowSoftInputMode="adjustResize">
diff --git a/res/drawable-hdpi/ab_solid_custom_blue_inverse_holo.9.png b/res/drawable-hdpi/ab_solid_custom_blue_inverse_holo.9.png
new file mode 100644
index 0000000..80fb400
--- /dev/null
+++ b/res/drawable-hdpi/ab_solid_custom_blue_inverse_holo.9.png
Binary files differ
diff --git a/res/drawable-hdpi/change_photo_box_focused_holo_light.9.png b/res/drawable-hdpi/change_photo_box_focused_holo_light.9.png
deleted file mode 100644
index 5254473..0000000
--- a/res/drawable-hdpi/change_photo_box_focused_holo_light.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/change_photo_box_normal_holo_light.9.png b/res/drawable-hdpi/change_photo_box_normal_holo_light.9.png
deleted file mode 100644
index f026cc8..0000000
--- a/res/drawable-hdpi/change_photo_box_normal_holo_light.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/change_photo_box_pressed_holo_light.9.png b/res/drawable-hdpi/change_photo_box_pressed_holo_light.9.png
deleted file mode 100644
index a0770ea..0000000
--- a/res/drawable-hdpi/change_photo_box_pressed_holo_light.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/dial_background_texture.png b/res/drawable-hdpi/dial_background_texture.png
index 5b299fd..7ed0984 100644
--- a/res/drawable-hdpi/dial_background_texture.png
+++ b/res/drawable-hdpi/dial_background_texture.png
Binary files differ
diff --git a/res/drawable-hdpi/dial_num_0_wht.png b/res/drawable-hdpi/dial_num_0_wht.png
index a0720f3..9d7fc62 100644
--- a/res/drawable-hdpi/dial_num_0_wht.png
+++ b/res/drawable-hdpi/dial_num_0_wht.png
Binary files differ
diff --git a/res/drawable-hdpi/dial_num_1_wht.png b/res/drawable-hdpi/dial_num_1_wht.png
index 0c79720..e941c52 100644
--- a/res/drawable-hdpi/dial_num_1_wht.png
+++ b/res/drawable-hdpi/dial_num_1_wht.png
Binary files differ
diff --git a/res/drawable-hdpi/dial_num_2_wht.png b/res/drawable-hdpi/dial_num_2_wht.png
index ab90531..fc5540b 100644
--- a/res/drawable-hdpi/dial_num_2_wht.png
+++ b/res/drawable-hdpi/dial_num_2_wht.png
Binary files differ
diff --git a/res/drawable-hdpi/dial_num_3_wht.png b/res/drawable-hdpi/dial_num_3_wht.png
index 956cba9..45637b9 100644
--- a/res/drawable-hdpi/dial_num_3_wht.png
+++ b/res/drawable-hdpi/dial_num_3_wht.png
Binary files differ
diff --git a/res/drawable-hdpi/dial_num_4_wht.png b/res/drawable-hdpi/dial_num_4_wht.png
index 34e157c..af8c8aa 100644
--- a/res/drawable-hdpi/dial_num_4_wht.png
+++ b/res/drawable-hdpi/dial_num_4_wht.png
Binary files differ
diff --git a/res/drawable-hdpi/dial_num_5_wht.png b/res/drawable-hdpi/dial_num_5_wht.png
index 4a3560a..20ab0b1 100644
--- a/res/drawable-hdpi/dial_num_5_wht.png
+++ b/res/drawable-hdpi/dial_num_5_wht.png
Binary files differ
diff --git a/res/drawable-hdpi/dial_num_6_wht.png b/res/drawable-hdpi/dial_num_6_wht.png
index a60420b..8811b4b 100644
--- a/res/drawable-hdpi/dial_num_6_wht.png
+++ b/res/drawable-hdpi/dial_num_6_wht.png
Binary files differ
diff --git a/res/drawable-hdpi/dial_num_7_wht.png b/res/drawable-hdpi/dial_num_7_wht.png
index 95e4cff..ed6d749 100644
--- a/res/drawable-hdpi/dial_num_7_wht.png
+++ b/res/drawable-hdpi/dial_num_7_wht.png
Binary files differ
diff --git a/res/drawable-hdpi/dial_num_8_wht.png b/res/drawable-hdpi/dial_num_8_wht.png
index 4b17084..6844aeb 100644
--- a/res/drawable-hdpi/dial_num_8_wht.png
+++ b/res/drawable-hdpi/dial_num_8_wht.png
Binary files differ
diff --git a/res/drawable-hdpi/dial_num_9_wht.png b/res/drawable-hdpi/dial_num_9_wht.png
index f772901..df294be 100644
--- a/res/drawable-hdpi/dial_num_9_wht.png
+++ b/res/drawable-hdpi/dial_num_9_wht.png
Binary files differ
diff --git a/res/drawable-hdpi/dial_num_pound_wht.png b/res/drawable-hdpi/dial_num_pound_wht.png
index 1d7f55a..46316e5 100644
--- a/res/drawable-hdpi/dial_num_pound_wht.png
+++ b/res/drawable-hdpi/dial_num_pound_wht.png
Binary files differ
diff --git a/res/drawable-hdpi/dial_num_star_wht.png b/res/drawable-hdpi/dial_num_star_wht.png
index 2add63b..c36e31c 100644
--- a/res/drawable-hdpi/dial_num_star_wht.png
+++ b/res/drawable-hdpi/dial_num_star_wht.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_ab_search_holo_dark.png b/res/drawable-hdpi/ic_ab_search_holo_dark.png
new file mode 100644
index 0000000..6dff03e
--- /dev/null
+++ b/res/drawable-hdpi/ic_ab_search_holo_dark.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_dial_action_delete.png b/res/drawable-hdpi/ic_dial_action_delete.png
index f93a308..0bf8563 100644
--- a/res/drawable-hdpi/ic_dial_action_delete.png
+++ b/res/drawable-hdpi/ic_dial_action_delete.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_list_default_mime_holo_dark.png b/res/drawable-hdpi/ic_list_default_mime_holo_dark.png
new file mode 100644
index 0000000..4dc1c39
--- /dev/null
+++ b/res/drawable-hdpi/ic_list_default_mime_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
new file mode 100644
index 0000000..472d5b4
--- /dev/null
+++ b/res/drawable-hdpi/ic_menu_add_contact_holo_dark.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
new file mode 100644
index 0000000..7f92adc
--- /dev/null
+++ b/res/drawable-hdpi/ic_menu_add_group_holo_dark.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_menu_compose_holo_dark.png b/res/drawable-hdpi/ic_menu_compose_holo_dark.png
new file mode 100644
index 0000000..2df1f44
--- /dev/null
+++ b/res/drawable-hdpi/ic_menu_compose_holo_dark.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_menu_done_holo_dark.png b/res/drawable-hdpi/ic_menu_done_holo_dark.png
new file mode 100644
index 0000000..750c77e
--- /dev/null
+++ b/res/drawable-hdpi/ic_menu_done_holo_dark.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_text_holo_dark.png b/res/drawable-hdpi/ic_text_holo_dark.png
index 1816201..6d21e42 100644
--- a/res/drawable-hdpi/ic_text_holo_dark.png
+++ b/res/drawable-hdpi/ic_text_holo_dark.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_text_holo_light.png b/res/drawable-hdpi/ic_text_holo_light.png
new file mode 100644
index 0000000..01af189
--- /dev/null
+++ b/res/drawable-hdpi/ic_text_holo_light.png
Binary files differ
diff --git a/res/drawable-hdpi/list_activated_holo.9.png b/res/drawable-hdpi/list_activated_holo.9.png
index 36ccb79..7b89319 100644
--- a/res/drawable-hdpi/list_activated_holo.9.png
+++ b/res/drawable-hdpi/list_activated_holo.9.png
Binary files differ
diff --git a/res/drawable-hdpi/list_focused_holo.9.png b/res/drawable-hdpi/list_focused_holo.9.png
index 54c5c2d..e962ce8 100644
--- a/res/drawable-hdpi/list_focused_holo.9.png
+++ b/res/drawable-hdpi/list_focused_holo.9.png
Binary files differ
diff --git a/res/drawable-hdpi/list_pressed_holo.9.png b/res/drawable-hdpi/list_pressed_holo.9.png
index 423fa4b..dd183c0 100644
--- a/res/drawable-hdpi/list_pressed_holo.9.png
+++ b/res/drawable-hdpi/list_pressed_holo.9.png
Binary files differ
diff --git a/res/drawable-mdpi/ab_solid_custom_blue_inverse_holo.9.png b/res/drawable-mdpi/ab_solid_custom_blue_inverse_holo.9.png
new file mode 100644
index 0000000..f3c0a90
--- /dev/null
+++ b/res/drawable-mdpi/ab_solid_custom_blue_inverse_holo.9.png
Binary files differ
diff --git a/res/drawable-mdpi/change_photo_box_focused_holo_light.9.png b/res/drawable-mdpi/change_photo_box_focused_holo_light.9.png
deleted file mode 100644
index 47fb773..0000000
--- a/res/drawable-mdpi/change_photo_box_focused_holo_light.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/change_photo_box_normal_holo_light.9.png b/res/drawable-mdpi/change_photo_box_normal_holo_light.9.png
deleted file mode 100644
index 591e6d5..0000000
--- a/res/drawable-mdpi/change_photo_box_normal_holo_light.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/change_photo_box_pressed_holo_light.9.png b/res/drawable-mdpi/change_photo_box_pressed_holo_light.9.png
deleted file mode 100644
index 5d5eee2..0000000
--- a/res/drawable-mdpi/change_photo_box_pressed_holo_light.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/dial_background_texture.png b/res/drawable-mdpi/dial_background_texture.png
index 881f3a0..f0ba700 100644
--- a/res/drawable-mdpi/dial_background_texture.png
+++ b/res/drawable-mdpi/dial_background_texture.png
Binary files differ
diff --git a/res/drawable-mdpi/dial_num_0_wht.png b/res/drawable-mdpi/dial_num_0_wht.png
index 5391fb3..96a0dcd 100644
--- a/res/drawable-mdpi/dial_num_0_wht.png
+++ b/res/drawable-mdpi/dial_num_0_wht.png
Binary files differ
diff --git a/res/drawable-mdpi/dial_num_1_wht.png b/res/drawable-mdpi/dial_num_1_wht.png
index ff8f125..56dbca3 100644
--- a/res/drawable-mdpi/dial_num_1_wht.png
+++ b/res/drawable-mdpi/dial_num_1_wht.png
Binary files differ
diff --git a/res/drawable-mdpi/dial_num_2_wht.png b/res/drawable-mdpi/dial_num_2_wht.png
index 041bafb..4c0991c 100644
--- a/res/drawable-mdpi/dial_num_2_wht.png
+++ b/res/drawable-mdpi/dial_num_2_wht.png
Binary files differ
diff --git a/res/drawable-mdpi/dial_num_3_wht.png b/res/drawable-mdpi/dial_num_3_wht.png
index b91b4f5..81bf770 100644
--- a/res/drawable-mdpi/dial_num_3_wht.png
+++ b/res/drawable-mdpi/dial_num_3_wht.png
Binary files differ
diff --git a/res/drawable-mdpi/dial_num_4_wht.png b/res/drawable-mdpi/dial_num_4_wht.png
index 912b4cb..5f07476 100644
--- a/res/drawable-mdpi/dial_num_4_wht.png
+++ b/res/drawable-mdpi/dial_num_4_wht.png
Binary files differ
diff --git a/res/drawable-mdpi/dial_num_5_wht.png b/res/drawable-mdpi/dial_num_5_wht.png
index efd385f..5cf9c7a 100644
--- a/res/drawable-mdpi/dial_num_5_wht.png
+++ b/res/drawable-mdpi/dial_num_5_wht.png
Binary files differ
diff --git a/res/drawable-mdpi/dial_num_6_wht.png b/res/drawable-mdpi/dial_num_6_wht.png
index c0f47c5..ceffb29 100644
--- a/res/drawable-mdpi/dial_num_6_wht.png
+++ b/res/drawable-mdpi/dial_num_6_wht.png
Binary files differ
diff --git a/res/drawable-mdpi/dial_num_7_wht.png b/res/drawable-mdpi/dial_num_7_wht.png
index 5644f2b..022ef9c 100644
--- a/res/drawable-mdpi/dial_num_7_wht.png
+++ b/res/drawable-mdpi/dial_num_7_wht.png
Binary files differ
diff --git a/res/drawable-mdpi/dial_num_8_wht.png b/res/drawable-mdpi/dial_num_8_wht.png
index d0c517d..c470e68 100644
--- a/res/drawable-mdpi/dial_num_8_wht.png
+++ b/res/drawable-mdpi/dial_num_8_wht.png
Binary files differ
diff --git a/res/drawable-mdpi/dial_num_9_wht.png b/res/drawable-mdpi/dial_num_9_wht.png
index fb443ec..27d94ef 100644
--- a/res/drawable-mdpi/dial_num_9_wht.png
+++ b/res/drawable-mdpi/dial_num_9_wht.png
Binary files differ
diff --git a/res/drawable-mdpi/dial_num_pound_wht.png b/res/drawable-mdpi/dial_num_pound_wht.png
index 11751ec..68908c3 100644
--- a/res/drawable-mdpi/dial_num_pound_wht.png
+++ b/res/drawable-mdpi/dial_num_pound_wht.png
Binary files differ
diff --git a/res/drawable-mdpi/dial_num_star_wht.png b/res/drawable-mdpi/dial_num_star_wht.png
index 61b24c1..cb8aa28 100644
--- a/res/drawable-mdpi/dial_num_star_wht.png
+++ b/res/drawable-mdpi/dial_num_star_wht.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_ab_search_holo_dark.png b/res/drawable-mdpi/ic_ab_search_holo_dark.png
new file mode 100644
index 0000000..5a10e93
--- /dev/null
+++ b/res/drawable-mdpi/ic_ab_search_holo_dark.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_dial_action_delete.png b/res/drawable-mdpi/ic_dial_action_delete.png
index 32b0022..98341e9 100644
--- a/res/drawable-mdpi/ic_dial_action_delete.png
+++ b/res/drawable-mdpi/ic_dial_action_delete.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_list_default_mime_holo_dark.png b/res/drawable-mdpi/ic_list_default_mime_holo_dark.png
new file mode 100644
index 0000000..d950b31
--- /dev/null
+++ b/res/drawable-mdpi/ic_list_default_mime_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
new file mode 100644
index 0000000..6a7af38
--- /dev/null
+++ b/res/drawable-mdpi/ic_menu_add_contact_holo_dark.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
new file mode 100644
index 0000000..16ba126
--- /dev/null
+++ b/res/drawable-mdpi/ic_menu_add_group_holo_dark.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_menu_compose_holo_dark.png b/res/drawable-mdpi/ic_menu_compose_holo_dark.png
new file mode 100644
index 0000000..3caf754
--- /dev/null
+++ b/res/drawable-mdpi/ic_menu_compose_holo_dark.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_menu_done_holo_dark.png b/res/drawable-mdpi/ic_menu_done_holo_dark.png
new file mode 100644
index 0000000..7ec8c8f
--- /dev/null
+++ b/res/drawable-mdpi/ic_menu_done_holo_dark.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_text_holo_dark.png b/res/drawable-mdpi/ic_text_holo_dark.png
index bbaa84f..80b95ee 100644
--- a/res/drawable-mdpi/ic_text_holo_dark.png
+++ b/res/drawable-mdpi/ic_text_holo_dark.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_text_holo_light.png b/res/drawable-mdpi/ic_text_holo_light.png
new file mode 100644
index 0000000..76dae05
--- /dev/null
+++ b/res/drawable-mdpi/ic_text_holo_light.png
Binary files differ
diff --git a/res/drawable-mdpi/list_activated_holo.9.png b/res/drawable-mdpi/list_activated_holo.9.png
index f7cd24e..4d98919 100644
--- a/res/drawable-mdpi/list_activated_holo.9.png
+++ b/res/drawable-mdpi/list_activated_holo.9.png
Binary files differ
diff --git a/res/drawable-mdpi/list_focused_holo.9.png b/res/drawable-mdpi/list_focused_holo.9.png
index 32cb628..6e041f3 100644
--- a/res/drawable-mdpi/list_focused_holo.9.png
+++ b/res/drawable-mdpi/list_focused_holo.9.png
Binary files differ
diff --git a/res/drawable-mdpi/list_pressed_holo.9.png b/res/drawable-mdpi/list_pressed_holo.9.png
index 7ea8666..9358dd8 100644
--- a/res/drawable-mdpi/list_pressed_holo.9.png
+++ b/res/drawable-mdpi/list_pressed_holo.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/ab_solid_custom_blue_inverse_holo.9.png b/res/drawable-xhdpi/ab_solid_custom_blue_inverse_holo.9.png
new file mode 100644
index 0000000..3c97b20
--- /dev/null
+++ b/res/drawable-xhdpi/ab_solid_custom_blue_inverse_holo.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/bg_status_contact_widget.9.png b/res/drawable-xhdpi/bg_status_contact_widget.9.png
index db34bf4..ced5296 100644
--- a/res/drawable-xhdpi/bg_status_contact_widget.9.png
+++ b/res/drawable-xhdpi/bg_status_contact_widget.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/change_photo_box_focused_holo_light.9.png b/res/drawable-xhdpi/change_photo_box_focused_holo_light.9.png
deleted file mode 100644
index 7dbd1e6..0000000
--- a/res/drawable-xhdpi/change_photo_box_focused_holo_light.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/change_photo_box_normal_holo_light.9.png b/res/drawable-xhdpi/change_photo_box_normal_holo_light.9.png
deleted file mode 100644
index 7e1e97f..0000000
--- a/res/drawable-xhdpi/change_photo_box_normal_holo_light.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/change_photo_box_pressed_holo_light.9.png b/res/drawable-xhdpi/change_photo_box_pressed_holo_light.9.png
deleted file mode 100644
index e98266f..0000000
--- a/res/drawable-xhdpi/change_photo_box_pressed_holo_light.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/contacts_widget_preview.png b/res/drawable-xhdpi/contacts_widget_preview.png
index 65ac914..1f42ca0 100644
--- a/res/drawable-xhdpi/contacts_widget_preview.png
+++ b/res/drawable-xhdpi/contacts_widget_preview.png
Binary files differ
diff --git a/res/drawable-xhdpi/dial_background_texture.png b/res/drawable-xhdpi/dial_background_texture.png
index 4c8617a..3d6e8c7 100644
--- a/res/drawable-xhdpi/dial_background_texture.png
+++ b/res/drawable-xhdpi/dial_background_texture.png
Binary files differ
diff --git a/res/drawable-xhdpi/dial_num_0_wht.png b/res/drawable-xhdpi/dial_num_0_wht.png
index 99aca70..f6f96cc 100644
--- a/res/drawable-xhdpi/dial_num_0_wht.png
+++ b/res/drawable-xhdpi/dial_num_0_wht.png
Binary files differ
diff --git a/res/drawable-xhdpi/dial_num_1_wht.png b/res/drawable-xhdpi/dial_num_1_wht.png
index 5a54bfd..8333aba 100644
--- a/res/drawable-xhdpi/dial_num_1_wht.png
+++ b/res/drawable-xhdpi/dial_num_1_wht.png
Binary files differ
diff --git a/res/drawable-xhdpi/dial_num_2_wht.png b/res/drawable-xhdpi/dial_num_2_wht.png
index 3407d79..02f8fdf 100644
--- a/res/drawable-xhdpi/dial_num_2_wht.png
+++ b/res/drawable-xhdpi/dial_num_2_wht.png
Binary files differ
diff --git a/res/drawable-xhdpi/dial_num_3_wht.png b/res/drawable-xhdpi/dial_num_3_wht.png
index dd16bbb..44383b5 100644
--- a/res/drawable-xhdpi/dial_num_3_wht.png
+++ b/res/drawable-xhdpi/dial_num_3_wht.png
Binary files differ
diff --git a/res/drawable-xhdpi/dial_num_4_wht.png b/res/drawable-xhdpi/dial_num_4_wht.png
index 98f8773..f90cb73 100644
--- a/res/drawable-xhdpi/dial_num_4_wht.png
+++ b/res/drawable-xhdpi/dial_num_4_wht.png
Binary files differ
diff --git a/res/drawable-xhdpi/dial_num_5_wht.png b/res/drawable-xhdpi/dial_num_5_wht.png
index 12a92bf..c41c615 100644
--- a/res/drawable-xhdpi/dial_num_5_wht.png
+++ b/res/drawable-xhdpi/dial_num_5_wht.png
Binary files differ
diff --git a/res/drawable-xhdpi/dial_num_6_wht.png b/res/drawable-xhdpi/dial_num_6_wht.png
index 39c3eda..4c7a235 100644
--- a/res/drawable-xhdpi/dial_num_6_wht.png
+++ b/res/drawable-xhdpi/dial_num_6_wht.png
Binary files differ
diff --git a/res/drawable-xhdpi/dial_num_7_wht.png b/res/drawable-xhdpi/dial_num_7_wht.png
index 5e3a0b0..fabca99 100644
--- a/res/drawable-xhdpi/dial_num_7_wht.png
+++ b/res/drawable-xhdpi/dial_num_7_wht.png
Binary files differ
diff --git a/res/drawable-xhdpi/dial_num_8_wht.png b/res/drawable-xhdpi/dial_num_8_wht.png
index d68142d..7bd70b0 100644
--- a/res/drawable-xhdpi/dial_num_8_wht.png
+++ b/res/drawable-xhdpi/dial_num_8_wht.png
Binary files differ
diff --git a/res/drawable-xhdpi/dial_num_9_wht.png b/res/drawable-xhdpi/dial_num_9_wht.png
index b34bc1d..207276c 100644
--- a/res/drawable-xhdpi/dial_num_9_wht.png
+++ b/res/drawable-xhdpi/dial_num_9_wht.png
Binary files differ
diff --git a/res/drawable-xhdpi/dial_num_pound_wht.png b/res/drawable-xhdpi/dial_num_pound_wht.png
index a4ead0a..b2cac17 100644
--- a/res/drawable-xhdpi/dial_num_pound_wht.png
+++ b/res/drawable-xhdpi/dial_num_pound_wht.png
Binary files differ
diff --git a/res/drawable-xhdpi/dial_num_star_wht.png b/res/drawable-xhdpi/dial_num_star_wht.png
index ba0a787..2862c45 100644
--- a/res/drawable-xhdpi/dial_num_star_wht.png
+++ b/res/drawable-xhdpi/dial_num_star_wht.png
Binary files differ
diff --git a/res/drawable-xhdpi/frame_thumbnail_contact_widget_focused_holo.png b/res/drawable-xhdpi/frame_thumbnail_contact_widget_focused_holo.png
index a05ca8a..157ef56 100644
--- a/res/drawable-xhdpi/frame_thumbnail_contact_widget_focused_holo.png
+++ b/res/drawable-xhdpi/frame_thumbnail_contact_widget_focused_holo.png
Binary files differ
diff --git a/res/drawable-xhdpi/frame_thumbnail_contact_widget_holo.png b/res/drawable-xhdpi/frame_thumbnail_contact_widget_holo.png
index bf2e4a8..7719710 100644
--- a/res/drawable-xhdpi/frame_thumbnail_contact_widget_holo.png
+++ b/res/drawable-xhdpi/frame_thumbnail_contact_widget_holo.png
Binary files differ
diff --git a/res/drawable-xhdpi/frame_thumbnail_contact_widget_pressed_holo.png b/res/drawable-xhdpi/frame_thumbnail_contact_widget_pressed_holo.png
index 6541c62..8c5008b 100644
--- a/res/drawable-xhdpi/frame_thumbnail_contact_widget_pressed_holo.png
+++ b/res/drawable-xhdpi/frame_thumbnail_contact_widget_pressed_holo.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_ab_search_holo_dark.png b/res/drawable-xhdpi/ic_ab_search_holo_dark.png
new file mode 100644
index 0000000..b2d23c9
--- /dev/null
+++ b/res/drawable-xhdpi/ic_ab_search_holo_dark.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_dial_action_delete.png b/res/drawable-xhdpi/ic_dial_action_delete.png
index 9c0b4f0..989e8b1 100644
--- a/res/drawable-xhdpi/ic_dial_action_delete.png
+++ b/res/drawable-xhdpi/ic_dial_action_delete.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_list_default_mime_holo_dark.png b/res/drawable-xhdpi/ic_list_default_mime_holo_dark.png
new file mode 100644
index 0000000..73cddd1
--- /dev/null
+++ b/res/drawable-xhdpi/ic_list_default_mime_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
new file mode 100644
index 0000000..e94b91b
--- /dev/null
+++ b/res/drawable-xhdpi/ic_menu_add_contact_holo_dark.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
new file mode 100644
index 0000000..d4bd681
--- /dev/null
+++ b/res/drawable-xhdpi/ic_menu_add_group_holo_dark.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_menu_compose_holo_dark.png b/res/drawable-xhdpi/ic_menu_compose_holo_dark.png
new file mode 100644
index 0000000..cd868d2
--- /dev/null
+++ b/res/drawable-xhdpi/ic_menu_compose_holo_dark.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_menu_done_holo_dark.png b/res/drawable-xhdpi/ic_menu_done_holo_dark.png
new file mode 100644
index 0000000..b9af04a
--- /dev/null
+++ b/res/drawable-xhdpi/ic_menu_done_holo_dark.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_text_holo_dark.png b/res/drawable-xhdpi/ic_text_holo_dark.png
index 8c697d9..e80a042 100644
--- a/res/drawable-xhdpi/ic_text_holo_dark.png
+++ b/res/drawable-xhdpi/ic_text_holo_dark.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_text_holo_light.png b/res/drawable-xhdpi/ic_text_holo_light.png
new file mode 100644
index 0000000..6fb8e92
--- /dev/null
+++ b/res/drawable-xhdpi/ic_text_holo_light.png
Binary files differ
diff --git a/res/drawable-xhdpi/list_activated_holo.9.png b/res/drawable-xhdpi/list_activated_holo.9.png
index bb9a7f9..4e13add 100644
--- a/res/drawable-xhdpi/list_activated_holo.9.png
+++ b/res/drawable-xhdpi/list_activated_holo.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/list_focused_holo.9.png b/res/drawable-xhdpi/list_focused_holo.9.png
index 6051708..9c90c2b 100644
--- a/res/drawable-xhdpi/list_focused_holo.9.png
+++ b/res/drawable-xhdpi/list_focused_holo.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/list_pressed_holo.9.png b/res/drawable-xhdpi/list_pressed_holo.9.png
index f4b4c38..d0fc7e0 100644
--- a/res/drawable-xhdpi/list_pressed_holo.9.png
+++ b/res/drawable-xhdpi/list_pressed_holo.9.png
Binary files differ
diff --git a/res/drawable/change_photo_box_holo_light.xml b/res/drawable/change_photo_box_holo_light.xml
deleted file mode 100644
index f08beb0..0000000
--- a/res/drawable/change_photo_box_holo_light.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2009 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:state_window_focused="false"
- android:drawable="@drawable/change_photo_box_normal_holo_light" />
- <item android:state_pressed="true"
- android:drawable="@drawable/change_photo_box_pressed_holo_light" />
- <item android:state_focused="true"
- android:drawable="@drawable/change_photo_box_focused_holo_light" />
- <item
- android:drawable="@drawable/change_photo_box_normal_holo_light" />
-</selector>
diff --git a/res/layout-sw580dp/event_field_editor_view.xml b/res/layout-sw580dp/event_field_editor_view.xml
index f31b283..822de37 100644
--- a/res/layout-sw580dp/event_field_editor_view.xml
+++ b/res/layout-sw580dp/event_field_editor_view.xml
@@ -39,7 +39,6 @@
<include
android:id="@+id/spinner"
layout="@layout/edit_spinner"
- android:paddingTop="15dip"
android:visibility="gone" />
<include
diff --git a/res/layout-sw580dp/external_raw_contact_editor_view.xml b/res/layout-sw580dp/external_raw_contact_editor_view.xml
index b185c8a..fba5220 100644
--- a/res/layout-sw580dp/external_raw_contact_editor_view.xml
+++ b/res/layout-sw580dp/external_raw_contact_editor_view.xml
@@ -22,8 +22,7 @@
android:orientation="vertical">
<include
- layout="@layout/raw_contact_editor_header"
- android:id="@+id/header" />
+ layout="@layout/editor_account_header" />
<LinearLayout
android:id="@+id/body"
diff --git a/res/layout-xlarge/group_editor_activity.xml b/res/layout-sw580dp/group_editor_activity.xml
similarity index 100%
rename from res/layout-xlarge/group_editor_activity.xml
rename to res/layout-sw580dp/group_editor_activity.xml
diff --git a/res/layout-sw580dp/people_activity.xml b/res/layout-sw580dp/people_activity.xml
index 1d02042..8bf627f 100644
--- a/res/layout-sw580dp/people_activity.xml
+++ b/res/layout-sw580dp/people_activity.xml
@@ -40,11 +40,6 @@
android:background="@drawable/list_background_holo"
android:visibility="gone">
- <View
- style="@style/SectionDivider"
- android:layout_marginLeft="40dip"
- android:layout_marginTop="24dip" />
-
<!-- All -->
<fragment
android:id="@+id/all_fragment"
diff --git a/res/layout-sw580dp/raw_contact_editor_header.xml b/res/layout-sw580dp/raw_contact_editor_header.xml
deleted file mode 100644
index 498998d..0000000
--- a/res/layout-sw580dp/raw_contact_editor_header.xml
+++ /dev/null
@@ -1,68 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2010 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.
--->
-
-
-<!-- Account info header -->
-<FrameLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_height="64dip"
- android:layout_width="match_parent">
-
- <RelativeLayout
- android:id="@+id/account"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="?android:attr/selectableItemBackground">
-
- <ImageView
- android:id="@+id/account_icon"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginLeft="7dip"
- android:layout_marginRight="7dip"
- android:layout_centerVertical="true"
- android:layout_alignParentRight="true"
- android:layout_below="@id/header_color_bar" />
-
- <TextView
- android:id="@+id/account_type"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_toLeftOf="@+id/account_icon"
- android:layout_alignTop="@id/account_icon"
- android:layout_marginTop="-4dip"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:textColor="?android:attr/textColorPrimary"
- android:singleLine="true" />
-
- <TextView
- android:id="@+id/account_name"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_toLeftOf="@+id/account_icon"
- android:layout_alignBottom="@+id/account_icon"
- android:layout_marginBottom="2dip"
-
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:textColor="?android:attr/textColorPrimary"
- android:singleLine="true" />
-
- <include
- android:id="@+id/divider"
- android:layout_alignParentBottom="true"
- layout="@layout/edit_divider" />
- </RelativeLayout>
-</FrameLayout>
\ No newline at end of file
diff --git a/res/layout-sw580dp/raw_contact_editor_view.xml b/res/layout-sw580dp/raw_contact_editor_view.xml
index 9c3f708..11fc161 100644
--- a/res/layout-sw580dp/raw_contact_editor_view.xml
+++ b/res/layout-sw580dp/raw_contact_editor_view.xml
@@ -21,14 +21,8 @@
android:layout_height="wrap_content"
android:orientation="vertical">
- <FrameLayout
- android:id="@+id/anchor_for_account_switcher"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content">
- <include
- layout="@layout/raw_contact_editor_header"
- android:id="@+id/header" />
- </FrameLayout>
+ <include
+ layout="@layout/editor_account_header" />
<LinearLayout
android:id="@+id/body"
@@ -124,8 +118,8 @@
<com.android.contacts.widget.InterpolatingLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginTop="10dip"
- android:layout_marginBottom="42dip">
+ android:layout_marginTop="16dip"
+ android:layout_marginBottom="32dip">
<Button
android:id="@+id/button_add_field"
android:text="@string/add_field"
diff --git a/res/layout/add_group_menu_item.xml b/res/layout/add_group_menu_item.xml
index b2ff678..841159e 100644
--- a/res/layout/add_group_menu_item.xml
+++ b/res/layout/add_group_menu_item.xml
@@ -36,7 +36,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginRight="8dip"
- android:src="@drawable/ic_menu_display_all_holo_light"
+ android:src="@drawable/ic_menu_add_group_holo_dark"
android:description="@string/menu_new_group_action_bar" />
<TextView
@@ -44,6 +44,10 @@
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:textAppearance="?android:attr/textAppearanceMedium"
- android:text="@string/menu_new_group_action_bar" />
+ android:text="@string/menu_new_group_action_bar"
+ android:textColor="@color/action_bar_button_text_color"
+ style="@android:style/Widget.Holo.ActionBar.TabText" />
+
</LinearLayout>
+
</LinearLayout>
diff --git a/res/layout/call_log_list_item.xml b/res/layout/call_log_list_item.xml
index dc0d9e1..fbb8d41 100644
--- a/res/layout/call_log_list_item.xml
+++ b/res/layout/call_log_list_item.xml
@@ -46,14 +46,6 @@
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/call_log_inner_margin"
/>
- <ImageView
- android:id="@+id/plain_contact_photo"
- android:layout_width="@dimen/call_log_list_contact_photo_size"
- android:layout_height="@dimen/call_log_list_contact_photo_size"
- android:layout_alignParentLeft="true"
- android:layout_centerVertical="true"
- android:layout_marginLeft="@dimen/call_log_inner_margin"
- />
<LinearLayout
android:id="@+id/divider"
android:layout_width="wrap_content"
diff --git a/res/layout/contact_detail_list_item.xml b/res/layout/contact_detail_list_item.xml
index e2818e9..ccfa01d 100644
--- a/res/layout/contact_detail_list_item.xml
+++ b/res/layout/contact_detail_list_item.xml
@@ -76,7 +76,7 @@
android:layout_height="16dip"
android:visibility="gone"
android:layout_gravity="center_vertical"
- android:background="@drawable/ic_menu_mark" />
+ android:background="@drawable/ic_list_default_mime_holo_dark" />
</LinearLayout>
diff --git a/res/layout/contact_list_filter.xml b/res/layout/contact_list_filter.xml
index de05cf8..37aaf53 100644
--- a/res/layout/contact_list_filter.xml
+++ b/res/layout/contact_list_filter.xml
@@ -25,7 +25,9 @@
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="0dip"
- android:layout_weight="1" />
+ android:layout_weight="1"
+ android:layout_marginLeft="@dimen/contact_filter_left_margin"
+ android:layout_marginRight="@dimen/contact_filter_right_margin" />
<View
android:layout_width="match_parent"
diff --git a/res/layout/contact_list_filter_custom.xml b/res/layout/contact_list_filter_custom.xml
index 195ff1a..a4fe48e 100644
--- a/res/layout/contact_list_filter_custom.xml
+++ b/res/layout/contact_list_filter_custom.xml
@@ -25,8 +25,8 @@
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="1"
- android:layout_marginLeft="16dip"
- android:layout_marginRight="16dip"/>
+ android:layout_marginLeft="@dimen/contact_filter_left_margin"
+ android:layout_marginRight="@dimen/contact_filter_right_margin" />
<View
android:layout_width="match_parent"
diff --git a/res/layout/filter_spinner_item.xml b/res/layout/contact_list_filter_item.xml
similarity index 75%
rename from res/layout/filter_spinner_item.xml
rename to res/layout/contact_list_filter_item.xml
index c2d5d68..b27cab8 100644
--- a/res/layout/filter_spinner_item.xml
+++ b/res/layout/contact_list_filter_item.xml
@@ -17,32 +17,27 @@
<view
xmlns:android="http://schemas.android.com/apk/res/android"
class="com.android.contacts.list.ContactListFilterView"
- android:layout_height="52dip"
- android:layout_width="fill_parent"
- android:paddingLeft="7dip"
- android:paddingRight="7dip"
- android:paddingTop="2dip"
- android:paddingBottom="2dip"
- android:gravity="left">
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:minHeight="@dimen/contact_filter_item_min_height">
<View
android:id="@+id/indent"
- android:layout_width="40dip"
+ android:layout_width="32dip"
android:layout_height="fill_parent" />
<ImageView
android:id="@+id/icon"
android:scaleType="fitCenter"
- android:layout_width="24dip"
- android:layout_height="24dip"
- android:layout_marginLeft="8dip"
- android:layout_marginRight="7dip"
+ android:layout_width="@dimen/contact_filter_icon_size"
+ android:layout_height="@dimen/contact_filter_icon_size"
android:layout_gravity="center_vertical" />
<TextView
android:id="@+id/label"
android:layout_width="wrap_content"
- android:layout_height="fill_parent"
+ android:layout_height="match_parent"
+ android:layout_marginLeft="8dip"
android:textAppearance="?android:attr/textAppearanceMedium"
android:gravity="center_vertical"
android:ellipsize="end" />
diff --git a/res/layout/contacts_list_content.xml b/res/layout/contacts_list_content.xml
index 490499c..567e63d 100644
--- a/res/layout/contacts_list_content.xml
+++ b/res/layout/contacts_list_content.xml
@@ -14,54 +14,58 @@
limitations under the License.
-->
-<FrameLayout
+<!-- android:paddingTop is used instead of android:layout_marginTop. It looks
+ android:layout_marginTop is ignored when used with <fragment></fragment>, which
+ only happens in Tablet UI since we rely on ViewPager in Phone UI.
+ Instead, android:layout_marginTop inside <fragment /> is effective. -->
+
+<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/pinned_header_list_layout"
- android:layout_marginTop="@dimen/contact_browser_list_top_margin"
+ android:paddingTop="@dimen/contact_browser_list_top_margin"
+ android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent" >
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical">
+ <!-- Shown only when an Account filter is set. -->
+ <LinearLayout
+ android:id="@+id/account_filter_header_container"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:layout_marginLeft="@dimen/contact_browser_list_header_left_margin"
+ android:layout_marginRight="@dimen/contact_browser_list_header_right_margin"
+ android:visibility="gone">
<TextView
android:id="@+id/account_filter_header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:minHeight="@dimen/contact_filter_header_min_height"
+ android:layout_marginLeft="8dip"
android:singleLine="true"
android:ellipsize="end"
- android:gravity="center"
- android:padding="5dip"
+ android:gravity="left"
android:textAppearance="?android:attr/textAppearanceSmall"
- android:textColor="@android:color/white"
- android:background="@android:color/black"
- android:visibility="gone" />
-
- <view
- class="com.android.contacts.list.ContactEntryListView"
- android:id="@android:id/list"
- android:layout_width="match_parent"
- android:layout_height="0dip"
- android:fastScrollEnabled="true"
- android:layout_weight="1" />
-
- <ViewStub
- android:id="@+id/footer_stub"
- android:layout="@layout/footer_panel"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content" />
+ android:textColor="?android:attr/textColorSecondary" />
+ <View
+ android:id="@+id/account_filter_header_bottom_divider"
+ style="@style/SectionDivider" />
</LinearLayout>
- <TextView
- android:id="@+id/contacts_count"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginRight="@dimen/contacts_count_right_margin"
- android:singleLine="true"
- android:ellipsize="end"
- android:gravity="right"
- android:layout_gravity="top|right"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:textColor="@color/contact_count_text_color"
- android:background="@color/contact_browser_list_bk_color" />
-</FrameLayout>
+
+ <view
+ class="com.android.contacts.list.ContactEntryListView"
+ android:id="@android:id/list"
+ android:layout_width="match_parent"
+ android:layout_height="0dip"
+ android:layout_marginLeft="@dimen/contact_browser_list_left_margin"
+ android:layout_marginRight="@dimen/contact_browser_list_right_margin"
+ android:fastScrollEnabled="true"
+ android:layout_weight="1" />
+
+ <ViewStub
+ android:id="@+id/footer_stub"
+ android:layout="@layout/footer_panel"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content" />
+
+</LinearLayout>
diff --git a/res/layout/custom_contact_list_filter_account.xml b/res/layout/custom_contact_list_filter_account.xml
index b19ae2d..8c1b6c1 100644
--- a/res/layout/custom_contact_list_filter_account.xml
+++ b/res/layout/custom_contact_list_filter_account.xml
@@ -37,7 +37,7 @@
android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="marquee"
- android:textAppearance="?android:attr/textAppearanceLarge"
+ android:textAppearance="?android:attr/textAppearanceMedium"
android:duplicateParentState="true" />
<TextView
@@ -46,8 +46,9 @@
android:layout_height="wrap_content"
android:layout_below="@android:id/text1"
android:layout_alignLeft="@android:id/text1"
- android:maxLines="2"
+ android:maxLines="1"
android:textAppearance="?android:attr/textAppearanceSmall"
+ android:textColor="?android:attr/textColorTertiary"
android:duplicateParentState="true" />
</RelativeLayout>
diff --git a/res/layout/directory_header.xml b/res/layout/directory_header.xml
index 2748923..af0b5bd 100644
--- a/res/layout/directory_header.xml
+++ b/res/layout/directory_header.xml
@@ -19,42 +19,40 @@
xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/DirectoryHeader"
android:layout_width="match_parent"
- android:layout_height="@dimen/directory_header_height"
- >
- <TextView
- android:id="@+id/count"
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:layout_centerVertical="true"
- android:layout_alignParentRight="true"
- android:layout_marginRight="8dip"
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:textColor="?android:attr/textColorTertiary"
- android:textStyle="bold"
- />
- <TextView
- android:id="@+id/label"
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:layout_alignParentLeft="true"
- android:layout_alignBaseline="@id/count"
- android:layout_marginLeft="8dip"
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:textColor="?android:attr/textColorTertiary"
- android:textStyle="bold"
- />
+ android:layout_height="wrap_content">
<TextView
android:id="@+id/display_name"
- android:layout_height="wrap_content"
android:layout_width="wrap_content"
- android:layout_toRightOf="@id/label"
- android:layout_toLeftOf="@id/count"
- android:layout_alignBaseline="@id/count"
- android:layout_marginLeft="6dip"
- android:layout_marginRight="6dip"
+ android:layout_height="wrap_content"
+ android:minHeight="@dimen/directory_header_height"
+ android:layout_toRightOf="@+id/label"
+ android:layout_toLeftOf="@+id/count"
+ android:layout_centerVertical="true"
+ android:layout_marginLeft="8dip"
+ android:layout_marginRight="8dip"
android:textAppearance="?android:attr/textAppearanceSmall"
- android:textColor="?android:attr/textColorTertiary"
- android:singleLine="true"
- android:ellipsize="end"
- />
+ android:textColor="?android:attr/textColorSecondary"
+ android:singleLine="true" />
+ <TextView
+ android:id="@+id/label"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentLeft="true"
+ android:layout_alignBaseline="@id/display_name"
+ android:layout_marginLeft="8dip"
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ android:textColor="?android:attr/textColorSecondary" />
+ <TextView
+ android:id="@+id/count"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentRight="true"
+ android:layout_marginRight="8dip"
+ android:layout_alignBaseline="@id/display_name"
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ android:textColor="?android:attr/textColorSecondary" />
+ <View
+ android:id="@+id/contact_filter_header_bottom_divider"
+ style="@style/SectionDivider"
+ android:layout_below="@id/display_name" />
</RelativeLayout>
diff --git a/res/layout/edit_add_field.xml b/res/layout/edit_add_field.xml
index 31ea05d..b17185d 100644
--- a/res/layout/edit_add_field.xml
+++ b/res/layout/edit_add_field.xml
@@ -17,7 +17,8 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:paddingLeft="13dip"
+ android:minHeight="48dip"
+ android:paddingLeft="16dip"
android:background="?android:attr/selectableItemBackground">
<TextView
android:id="@+id/add_text"
@@ -26,6 +27,6 @@
android:layout_height="wrap_content"
android:duplicateParentState="true"
android:textAppearance="?android:attr/textAppearanceMedium"
- android:textColor="?android:attr/textColorTertiary"
+ android:textColor="?android:attr/textColorSecondary"
android:text="@string/add_new_entry_for_section" />
</FrameLayout>
\ No newline at end of file
diff --git a/res/layout/edit_date_picker.xml b/res/layout/edit_date_picker.xml
index c18d607..5122bbe 100644
--- a/res/layout/edit_date_picker.xml
+++ b/res/layout/edit_date_picker.xml
@@ -19,10 +19,11 @@
<Button
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/date_view"
+ style="?android:attr/spinnerStyle"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginLeft="@dimen/editor_field_left_padding"
android:layout_marginRight="@dimen/editor_field_right_padding"
android:textAppearance="?android:attr/textAppearanceMedium"
- style="@android:style/Widget.Holo.Light.Spinner" />
\ No newline at end of file
+ android:paddingLeft="16dip" />
\ No newline at end of file
diff --git a/res/layout/edit_expansion_view.xml b/res/layout/edit_expansion_view.xml
index 96fe8de..267593d 100644
--- a/res/layout/edit_expansion_view.xml
+++ b/res/layout/edit_expansion_view.xml
@@ -19,12 +19,12 @@
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="top">
+ android:layout_height="match_parent">
<ImageView
android:id="@+id/expansion_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:layout_gravity="top"
android:duplicateParentState="true"
android:background="?android:attr/selectableItemBackground"
android:paddingLeft="@dimen/editor_round_button_padding_left"
diff --git a/res/layout/edit_kind_title.xml b/res/layout/edit_kind_title.xml
index 619ba49..0f755ee 100644
--- a/res/layout/edit_kind_title.xml
+++ b/res/layout/edit_kind_title.xml
@@ -21,22 +21,23 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:paddingLeft="@dimen/editor_field_left_padding"
- android:paddingRight="@dimen/editor_field_right_padding"
+ android:minHeight="24dip"
+ android:paddingLeft="8dip"
+ android:paddingRight="8dip"
android:orientation="vertical">
<TextView
android:id="@+id/kind_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:paddingLeft="@dimen/editor_field_left_padding"
+ android:paddingLeft="8dip"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@color/people_app_theme_color"
android:textStyle="bold"
+ android:textAllCaps="true"
android:singleLine="true"
android:ellipsize="end"
- android:paddingTop="5dip"
- android:paddingBottom="2dip" />
+ android:layout_gravity="center_vertical" />
<ImageView
android:id="@+id/divider"
diff --git a/res/layout/edit_spinner.xml b/res/layout/edit_spinner.xml
index 325eb50..37edcbd 100644
--- a/res/layout/edit_spinner.xml
+++ b/res/layout/edit_spinner.xml
@@ -20,8 +20,8 @@
<Spinner
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/spinner"
+ android:layout_gravity="top"
android:layout_width="@dimen/editor_type_label_width"
android:layout_height="wrap_content"
android:paddingLeft="5dip"
- android:paddingRight="20dip"
- android:textAppearance="?android:attr/textAppearanceSmall"/>
\ No newline at end of file
+ android:paddingRight="20dip"/>
\ No newline at end of file
diff --git a/res/layout/editor_account_header.xml b/res/layout/editor_account_header.xml
index fbce1f9..5181708 100644
--- a/res/layout/editor_account_header.xml
+++ b/res/layout/editor_account_header.xml
@@ -16,11 +16,16 @@
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/account_container"
android:layout_height="wrap_content"
android:layout_width="match_parent"
+ android:minHeight="48dip"
+ android:background="#EEEEEE"
android:orientation="horizontal"
- android:paddingLeft="10dip"
- android:paddingRight="10dip">
+ android:paddingTop="8dip"
+ android:paddingBottom="8dip"
+ android:paddingLeft="16dip"
+ android:paddingRight="16dip">
<LinearLayout
android:id="@+id/account"
@@ -53,8 +58,8 @@
<ImageView
android:id="@+id/account_icon"
- android:layout_width="45dip"
- android:layout_height="45dip"
+ android:layout_width="32dip"
+ android:layout_height="32dip"
android:layout_gravity="center_vertical" />
</FrameLayout>
diff --git a/res/layout/editor_custom_action_bar.xml b/res/layout/editor_custom_action_bar.xml
index 0f42213..c22b089 100644
--- a/res/layout/editor_custom_action_bar.xml
+++ b/res/layout/editor_custom_action_bar.xml
@@ -40,7 +40,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginRight="8dip"
- android:src="@drawable/ic_menu_done_holo_light"
+ android:src="@drawable/ic_menu_done_holo_dark"
android:description="@string/menu_done" />
<TextView
@@ -49,7 +49,7 @@
android:layout_gravity="center_vertical"
android:layout_marginRight="20dip"
android:textAppearance="?android:attr/textAppearanceMedium"
- android:textColor="@android:color/white"
+ android:textColor="@color/action_bar_button_text_color"
android:text="@string/menu_done"
style="@android:style/Widget.Holo.ActionBar.TabText" />
diff --git a/res/layout/event_field_editor_view.xml b/res/layout/event_field_editor_view.xml
index 0dceafc..6903772 100644
--- a/res/layout/event_field_editor_view.xml
+++ b/res/layout/event_field_editor_view.xml
@@ -35,10 +35,14 @@
android:id="@+id/date_view"
layout="@layout/edit_date_picker" />
- <include
+ <Spinner
android:id="@+id/spinner"
- layout="@layout/edit_spinner"
- android:visibility="gone" />
+ android:layout_width="@dimen/editor_type_label_width"
+ android:layout_height="wrap_content"
+ android:paddingLeft="5dip"
+ android:paddingRight="20dip"
+ android:layout_gravity="bottom"
+ android:visibility="gone"/>
<include
android:id="@+id/delete_button_container"
diff --git a/res/layout/external_raw_contact_editor_view.xml b/res/layout/external_raw_contact_editor_view.xml
index 661371d..6f39b34 100644
--- a/res/layout/external_raw_contact_editor_view.xml
+++ b/res/layout/external_raw_contact_editor_view.xml
@@ -19,90 +19,54 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:orientation="horizontal"
- android:paddingBottom="10dip">
+ android:orientation="vertical">
- <!-- Left side color bar -->
- <ImageView
- android:id="@+id/color_bar"
- android:layout_width="4dip"
- android:layout_height="match_parent"
- android:visibility="gone"/>
+ <include
+ layout="@layout/editor_account_header" />
- <!-- The content -->
<LinearLayout
- android:layout_width="0dip"
android:layout_height="wrap_content"
- android:layout_weight="1"
- android:orientation="vertical">
+ android:layout_width="match_parent"
+ android:orientation="horizontal"
+ android:paddingLeft="16dip"
+ android:paddingRight="16dip">
- <!-- Account info header -->
- <ImageView android:id="@+id/header_color_bar"
- android:layout_width="match_parent"
- android:layout_height="4dip"
- android:layout_marginBottom="5dip"
- android:background="@color/edit_divider"/>
+ <TextView android:id="@+id/read_only_name"
+ android:layout_width="0dip"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:gravity="center_vertical"
+ android:singleLine="true"
+ android:ellipsize="end"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:textColor="?android:attr/textColorSecondary"
+ android:textStyle="bold"/>
- <TextView
- android:id="@+id/read_only_warning"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:paddingTop="10dip"
- android:paddingLeft="10dip"
- android:paddingRight="10dip"
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:textColor="?android:attr/textColorTertiary"/>
+ <FrameLayout
+ android:id="@+id/stub_photo"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content">
- <include
- android:id="@+id/account_header"
- layout="@layout/editor_account_header" />
+ <include
+ android:id="@+id/edit_photo"
+ layout="@layout/item_photo_editor" />
- <LinearLayout
- android:layout_height="wrap_content"
- android:layout_width="match_parent"
- android:orientation="horizontal"
- android:paddingTop="20dip"
- android:paddingLeft="10dip"
- android:paddingRight="10dip">
-
- <TextView android:id="@+id/read_only_name"
- android:layout_width="0dip"
- android:layout_height="match_parent"
- android:layout_weight="1"
- android:gravity="center_vertical"
- android:singleLine="true"
- android:ellipsize="end"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:textColor="?android:attr/textColorTertiary"
- android:textStyle="bold"/>
-
- <FrameLayout
- android:id="@+id/stub_photo"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content">
-
- <include
- android:id="@+id/edit_photo"
- layout="@layout/item_photo_editor" />
-
- </FrameLayout>
-
- </LinearLayout>
-
- <Button
- android:id="@+id/button_edit_externally"
- android:text="@string/edit_contact"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginTop="13dip"
- android:layout_marginBottom="13dip"
- android:layout_marginLeft="13dip"/>
-
- <LinearLayout android:id="@+id/sect_general"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical"/>
+ </FrameLayout>
</LinearLayout>
+ <Button
+ android:id="@+id/button_edit_externally"
+ android:text="@string/edit_contact"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="13dip"
+ android:layout_marginBottom="13dip"
+ android:layout_marginLeft="13dip"/>
+
+ <LinearLayout android:id="@+id/sect_general"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"/>
+
</com.android.contacts.editor.ExternalRawContactEditorView>
diff --git a/res/layout/group_browse_list_item.xml b/res/layout/group_browse_list_item.xml
index b9b272c..6f5fcef 100644
--- a/res/layout/group_browse_list_item.xml
+++ b/res/layout/group_browse_list_item.xml
@@ -86,26 +86,22 @@
android:id="@+id/icon_1"
android:layout_width="@dimen/group_list_icon_size"
android:layout_height="@dimen/group_list_icon_size"
- android:layout_marginRight="1dip"
- android:src="@drawable/ic_contact_picture" />
+ android:layout_marginRight="1dip" />
<ImageView
android:id="@+id/icon_2"
android:layout_width="@dimen/group_list_icon_size"
- android:layout_height="@dimen/group_list_icon_size"
- android:src="@drawable/ic_contact_picture" />
+ android:layout_height="@dimen/group_list_icon_size" />
</TableRow>
<TableRow>
<ImageView
android:id="@+id/icon_3"
android:layout_width="@dimen/group_list_icon_size"
android:layout_height="@dimen/group_list_icon_size"
- android:layout_marginRight="1dip"
- android:src="@drawable/ic_contact_picture" />
+ android:layout_marginRight="1dip" />
<ImageView
android:id="@+id/icon_4"
android:layout_width="@dimen/group_list_icon_size"
- android:layout_height="@dimen/group_list_icon_size"
- android:src="@drawable/ic_contact_picture" />
+ android:layout_height="@dimen/group_list_icon_size" />
</TableRow>
</TableLayout>
diff --git a/res/layout/item_group_membership.xml b/res/layout/item_group_membership.xml
index 62d06ea..b6d11f2 100644
--- a/res/layout/item_group_membership.xml
+++ b/res/layout/item_group_membership.xml
@@ -34,6 +34,6 @@
android:gravity="left|center_vertical"
android:ellipsize="end"
android:focusable="true"
- android:paddingLeft="@dimen/editor_field_left_padding" />
+ android:paddingLeft="16dip" />
</com.android.contacts.editor.GroupMembershipView>
diff --git a/res/layout/item_kind_section.xml b/res/layout/item_kind_section.xml
index 0b6017c..157ca1c 100644
--- a/res/layout/item_kind_section.xml
+++ b/res/layout/item_kind_section.xml
@@ -20,7 +20,6 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:paddingBottom="@dimen/editor_field_bottom_padding"
android:orientation="vertical">
<include
diff --git a/res/layout/item_photo_editor.xml b/res/layout/item_photo_editor.xml
index 3590963..2e73cb2 100644
--- a/res/layout/item_photo_editor.xml
+++ b/res/layout/item_photo_editor.xml
@@ -36,6 +36,6 @@
android:clickable="true"
android:focusable="true"
android:contentDescription="@string/description_contact_photo"
- android:background="@drawable/change_photo_box_holo_light"
+ android:background="?android:attr/selectableItemBackground"
/>
</view>
diff --git a/res/layout/item_read_only_field.xml b/res/layout/item_read_only_field.xml
index 9e0967e..03778cc 100644
--- a/res/layout/item_read_only_field.xml
+++ b/res/layout/item_read_only_field.xml
@@ -16,37 +16,20 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
- android:layout_height="?android:attr/listPreferredItemHeight"
+ android:layout_height="wrap_content"
+ android:orientation="vertical">
- android:orientation="vertical"
->
-
- <TextView android:id="@+id/label"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginLeft="10dip"
- android:layout_marginTop="2dip"
-
- android:textAppearance="?android:attr/textAppearanceLarge"
- android:singleLine="true"
- />
+ <include
+ android:id="@+id/kind_title_layout"
+ layout="@layout/edit_kind_title" />
<TextView android:id="@+id/data"
android:layout_width="wrap_content"
android:layout_height="0px"
android:layout_weight="1"
- android:layout_marginLeft="10dip"
- android:layout_marginBottom="4dip"
-
+ android:layout_marginLeft="16dip"
android:textAppearance="?android:attr/textAppearanceMedium"
- android:singleLine="true"
- />
-
- <View
- android:layout_width="match_parent"
- android:layout_height="1px"
-
- android:background="?android:attr/listDivider"
- />
+ android:textColor="?android:attr/textColorSecondary"
+ android:singleLine="true"/>
</LinearLayout>
\ No newline at end of file
diff --git a/res/layout/organization_editor_view_switcher.xml b/res/layout/organization_editor_view_switcher.xml
index c6e16ae..fb21626 100644
--- a/res/layout/organization_editor_view_switcher.xml
+++ b/res/layout/organization_editor_view_switcher.xml
@@ -23,19 +23,22 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:paddingLeft="@dimen/editor_field_left_padding"
- android:paddingRight="@dimen/editor_field_right_padding"
+ android:minHeight="48dip"
android:background="?android:attr/selectableItemBackground">
<TextView
android:id="@+id/add_organization_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:paddingLeft="@dimen/editor_field_left_padding"
+ android:paddingLeft="16dip"
+ android:paddingRight="16dip"
+ android:layout_gravity="center_vertical"
+ android:duplicateParentState="true"
android:textAppearance="?android:attr/textAppearanceMedium"
- android:text="@string/organizationLabelsGroup"
- android:duplicateParentState="true"/>
+ android:textColor="?android:attr/textColorSecondary"
+ android:text="@string/add_organization"/>
+ <!-- This is later populated with the actual editable text fields for "organization" -->
<FrameLayout
android:id="@+id/container"
android:layout_width="match_parent"
diff --git a/res/layout/phonetic_name_editor_view.xml b/res/layout/phonetic_name_editor_view.xml
index 832ca2c..6084d3f 100644
--- a/res/layout/phonetic_name_editor_view.xml
+++ b/res/layout/phonetic_name_editor_view.xml
@@ -18,7 +18,6 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:paddingBottom="@dimen/editor_field_bottom_padding"
android:orientation="vertical">
<include
@@ -29,7 +28,6 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_weight="1"
android:orientation="horizontal"
android:gravity="center_vertical"
android:focusable="true"
diff --git a/res/layout/raw_contact_editor_view.xml b/res/layout/raw_contact_editor_view.xml
index 79183cd..b4aa766 100644
--- a/res/layout/raw_contact_editor_view.xml
+++ b/res/layout/raw_contact_editor_view.xml
@@ -20,58 +20,8 @@
android:layout_height="wrap_content"
android:orientation="vertical">
- <LinearLayout
- android:id="@+id/anchor_for_account_switcher"
- android:layout_height="wrap_content"
- android:layout_width="match_parent"
- android:padding="@dimen/account_header_padding"
- android:orientation="horizontal">
-
- <!--
- TODO: Make this "?android:attr/spinnerStyle" but disable the style if this is not a new
- contact. Since styles aren't easily toggled dynamically, it's easier to just create a
- drawable with the spinner triangle as a background asset and just toggle the background.
- -->
- <LinearLayout
- android:id="@+id/account"
- android:layout_height="wrap_content"
- android:layout_width="0dip"
- android:layout_weight="1"
- android:orientation="vertical"
- android:background="?android:attr/selectableItemBackground">
-
- <TextView
- android:id="@+id/account_type"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:singleLine="true" />
-
- <TextView
- android:id="@+id/account_name"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:textColor="?android:attr/textColorTertiary"
- android:singleLine="true" />
-
- </LinearLayout>
-
- <FrameLayout
- android:layout_width="wrap_content"
- android:layout_height="match_parent">
-
- <ImageView
- android:id="@+id/account_icon"
- android:layout_width="32dip"
- android:layout_height="32dip"
- android:layout_marginLeft="24dip"
- android:layout_marginRight="24dip"
- android:layout_gravity="center_vertical" />
-
- </FrameLayout>
-
- </LinearLayout>
+ <include
+ layout="@layout/editor_account_header" />
<LinearLayout
android:id="@+id/body"
@@ -82,18 +32,30 @@
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
- android:layout_marginRight="4dip"
- android:orientation="horizontal">
+ android:orientation="horizontal"
+ android:paddingTop="8dip">
- <include
- android:id="@+id/edit_name"
- layout="@layout/structured_name_editor_view" />
+ <LinearLayout
+ android:layout_height="wrap_content"
+ android:layout_width="0dip"
+ android:layout_weight="1"
+ android:orientation="vertical">
+
+ <include
+ android:id="@+id/edit_name"
+ layout="@layout/structured_name_editor_view" />
+
+ <include
+ android:id="@+id/edit_phonetic_name"
+ layout="@layout/phonetic_name_editor_view" />
+
+ </LinearLayout>
<FrameLayout
android:id="@+id/stub_photo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginRight="16dip">
+ android:layout_marginRight="8dip">
<include
android:id="@+id/edit_photo"
@@ -103,10 +65,6 @@
</LinearLayout>
- <include
- android:id="@+id/edit_phonetic_name"
- layout="@layout/phonetic_name_editor_view" />
-
<ViewStub android:id="@+id/aggregation_suggestion_stub"
android:inflatedId="@+id/aggregation_suggestion"
android:layout="@layout/aggregation_suggestions"
@@ -126,8 +84,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
- android:layout_marginTop="10dip"
- android:layout_marginBottom="10dip"/>
+ android:layout_marginTop="16dip"
+ android:layout_marginBottom="32dip"/>
</LinearLayout>
</com.android.contacts.editor.RawContactEditorView>
diff --git a/res/layout/search_header.xml b/res/layout/search_header.xml
index ab8ec53..b1ba00f 100644
--- a/res/layout/search_header.xml
+++ b/res/layout/search_header.xml
@@ -17,18 +17,17 @@
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
- android:layout_height="28dip"
- android:background="@drawable/infobar_dark">
+ android:layout_height="wrap_content"
+ android:minHeight="@dimen/contact_filter_header_min_height"
+ android:background="@android:color/transparent">
<TextView
android:id="@+id/totalContactsText"
- android:layout_height="wrap_content"
android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
- android:layout_marginLeft="8dip"
- android:textColor="#ffbfbfbf"
- android:textSize="14sp"
- android:textStyle="normal" />
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ android:textColor="?android:attr/textColorSecondary" />
<ProgressBar
android:id="@+id/progress"
@@ -37,7 +36,6 @@
android:layout_toRightOf="@id/totalContactsText"
style="?android:attr/progressBarStyleSmall"
android:layout_alignParentRight="true"
- android:layout_centerVertical="true"
- android:layout_marginRight="10dip" />
+ android:layout_centerVertical="true" />
</RelativeLayout>
diff --git a/res/layout/structured_name_editor_view.xml b/res/layout/structured_name_editor_view.xml
index 3a66d5e..979a0f3 100644
--- a/res/layout/structured_name_editor_view.xml
+++ b/res/layout/structured_name_editor_view.xml
@@ -16,9 +16,8 @@
<com.android.contacts.editor.StructuredNameEditorView
xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="0dip"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_weight="1"
android:orientation="vertical">
<include
@@ -29,7 +28,6 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_weight="1"
android:orientation="horizontal"
android:focusable="true"
android:clickable="true">
diff --git a/res/layout/text_fields_editor_view.xml b/res/layout/text_fields_editor_view.xml
index c8d35a4..89970c6 100644
--- a/res/layout/text_fields_editor_view.xml
+++ b/res/layout/text_fields_editor_view.xml
@@ -34,13 +34,13 @@
layout="@layout/edit_field_list" />
<include
- android:id="@+id/spinner"
- layout="@layout/edit_spinner"
+ android:id="@+id/expansion_view_container"
+ layout="@layout/edit_expansion_view"
android:visibility="gone" />
<include
- android:id="@+id/expansion_view_container"
- layout="@layout/edit_expansion_view"
+ android:id="@+id/spinner"
+ layout="@layout/edit_spinner"
android:visibility="gone" />
<include
diff --git a/res/layout/user_profile_button.xml b/res/layout/user_profile_button.xml
new file mode 100644
index 0000000..b7b5e1d
--- /dev/null
+++ b/res/layout/user_profile_button.xml
@@ -0,0 +1,27 @@
+<?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.
+-->
+
+<Button
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:background="?android:attr/selectableItemBackground"
+ android:paddingLeft="@dimen/contact_browser_list_left_margin"
+ android:singleLine="true"
+ android:text="@string/profile_display_name"
+ android:ellipsize="end"
+ android:gravity="left|center_vertical"
+ android:textAppearance="?android:attr/textAppearanceMedium" />
diff --git a/res/layout/user_profile_header.xml b/res/layout/user_profile_header.xml
new file mode 100644
index 0000000..ae803ba
--- /dev/null
+++ b/res/layout/user_profile_header.xml
@@ -0,0 +1,60 @@
+<?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.
+-->
+
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:background="@color/contact_browser_list_bk_color"
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content" >
+
+ <LinearLayout
+ android:orientation="horizontal"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content" >
+
+ <TextView
+ android:id="@+id/profile_title"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="@dimen/contact_browser_list_left_margin"
+ android:singleLine="true"
+ android:text="@string/user_profile_contacts_list_header"
+ android:textStyle="bold"
+ android:ellipsize="end"
+ android:gravity="left"
+ android:layout_weight="1"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:textColor="@color/people_app_theme_color" />
+
+ <TextView
+ android:id="@+id/contacts_count"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:singleLine="true"
+ android:ellipsize="end"
+ android:layout_gravity="right"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:textColor="@color/contact_count_text_color" />
+ </LinearLayout>
+
+ <View
+ android:background="@color/people_app_theme_color"
+ android:layout_marginLeft="@dimen/contact_browser_list_left_margin"
+ android:layout_width="match_parent"
+ android:layout_height="1px" />
+
+</LinearLayout>
\ No newline at end of file
diff --git a/res/menu-sw580dp-w720dp/actions.xml b/res/menu-sw580dp-w720dp/actions.xml
index 534332c..4f0da2c 100644
--- a/res/menu-sw580dp-w720dp/actions.xml
+++ b/res/menu-sw580dp-w720dp/actions.xml
@@ -22,13 +22,13 @@
<item
android:id="@+id/menu_add_contact"
- android:icon="@drawable/ic_menu_add_contact_holo_light"
+ android:icon="@drawable/ic_menu_add_contact_holo_dark"
android:title="@string/menu_new_contact_action_bar"
android:showAsAction="withText|always" />
<item
android:id="@+id/menu_custom_add_group"
- android:icon="@drawable/ic_menu_display_all_holo_light"
+ android:icon="@drawable/ic_menu_add_group_holo_dark"
android:title="@string/menu_new_group_action_bar"
android:showAsAction="withText|always" />
diff --git a/res/menu-sw580dp-w720dp/view_contact.xml b/res/menu-sw580dp-w720dp/view_contact.xml
index 0fc918b..24b8ac1 100644
--- a/res/menu-sw580dp-w720dp/view_contact.xml
+++ b/res/menu-sw580dp-w720dp/view_contact.xml
@@ -17,7 +17,7 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/menu_edit"
- android:icon="@drawable/ic_menu_compose_holo_light"
+ android:icon="@drawable/ic_menu_compose_holo_dark"
android:title="@string/menu_editContact"
android:alphabeticShortcut="e"
android:showAsAction="always" />
diff --git a/res/menu-sw580dp-w720dp/view_group.xml b/res/menu-sw580dp-w720dp/view_group.xml
index 8f7b7d6..1348d84 100644
--- a/res/menu-sw580dp-w720dp/view_group.xml
+++ b/res/menu-sw580dp-w720dp/view_group.xml
@@ -17,7 +17,7 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/menu_edit_group"
- android:icon="@drawable/ic_menu_compose_holo_light"
+ android:icon="@drawable/ic_menu_compose_holo_dark"
android:title="@string/menu_editGroup"
android:alphabeticShortcut="e"
android:showAsAction="always" />
diff --git a/res/menu-sw580dp/actions.xml b/res/menu-sw580dp/actions.xml
index 593d693..b6cdfbf 100644
--- a/res/menu-sw580dp/actions.xml
+++ b/res/menu-sw580dp/actions.xml
@@ -22,13 +22,13 @@
<item
android:id="@+id/menu_add_contact"
- android:icon="@drawable/ic_menu_add_contact_holo_light"
+ android:icon="@drawable/ic_menu_add_contact_holo_dark"
android:title="@string/menu_new_contact_action_bar"
android:showAsAction="withText" />
<item
android:id="@+id/menu_add_group"
- android:icon="@drawable/ic_menu_display_all_holo_light"
+ android:icon="@drawable/ic_menu_add_group_holo_dark"
android:title="@string/menu_new_group_action_bar"
android:showAsAction="withText" />
diff --git a/res/menu-sw580dp/view_contact.xml b/res/menu-sw580dp/view_contact.xml
index e4b4b37..807bfc9 100644
--- a/res/menu-sw580dp/view_contact.xml
+++ b/res/menu-sw580dp/view_contact.xml
@@ -17,7 +17,7 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/menu_edit"
- android:icon="@drawable/ic_menu_compose_holo_light"
+ android:icon="@drawable/ic_menu_compose_holo_dark"
android:title="@string/menu_editContact"
android:alphabeticShortcut="e" />
diff --git a/res/menu-sw580dp/view_group.xml b/res/menu-sw580dp/view_group.xml
index 5e5cf9f..cd52030 100644
--- a/res/menu-sw580dp/view_group.xml
+++ b/res/menu-sw580dp/view_group.xml
@@ -17,7 +17,7 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/menu_edit_group"
- android:icon="@drawable/ic_menu_compose_holo_light"
+ android:icon="@drawable/ic_menu_compose_holo_dark"
android:title="@string/menu_editGroup"
android:alphabeticShortcut="e" />
diff --git a/res/menu/actions.xml b/res/menu/actions.xml
index 346875b..2af9e92 100644
--- a/res/menu/actions.xml
+++ b/res/menu/actions.xml
@@ -22,13 +22,13 @@
<item
android:id="@+id/menu_add_contact"
- android:icon="@drawable/ic_menu_add_contact_holo_light"
+ android:icon="@drawable/ic_menu_add_contact_holo_dark"
android:title="@string/menu_new_contact_action_bar"
android:showAsAction="ifRoom" />
<item
android:id="@+id/menu_add_group"
- android:icon="@drawable/ic_menu_display_all_holo_light"
+ android:icon="@drawable/ic_menu_add_group_holo_dark"
android:title="@string/menu_new_group_action_bar"
android:showAsAction="ifRoom" />
diff --git a/res/menu/dialtacts_options.xml b/res/menu/dialtacts_options.xml
index aa3af3f..99f87ff 100644
--- a/res/menu/dialtacts_options.xml
+++ b/res/menu/dialtacts_options.xml
@@ -18,4 +18,9 @@
android:id="@+id/search_on_action_bar"
android:icon="@android:drawable/ic_menu_search"
android:showAsAction="always" />
+
+ <item
+ android:id="@+id/filter_option"
+ android:title="@string/menu_contacts_filter"
+ android:showAsAction="withText" />
</menu>
diff --git a/res/menu/view_contact.xml b/res/menu/view_contact.xml
index 17ed7c6..2ae4806 100644
--- a/res/menu/view_contact.xml
+++ b/res/menu/view_contact.xml
@@ -17,7 +17,7 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/menu_edit"
- android:icon="@drawable/ic_menu_compose_holo_light"
+ android:icon="@drawable/ic_menu_compose_holo_dark"
android:title="@string/menu_editContact"
android:alphabeticShortcut="e" />
diff --git a/res/menu/view_group.xml b/res/menu/view_group.xml
index 5e5cf9f..cd52030 100644
--- a/res/menu/view_group.xml
+++ b/res/menu/view_group.xml
@@ -17,7 +17,7 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/menu_edit_group"
- android:icon="@drawable/ic_menu_compose_holo_light"
+ android:icon="@drawable/ic_menu_compose_holo_dark"
android:title="@string/menu_editGroup"
android:alphabeticShortcut="e" />
diff --git a/res/values-af/strings.xml b/res/values-af/strings.xml
index 1ecd7ec..a378d95 100644
--- a/res/values-af/strings.xml
+++ b/res/values-af/strings.xml
@@ -16,7 +16,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="sharedUserLabel" msgid="7965035505237135241">"Android-kernprogramme"</string>
<string name="launcherDialer" msgid="8636288196618486553">"Foon"</string>
<!-- no translation found for people (1048457247435785074) -->
<skip />
diff --git a/res/values-am/strings.xml b/res/values-am/strings.xml
index 5ddc457..1d9f47a 100644
--- a/res/values-am/strings.xml
+++ b/res/values-am/strings.xml
@@ -16,7 +16,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="sharedUserLabel" msgid="7965035505237135241">"Android ኮር ትግበራ"</string>
<string name="launcherDialer" msgid="8636288196618486553">"ስልክ"</string>
<!-- no translation found for people (1048457247435785074) -->
<skip />
diff --git a/res/values-ar/strings.xml b/res/values-ar/strings.xml
index 9492f43..68b1a5a 100644
--- a/res/values-ar/strings.xml
+++ b/res/values-ar/strings.xml
@@ -16,7 +16,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="sharedUserLabel" msgid="7965035505237135241">"تطبيقات Android المركزية"</string>
<string name="launcherDialer" msgid="8636288196618486553">"الهاتف"</string>
<string name="people" msgid="1048457247435785074">"أشخاص"</string>
<string name="contactsList" msgid="8661624236494819731">"جهات الاتصال"</string>
diff --git a/res/values-bg/strings.xml b/res/values-bg/strings.xml
index f82df23..b39963a 100644
--- a/res/values-bg/strings.xml
+++ b/res/values-bg/strings.xml
@@ -16,7 +16,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="sharedUserLabel" msgid="7965035505237135241">"Основни приложения на Android"</string>
<string name="launcherDialer" msgid="8636288196618486553">"Телефон"</string>
<string name="people" msgid="1048457247435785074">"Хора"</string>
<string name="contactsList" msgid="8661624236494819731">"Контакти"</string>
diff --git a/res/values-ca/strings.xml b/res/values-ca/strings.xml
index be5f171..67fcf5a 100644
--- a/res/values-ca/strings.xml
+++ b/res/values-ca/strings.xml
@@ -16,7 +16,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="sharedUserLabel" msgid="7965035505237135241">"Aplicacions bàsiques d\'Android"</string>
<string name="launcherDialer" msgid="8636288196618486553">"Telèfon"</string>
<string name="people" msgid="1048457247435785074">"Persones"</string>
<string name="contactsList" msgid="8661624236494819731">"Contactes"</string>
diff --git a/res/values-cs/strings.xml b/res/values-cs/strings.xml
index e2b91f0..f9543a2 100644
--- a/res/values-cs/strings.xml
+++ b/res/values-cs/strings.xml
@@ -16,7 +16,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="sharedUserLabel" msgid="7965035505237135241">"Android Core Apps"</string>
<string name="launcherDialer" msgid="8636288196618486553">"Telefon"</string>
<string name="people" msgid="1048457247435785074">"Lidé"</string>
<string name="contactsList" msgid="8661624236494819731">"Kontakty"</string>
diff --git a/res/values-da/strings.xml b/res/values-da/strings.xml
index 3a4dbee..f81febf 100644
--- a/res/values-da/strings.xml
+++ b/res/values-da/strings.xml
@@ -16,7 +16,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="sharedUserLabel" msgid="7965035505237135241">"Android-kerneprogrammer"</string>
<string name="launcherDialer" msgid="8636288196618486553">"Telefon"</string>
<string name="people" msgid="1048457247435785074">"Personer"</string>
<string name="contactsList" msgid="8661624236494819731">"Kontakter"</string>
diff --git a/res/values-de/strings.xml b/res/values-de/strings.xml
index ab6fd14..eaf1452 100644
--- a/res/values-de/strings.xml
+++ b/res/values-de/strings.xml
@@ -16,7 +16,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="sharedUserLabel" msgid="7965035505237135241">"Android Core Apps"</string>
<string name="launcherDialer" msgid="8636288196618486553">"Telefon"</string>
<string name="people" msgid="1048457247435785074">"Kontakte"</string>
<string name="contactsList" msgid="8661624236494819731">"Kontakte"</string>
diff --git a/res/values-el/strings.xml b/res/values-el/strings.xml
index 2c925a3..d9bf8f1 100644
--- a/res/values-el/strings.xml
+++ b/res/values-el/strings.xml
@@ -16,7 +16,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="sharedUserLabel" msgid="7965035505237135241">"Βασικές εφαρμογές Android"</string>
<string name="launcherDialer" msgid="8636288196618486553">"Τηλέφωνο"</string>
<string name="people" msgid="1048457247435785074">"Άτομα"</string>
<string name="contactsList" msgid="8661624236494819731">"Επαφές"</string>
diff --git a/res/values-en-rGB/strings.xml b/res/values-en-rGB/strings.xml
index 5053ebf..3f05cb2 100644
--- a/res/values-en-rGB/strings.xml
+++ b/res/values-en-rGB/strings.xml
@@ -16,7 +16,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="sharedUserLabel" msgid="7965035505237135241">"Android Core Apps"</string>
<string name="launcherDialer" msgid="8636288196618486553">"Phone"</string>
<string name="people" msgid="1048457247435785074">"People"</string>
<string name="contactsList" msgid="8661624236494819731">"Contacts"</string>
diff --git a/res/values-es-rUS/strings.xml b/res/values-es-rUS/strings.xml
index 6b73b2f..89a9378 100644
--- a/res/values-es-rUS/strings.xml
+++ b/res/values-es-rUS/strings.xml
@@ -16,7 +16,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="sharedUserLabel" msgid="7965035505237135241">"Aplicaciones del núcleo de Android"</string>
<string name="launcherDialer" msgid="8636288196618486553">"Teléfono"</string>
<string name="people" msgid="1048457247435785074">"Personas"</string>
<string name="contactsList" msgid="8661624236494819731">"Contactos"</string>
diff --git a/res/values-es/strings.xml b/res/values-es/strings.xml
index aa477fc..839e514 100644
--- a/res/values-es/strings.xml
+++ b/res/values-es/strings.xml
@@ -16,7 +16,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="sharedUserLabel" msgid="7965035505237135241">"Aplicaciones básicas"</string>
<string name="launcherDialer" msgid="8636288196618486553">"Teléfono"</string>
<string name="people" msgid="1048457247435785074">"Contactos"</string>
<string name="contactsList" msgid="8661624236494819731">"Contactos"</string>
diff --git a/res/values-fa/strings.xml b/res/values-fa/strings.xml
index 13abc3a..18da68c 100644
--- a/res/values-fa/strings.xml
+++ b/res/values-fa/strings.xml
@@ -16,7 +16,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="sharedUserLabel" msgid="7965035505237135241">"برنامه های Android Core"</string>
<string name="launcherDialer" msgid="8636288196618486553">"تلفن"</string>
<string name="people" msgid="1048457247435785074">"افراد"</string>
<string name="contactsList" msgid="8661624236494819731">"مخاطبین"</string>
diff --git a/res/values-fi/strings.xml b/res/values-fi/strings.xml
index 97c4c12..dee2c8a 100644
--- a/res/values-fi/strings.xml
+++ b/res/values-fi/strings.xml
@@ -16,7 +16,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="sharedUserLabel" msgid="7965035505237135241">"Androidin ydinsovellukset"</string>
<string name="launcherDialer" msgid="8636288196618486553">"Puhelin"</string>
<string name="people" msgid="1048457247435785074">"Henkilöt"</string>
<string name="contactsList" msgid="8661624236494819731">"Yhteystiedot"</string>
diff --git a/res/values-fr/strings.xml b/res/values-fr/strings.xml
index 397b2f4..e9b3804 100644
--- a/res/values-fr/strings.xml
+++ b/res/values-fr/strings.xml
@@ -16,7 +16,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="sharedUserLabel" msgid="7965035505237135241">"Applications de base Android"</string>
<string name="launcherDialer" msgid="8636288196618486553">"Téléphone"</string>
<string name="people" msgid="1048457247435785074">"Contacts"</string>
<string name="contactsList" msgid="8661624236494819731">"Contacts"</string>
diff --git a/res/values-hr/strings.xml b/res/values-hr/strings.xml
index 9974136..9a9fb91 100644
--- a/res/values-hr/strings.xml
+++ b/res/values-hr/strings.xml
@@ -16,7 +16,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="sharedUserLabel" msgid="7965035505237135241">"Matične aplikacije za Android"</string>
<string name="launcherDialer" msgid="8636288196618486553">"Telefon"</string>
<string name="people" msgid="1048457247435785074">"Osobe"</string>
<string name="contactsList" msgid="8661624236494819731">"Kontakti"</string>
diff --git a/res/values-hu/strings.xml b/res/values-hu/strings.xml
index 7231095..a421eef 100644
--- a/res/values-hu/strings.xml
+++ b/res/values-hu/strings.xml
@@ -16,7 +16,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="sharedUserLabel" msgid="7965035505237135241">"Alap Android-alkalmazások"</string>
<string name="launcherDialer" msgid="8636288196618486553">"Telefon"</string>
<string name="people" msgid="1048457247435785074">"Személyek"</string>
<string name="contactsList" msgid="8661624236494819731">"Címtár"</string>
diff --git a/res/values-in/strings.xml b/res/values-in/strings.xml
index 2b12cba..af51e34 100644
--- a/res/values-in/strings.xml
+++ b/res/values-in/strings.xml
@@ -16,7 +16,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="sharedUserLabel" msgid="7965035505237135241">"Aplikasi Inti Android"</string>
<string name="launcherDialer" msgid="8636288196618486553">"Telepon"</string>
<string name="people" msgid="1048457247435785074">"Orang"</string>
<string name="contactsList" msgid="8661624236494819731">"Kenalan"</string>
diff --git a/res/values-it/strings.xml b/res/values-it/strings.xml
index af382bf..d7043c8 100644
--- a/res/values-it/strings.xml
+++ b/res/values-it/strings.xml
@@ -16,7 +16,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="sharedUserLabel" msgid="7965035505237135241">"Android Core Apps"</string>
<string name="launcherDialer" msgid="8636288196618486553">"Telefono"</string>
<string name="people" msgid="1048457247435785074">"Persone"</string>
<string name="contactsList" msgid="8661624236494819731">"Contatti"</string>
diff --git a/res/values-iw/strings.xml b/res/values-iw/strings.xml
index 923b06b..031a348 100644
--- a/res/values-iw/strings.xml
+++ b/res/values-iw/strings.xml
@@ -16,7 +16,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="sharedUserLabel" msgid="7965035505237135241">"Android Core Apps"</string>
<string name="launcherDialer" msgid="8636288196618486553">"טלפון"</string>
<string name="people" msgid="1048457247435785074">"אנשים"</string>
<string name="contactsList" msgid="8661624236494819731">"אנשי קשר"</string>
diff --git a/res/values-ja/strings.xml b/res/values-ja/strings.xml
index 1a34673..3be3ba3 100644
--- a/res/values-ja/strings.xml
+++ b/res/values-ja/strings.xml
@@ -16,7 +16,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="sharedUserLabel" msgid="7965035505237135241">"Android Core Apps"</string>
<string name="launcherDialer" msgid="8636288196618486553">"電話"</string>
<string name="people" msgid="1048457247435785074">"ユーザー"</string>
<string name="contactsList" msgid="8661624236494819731">"連絡先"</string>
diff --git a/res/values-ko/strings.xml b/res/values-ko/strings.xml
index 69b7cfe..701afc3 100644
--- a/res/values-ko/strings.xml
+++ b/res/values-ko/strings.xml
@@ -16,7 +16,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="sharedUserLabel" msgid="7965035505237135241">"Android Core 애플리케이션"</string>
<string name="launcherDialer" msgid="8636288196618486553">"휴대전화"</string>
<string name="people" msgid="1048457247435785074">"인물"</string>
<string name="contactsList" msgid="8661624236494819731">"주소록"</string>
diff --git a/res/values-lt/strings.xml b/res/values-lt/strings.xml
index 08a17e3..9d76931 100644
--- a/res/values-lt/strings.xml
+++ b/res/values-lt/strings.xml
@@ -16,7 +16,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="sharedUserLabel" msgid="7965035505237135241">"Pagrindinės „Android“ programos"</string>
<string name="launcherDialer" msgid="8636288196618486553">"Telefonas"</string>
<string name="people" msgid="1048457247435785074">"Žmonės"</string>
<string name="contactsList" msgid="8661624236494819731">"Adresinė"</string>
diff --git a/res/values-lv/strings.xml b/res/values-lv/strings.xml
index cf15157..e8fae81 100644
--- a/res/values-lv/strings.xml
+++ b/res/values-lv/strings.xml
@@ -16,7 +16,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="sharedUserLabel" msgid="7965035505237135241">"Android Core Apps"</string>
<string name="launcherDialer" msgid="8636288196618486553">"Tālrunis"</string>
<string name="people" msgid="1048457247435785074">"People"</string>
<string name="contactsList" msgid="8661624236494819731">"Kontaktpersonas"</string>
diff --git a/res/values-ms/strings.xml b/res/values-ms/strings.xml
index 6db7e2f..cd6e42f 100644
--- a/res/values-ms/strings.xml
+++ b/res/values-ms/strings.xml
@@ -16,7 +16,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="sharedUserLabel" msgid="7965035505237135241">"Apl Teras Android"</string>
<string name="launcherDialer" msgid="8636288196618486553">"Telefon"</string>
<string name="people" msgid="1048457247435785074">"Orang"</string>
<string name="contactsList" msgid="8661624236494819731">"Kenalan"</string>
diff --git a/res/values-nb/strings.xml b/res/values-nb/strings.xml
index bff32d2..62f74ed 100644
--- a/res/values-nb/strings.xml
+++ b/res/values-nb/strings.xml
@@ -16,7 +16,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="sharedUserLabel" msgid="7965035505237135241">"Kjerneprogrammer for Android"</string>
<string name="launcherDialer" msgid="8636288196618486553">"Telefon"</string>
<string name="people" msgid="1048457247435785074">"Personer"</string>
<string name="contactsList" msgid="8661624236494819731">"Kontakter"</string>
diff --git a/res/values-nl/strings.xml b/res/values-nl/strings.xml
index 4ee82e2..ca2e7fd 100644
--- a/res/values-nl/strings.xml
+++ b/res/values-nl/strings.xml
@@ -16,7 +16,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="sharedUserLabel" msgid="7965035505237135241">"Android-kerntoepassingen"</string>
<string name="launcherDialer" msgid="8636288196618486553">"Telefoon"</string>
<string name="people" msgid="1048457247435785074">"Personen"</string>
<string name="contactsList" msgid="8661624236494819731">"Contacten"</string>
diff --git a/res/values-pl/strings.xml b/res/values-pl/strings.xml
index ad4c95f..068d356 100644
--- a/res/values-pl/strings.xml
+++ b/res/values-pl/strings.xml
@@ -16,7 +16,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="sharedUserLabel" msgid="7965035505237135241">"Aplikacje główne systemu Android"</string>
<string name="launcherDialer" msgid="8636288196618486553">"Telefon"</string>
<string name="people" msgid="1048457247435785074">"Osoby"</string>
<string name="contactsList" msgid="8661624236494819731">"Kontakty"</string>
diff --git a/res/values-pt/strings.xml b/res/values-pt/strings.xml
index 674c94c..5ccc9a8 100644
--- a/res/values-pt/strings.xml
+++ b/res/values-pt/strings.xml
@@ -16,7 +16,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="sharedUserLabel" msgid="7965035505237135241">"Principais aplicativos do Android"</string>
<string name="launcherDialer" msgid="8636288196618486553">"Telefone"</string>
<string name="people" msgid="1048457247435785074">"Pessoas"</string>
<string name="contactsList" msgid="8661624236494819731">"Contatos"</string>
diff --git a/res/values-rm/strings.xml b/res/values-rm/strings.xml
index 9f166d5..e8298d3 100644
--- a/res/values-rm/strings.xml
+++ b/res/values-rm/strings.xml
@@ -16,7 +16,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="sharedUserLabel" msgid="7965035505237135241">"Applicaziuns da basa dad Android"</string>
<string name="launcherDialer" msgid="8636288196618486553">"Telefon"</string>
<!-- no translation found for people (1048457247435785074) -->
<skip />
diff --git a/res/values-ro/strings.xml b/res/values-ro/strings.xml
index 4ac6d4e..a2d4214 100644
--- a/res/values-ro/strings.xml
+++ b/res/values-ro/strings.xml
@@ -16,7 +16,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="sharedUserLabel" msgid="7965035505237135241">"Android Core Apps"</string>
<string name="launcherDialer" msgid="8636288196618486553">"Telefon"</string>
<string name="people" msgid="1048457247435785074">"Persoane"</string>
<string name="contactsList" msgid="8661624236494819731">"Agendă"</string>
diff --git a/res/values-ru/strings.xml b/res/values-ru/strings.xml
index 7345f24..2ab1d82 100644
--- a/res/values-ru/strings.xml
+++ b/res/values-ru/strings.xml
@@ -16,7 +16,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="sharedUserLabel" msgid="7965035505237135241">"Основные приложения Android"</string>
<string name="launcherDialer" msgid="8636288196618486553">"Телефон"</string>
<string name="people" msgid="1048457247435785074">"Люди"</string>
<string name="contactsList" msgid="8661624236494819731">"Контакты"</string>
diff --git a/res/values-sk/strings.xml b/res/values-sk/strings.xml
index cc946e5..cbd3cfc 100644
--- a/res/values-sk/strings.xml
+++ b/res/values-sk/strings.xml
@@ -16,7 +16,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="sharedUserLabel" msgid="7965035505237135241">"Android Core Apps"</string>
<string name="launcherDialer" msgid="8636288196618486553">"Telefón"</string>
<string name="people" msgid="1048457247435785074">"Ľudia"</string>
<string name="contactsList" msgid="8661624236494819731">"Kontakty"</string>
diff --git a/res/values-sl/strings.xml b/res/values-sl/strings.xml
index 98f204e..c222d82 100644
--- a/res/values-sl/strings.xml
+++ b/res/values-sl/strings.xml
@@ -16,7 +16,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="sharedUserLabel" msgid="7965035505237135241">"Osnovni programi Android"</string>
<string name="launcherDialer" msgid="8636288196618486553">"Telefon"</string>
<string name="people" msgid="1048457247435785074">"Ljudje"</string>
<string name="contactsList" msgid="8661624236494819731">"Stiki"</string>
diff --git a/res/values-sr/strings.xml b/res/values-sr/strings.xml
index fa75044..a99d94b 100644
--- a/res/values-sr/strings.xml
+++ b/res/values-sr/strings.xml
@@ -16,7 +16,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="sharedUserLabel" msgid="7965035505237135241">"Android Core апликације"</string>
<string name="launcherDialer" msgid="8636288196618486553">"Телефон"</string>
<string name="people" msgid="1048457247435785074">"Особе"</string>
<string name="contactsList" msgid="8661624236494819731">"Контакти"</string>
diff --git a/res/values-sv/strings.xml b/res/values-sv/strings.xml
index e57ef3c..0cabccc 100644
--- a/res/values-sv/strings.xml
+++ b/res/values-sv/strings.xml
@@ -16,7 +16,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="sharedUserLabel" msgid="7965035505237135241">"Android Core Apps"</string>
<string name="launcherDialer" msgid="8636288196618486553">"Telefon"</string>
<string name="people" msgid="1048457247435785074">"Personer"</string>
<string name="contactsList" msgid="8661624236494819731">"Kontakter"</string>
diff --git a/res/values-sw/strings.xml b/res/values-sw/strings.xml
index d424467..1fcdb45 100644
--- a/res/values-sw/strings.xml
+++ b/res/values-sw/strings.xml
@@ -16,7 +16,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="sharedUserLabel" msgid="7965035505237135241">"Programu Msingi za Android"</string>
<string name="launcherDialer" msgid="8636288196618486553">"Simu"</string>
<!-- no translation found for people (1048457247435785074) -->
<skip />
diff --git a/res/values-sw580dp-w1000dp/dimens.xml b/res/values-sw580dp-w1000dp/dimens.xml
index d8503d9..d5f5e58 100644
--- a/res/values-sw580dp-w1000dp/dimens.xml
+++ b/res/values-sw580dp-w1000dp/dimens.xml
@@ -21,6 +21,4 @@
<dimen name="detail_header_view_margin">16dip</dimen>
<dimen name="detail_header_attribution_height">56dip</dimen>
<dimen name="detail_update_section_top_padding">48dip</dimen>
- <dimen name="contact_browser_list_left_margin">0dip</dimen>
- <dimen name="contacts_count_right_margin">24dip</dimen>
</resources>
diff --git a/res/values-sw580dp-w720dp/dimens.xml b/res/values-sw580dp-w720dp/dimens.xml
index c072a95..399c26c 100644
--- a/res/values-sw580dp-w720dp/dimens.xml
+++ b/res/values-sw580dp-w720dp/dimens.xml
@@ -21,6 +21,4 @@
<dimen name="editor_title_label_width">150dip</dimen>
<dimen name="editor_interpolator_narrow_width">800dip</dimen>
<dimen name="editor_name_text_field_right_margin">10dip</dimen>
- <dimen name="contact_browser_list_left_margin">0dip</dimen>
- <dimen name="contacts_count_right_margin">24dip</dimen>
-</resources>
\ No newline at end of file
+</resources>
diff --git a/res/values-sw580dp/dimens.xml b/res/values-sw580dp/dimens.xml
index ab630d2..ed845be 100644
--- a/res/values-sw580dp/dimens.xml
+++ b/res/values-sw580dp/dimens.xml
@@ -32,11 +32,17 @@
<dimen name="action_bar_search_spacing">12dip</dimen>
<dimen name="shortcut_icon_size">64dip</dimen>
<dimen name="list_section_height">37dip</dimen>
- <dimen name="directory_header_height">56dip</dimen>
<dimen name="detail_update_section_item_vertical_padding">32dip</dimen>
<dimen name="search_view_width">400dip</dimen>
- <dimen name="contact_browser_list_left_margin">0dip</dimen>
- <dimen name="contacts_count_right_margin">24dip</dimen>
<!-- Center vertically -->
<dimen name="quick_contact_top_position">-1px</dimen>
+ <!-- Contact list (vertical scroll bar comes left) -->
+ <dimen name="directory_header_height">24dip</dimen>
+ <dimen name="contacts_count_right_margin">24dip</dimen>
+ <dimen name="contact_browser_list_top_margin">16dip</dimen>
+ <dimen name="contact_browser_list_header_left_margin">@dimen/list_visible_scrollbar_padding</dimen>
+ <dimen name="contact_browser_list_header_right_margin">24dip</dimen>
+ <dimen name="contact_browser_list_left_margin">0dip</dimen>
+ <dimen name="contact_browser_list_right_margin">0dip</dimen>
+ <dimen name="list_visible_scrollbar_padding">48dip</dimen>
</resources>
diff --git a/res/values-sw580dp/styles.xml b/res/values-sw580dp/styles.xml
index 0c4c8ba..b9b87cf 100644
--- a/res/values-sw580dp/styles.xml
+++ b/res/values-sw580dp/styles.xml
@@ -84,6 +84,8 @@
</style>
<style name="DirectoryHeader" parent="PeopleTheme">
+ <item name="android:paddingTop">0dip</item>
+ <item name="android:paddingBottom">0dip</item>
<item name="android:background">@drawable/directory_bg_holo</item>
</style>
diff --git a/res/values-th/strings.xml b/res/values-th/strings.xml
index 6368791..b9f075f 100644
--- a/res/values-th/strings.xml
+++ b/res/values-th/strings.xml
@@ -16,7 +16,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="sharedUserLabel" msgid="7965035505237135241">"แอปพลิเคชันหลักของ Android"</string>
<string name="launcherDialer" msgid="8636288196618486553">"โทรศัพท์"</string>
<string name="people" msgid="1048457247435785074">"บุคคล"</string>
<string name="contactsList" msgid="8661624236494819731">"รายชื่อในสมุดโทรศัพท์"</string>
diff --git a/res/values-tl/strings.xml b/res/values-tl/strings.xml
index 990be23..128b98a 100644
--- a/res/values-tl/strings.xml
+++ b/res/values-tl/strings.xml
@@ -16,7 +16,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="sharedUserLabel" msgid="7965035505237135241">"Android Core Apps"</string>
<string name="launcherDialer" msgid="8636288196618486553">"Telepono"</string>
<string name="people" msgid="1048457247435785074">"Mga Tao"</string>
<string name="contactsList" msgid="8661624236494819731">"Mga Contact"</string>
diff --git a/res/values-tr/strings.xml b/res/values-tr/strings.xml
index 75569f8..c83115a 100644
--- a/res/values-tr/strings.xml
+++ b/res/values-tr/strings.xml
@@ -16,7 +16,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="sharedUserLabel" msgid="7965035505237135241">"Android Core Apps"</string>
<string name="launcherDialer" msgid="8636288196618486553">"Telefon"</string>
<string name="people" msgid="1048457247435785074">"Kişiler"</string>
<string name="contactsList" msgid="8661624236494819731">"Kişiler"</string>
diff --git a/res/values-uk/strings.xml b/res/values-uk/strings.xml
index efea722..ac2d030 100644
--- a/res/values-uk/strings.xml
+++ b/res/values-uk/strings.xml
@@ -16,7 +16,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="sharedUserLabel" msgid="7965035505237135241">"Служби Android Core"</string>
<string name="launcherDialer" msgid="8636288196618486553">"Телеф."</string>
<string name="people" msgid="1048457247435785074">"Люди"</string>
<string name="contactsList" msgid="8661624236494819731">"Контакти"</string>
diff --git a/res/values-vi/strings.xml b/res/values-vi/strings.xml
index a3b41d0..d7f8abc 100644
--- a/res/values-vi/strings.xml
+++ b/res/values-vi/strings.xml
@@ -16,7 +16,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="sharedUserLabel" msgid="7965035505237135241">"Ứng dụng Lõi Android"</string>
<string name="launcherDialer" msgid="8636288196618486553">"Điện thoại"</string>
<string name="people" msgid="1048457247435785074">"Mọi người"</string>
<string name="contactsList" msgid="8661624236494819731">"Danh bạ"</string>
diff --git a/res/values-zh-rCN/strings.xml b/res/values-zh-rCN/strings.xml
index e69965f..0547002 100644
--- a/res/values-zh-rCN/strings.xml
+++ b/res/values-zh-rCN/strings.xml
@@ -16,7 +16,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="sharedUserLabel" msgid="7965035505237135241">"Android 核心应用程序"</string>
<string name="launcherDialer" msgid="8636288196618486553">"拨号"</string>
<string name="people" msgid="1048457247435785074">"用户"</string>
<string name="contactsList" msgid="8661624236494819731">"通讯录"</string>
diff --git a/res/values-zh-rTW/strings.xml b/res/values-zh-rTW/strings.xml
index 7b68ec8..621250c 100644
--- a/res/values-zh-rTW/strings.xml
+++ b/res/values-zh-rTW/strings.xml
@@ -16,7 +16,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="sharedUserLabel" msgid="7965035505237135241">"Android 核心應用程式"</string>
<string name="launcherDialer" msgid="8636288196618486553">"電話"</string>
<string name="people" msgid="1048457247435785074">"使用者"</string>
<string name="contactsList" msgid="8661624236494819731">"聯絡人"</string>
diff --git a/res/values-zu/strings.xml b/res/values-zu/strings.xml
index f855722..3a8017a 100644
--- a/res/values-zu/strings.xml
+++ b/res/values-zu/strings.xml
@@ -16,7 +16,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="sharedUserLabel" msgid="7965035505237135241">"Izinhlelo Zokusebenza ze-Android Core"</string>
<string name="launcherDialer" msgid="8636288196618486553">"Ifoni"</string>
<!-- no translation found for people (1048457247435785074) -->
<skip />
diff --git a/res/values/attrs.xml b/res/values/attrs.xml
index 79d12f9..4d4050e 100644
--- a/res/values/attrs.xml
+++ b/res/values/attrs.xml
@@ -95,6 +95,7 @@
<attr name="list_item_header_height" format="dimension" />
<attr name="list_item_header_underline_height" format="dimension" />
<attr name="list_item_header_underline_color" format="color" />
+ <attr name="list_item_contacts_count_text_color" format="color" />
</declare-styleable>
<declare-styleable name="CallLog">
diff --git a/res/values/colors.xml b/res/values/colors.xml
index 552d47b..a9d745f 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -90,6 +90,7 @@
<!-- Secondary text color in the People app -->
<color name="secondary_text_color">#777777</color>
+ <color name="dialtacts_secondary_text_color">#888888</color>
<!-- Colors in the contact browser list -->
<color name="contact_browser_list_bk_color">#EEEEEE</color>
@@ -97,4 +98,7 @@
<!-- Color of the text of the tab carousel in the contact details -->
<color name="detail_tab_carousel_tab_label_color">#EEEEEE</color>
+
+ <!-- Color of the text for buttons in the action bar -->
+ <color name="action_bar_button_text_color">#FFFFFF</color>
</resources>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index a4a6112..1b737bc 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -25,7 +25,6 @@
<dimen name="aggregation_suggestion_icon_size">40dip</dimen>
- <dimen name="account_header_padding">10dip</dimen>
<dimen name="account_selector_popup_width">400dip</dimen>
<dimen name="photo_action_popup_width">400dip</dimen>
@@ -37,17 +36,17 @@
<!-- Padding of the rounded plus/minus/expand/collapse buttons in the editor -->
<dimen name="editor_round_button_padding_left">2dip</dimen>
<dimen name="editor_round_button_padding_right">2dip</dimen>
- <dimen name="editor_round_button_padding_top">8dip</dimen>
- <dimen name="editor_round_button_padding_bottom">8dip</dimen>
+ <dimen name="editor_round_button_padding_top">4dip</dimen>
+ <dimen name="editor_round_button_padding_bottom">4dip</dimen>
<!-- Width of the Type-Label in the Editor -->
<dimen name="editor_type_label_width">100dip</dimen>
<!-- Left padding of a field in the Editor -->
- <dimen name="editor_field_left_padding">5dip</dimen>
+ <dimen name="editor_field_left_padding">4dip</dimen>
<!-- Right padding of a field in the Editor -->
- <dimen name="editor_field_right_padding">5dip</dimen>
+ <dimen name="editor_field_right_padding">4dip</dimen>
<!-- Top padding of a field in the Editor -->
<dimen name="editor_field_top_padding">10dip</dimen>
@@ -144,7 +143,7 @@
<dimen name="detail_vertical_divider_vertical_margin">16dip</dimen>
<!-- Padding to be used between a visible scrollbar and the contact list -->
- <dimen name="list_visible_scrollbar_padding">40dip</dimen>
+ <dimen name="list_visible_scrollbar_padding">32dip</dimen>
<!-- Font size used for the contact name in the widget -->
<dimen name="widget_text_size_name">14sp</dimen>
@@ -188,9 +187,6 @@
<!-- Height of the member list in the group editor -->
<dimen name="group_editor_member_list_height">550dip</dimen>
- <!-- Height for directory headers in contact lists -->
- <dimen name="directory_header_height">28dip</dimen>
-
<!-- Height of edit text in dialpad fragment -->
<dimen name="dialpad_digits_height">67dip</dimen>
<dimen name="dialpad_digits_text_size">33sp</dimen>
@@ -205,8 +201,12 @@
<dimen name="search_view_width">0dip</dimen>
<!-- contact browser list margins -->
- <dimen name="contact_browser_list_left_margin">24dip</dimen>
- <dimen name="contact_browser_list_top_margin">8dip</dimen>
+ <dimen name="contact_browser_list_header_left_margin">16dip</dimen>
+ <dimen name="contact_browser_list_header_right_margin">@dimen/list_visible_scrollbar_padding</dimen>
+ <dimen name="contact_browser_list_left_margin">16dip</dimen>
+ <dimen name="contact_browser_list_right_margin">0dip</dimen>
+
+ <dimen name="contact_browser_list_top_margin">0dip</dimen>
<dimen name="contacts_count_right_margin">40dip</dimen>
<!-- ContactTile Layouts -->
@@ -230,4 +230,14 @@
<dimen name="no_accounts_message_margin">15dip</dimen>
<dimen name="add_account_button_left_margin">50dip</dimen>
<dimen name="add_account_button_right_margin">50dip</dimen>
+
+ <!-- For contact filter setting screens -->
+ <dimen name="contact_filter_left_margin">16dip</dimen>
+ <dimen name="contact_filter_right_margin">16dip</dimen>
+ <dimen name="contact_filter_item_min_height">48dip</dimen>
+ <dimen name="contact_filter_icon_size">32dip</dimen>
+ <dimen name="contact_filter_header_min_height">24dip</dimen>
+
+ <!-- Height for directory headers in contact lists -->
+ <dimen name="directory_header_height">24dip</dimen>
</resources>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 5bb6c2b..87461d7 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -14,10 +14,6 @@
limitations under the License.
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <!-- Label for this app's shared user ID (and thus for all other
- apps sharing the uid). -->
- <string name="sharedUserLabel">Android Core Apps</string>
-
<!-- Title for the activity that dials the phone. This is the name
used in the Launcher icon. -->
<string name="launcherDialer">Phone</string>
@@ -1292,8 +1288,8 @@
<!-- Checkbox asking the user if they want to display a particular photo for a contact -->
<string name="use_photo_as_primary">Use this photo</string>
- <!-- Text used to explain that a contact cannot be edited since the data is read only [CHAR LIMIT=40] -->
- <string name="contact_read_only">Not editable on this device</string>
+ <!-- Text used to explain that a contact cannot be edited from the People application since the data is read only [CHAR LIMIT=40] -->
+ <string name="contact_read_only">Not editable from this application</string>
<!-- Text describing that a contact has no information available other than name and photo -->
<string name="no_contact_details">No additional information for this contact</string>
@@ -1386,6 +1382,9 @@
<!-- The button to add another entry of a specific data type (i.e. email, phone, address) to a contact in the Raw Contact Editor [CHAR LIMIT=22] -->
<string name="add_new_entry_for_section">Add new</string>
+ <!-- The button to add an organization field to a contact in the Raw Contact Editor [CHAR LIMIT=22] -->
+ <string name="add_organization">Add organization</string>
+
<!-- Attbution of a contact status update, when the time of update is unknown -->
<string name="contact_status_update_attribution">via <xliff:g id="source" example="Google Talk">%1$s</xliff:g></string>
@@ -1599,7 +1598,7 @@
<!-- Text displayed in place of the display name for the contact that represents the user's
personal profile entry [CHAR LIMIT=64] -->
- <string name="profile_display_name">My profile</string>
+ <string name="profile_display_name">Set up my profile</string>
<!-- Label to instruct the user to type in a contact's name to add the contact as a member of the current group. [CHAR LIMIT=64] -->
<string name="enter_contact_name">Enter contact\'s name</string>
@@ -1636,7 +1635,10 @@
<string name="voicemail_initial_time">00:05</string>
<!-- Message to show when there is an error playing back the voicemail. [CHAR LIMIT=40] -->
- <string name="voicemail_playback_error">Could not play voicemail</string>
+ <string name="voicemail_playback_error">failed to play voicemail</string>
+
+ <!-- Message to display before we have prepared the media player, i.e. before we know duration. [CHAR LIMIT=40] -->
+ <string name="voicemail_buffering">buffering...</string>
<!-- The header in the call log used to identify missed calls and voicemail that have not yet been consumed [CHAR LIMIT=10] -->
<string name="call_log_new_header">New</string>
@@ -1753,4 +1755,6 @@
<!-- The string used to represent an unknown location for a phone number in the call log [CHAR LIMIT=3] -->
<string name="call_log_empty_gecode">-</string>
+ <!-- String describing the text on the header of the profile contact in the contacts list [CHAR LIMIT=20] -->
+ <string name="user_profile_contacts_list_header">ME</string>
</resources>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index c125698..423466f 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -16,6 +16,7 @@
<resources>
<style name="DialtactsTheme"
parent="android:Theme.Holo">
+ <item name="android:textColorSecondary">@color/dialtacts_secondary_text_color</item>
<item name="android:windowActionBarOverlay">true</item>
<item name="android:actionBarStyle">@style/DialtactsActionBarStyle</item>
<item name="android:windowContentOverlay">@null</item>
@@ -27,7 +28,7 @@
<item name="list_item_padding_top">0dip</item>
<item name="list_item_padding_right">0dip</item>
<item name="list_item_padding_bottom">0dip</item>
- <item name="list_item_padding_left">24dip</item>
+ <item name="list_item_padding_left">0dip</item>
<item name="list_item_gap_between_image_and_text">8dip</item>
<item name="list_item_gap_between_label_and_data">5dip</item>
<item name="list_item_call_button_padding">14dip</item>
@@ -79,9 +80,12 @@
<item name="android:textColorPrimary">@color/primary_text_color</item>
<item name="android:textColorSecondary">@color/secondary_text_color</item>
</style>
- <style name="ContactEditorActivityTheme" parent="@android:style/Theme.Holo.Light.DarkActionBar">
+
+ <style name="EditorActivityTheme" parent="@android:style/Theme.Holo.Light.DarkActionBar">
<item name="android:actionBarStyle">@style/ContactsActionBarStyle</item>
<item name="android:windowContentOverlay">@null</item>
+ <item name="android:textColorPrimary">@color/primary_text_color</item>
+ <item name="android:textColorSecondary">@color/secondary_text_color</item>
</style>
<style name="BackgroundOnly">
@@ -129,7 +133,7 @@
<item name="list_item_padding_top">0dip</item>
<item name="list_item_padding_right">0dip</item>
<item name="list_item_padding_bottom">0dip</item>
- <item name="list_item_padding_left">24dip</item>
+ <item name="list_item_padding_left">0dip</item>
<item name="list_item_gap_between_image_and_text">8dip</item>
<item name="list_item_gap_between_label_and_data">5dip</item>
<item name="list_item_call_button_padding">14dip</item>
@@ -145,14 +149,15 @@
<item name="list_item_header_height">26dip</item>
<item name="list_item_header_underline_height">1px</item>
<item name="list_item_header_underline_color">@color/people_app_theme_color</item>
+ <item name="list_item_contacts_count_text_color">@color/contact_count_text_color</item>
<item name="contact_filter_popup_width">320dip</item>
<!-- Favorites -->
<item name="favorites_padding_bottom">0dip</item>
</style>
<style name="ContactsActionBarStyle" parent="@android:style/Widget.Holo.Light.ActionBar.Solid.Inverse">
- <item name="android:background">@color/people_app_theme_color</item>
- <item name="android:backgroundStacked">@color/people_app_theme_color</item>
+ <item name="android:background">@drawable/ab_solid_custom_blue_inverse_holo</item>
+ <item name="android:backgroundStacked">@drawable/ab_solid_custom_blue_inverse_holo</item>
</style>
<!-- TODO: Clean up this file so themes aren't copied. -->
@@ -223,7 +228,7 @@
</style>
<style name="DirectoryHeader" parent="PeopleTheme">
- <item name="android:background">@drawable/directory_bg</item>
+ <item name="android:background">@android:color/transparent</item>
</style>
<style name="NonPhoneActivityTheme" parent="@android:Theme.Translucent">
diff --git a/src/com/android/contacts/CallDetailActivity.java b/src/com/android/contacts/CallDetailActivity.java
index 163069a..43e6fc7 100644
--- a/src/com/android/contacts/CallDetailActivity.java
+++ b/src/com/android/contacts/CallDetailActivity.java
@@ -19,6 +19,9 @@
import com.android.contacts.calllog.CallDetailHistoryAdapter;
import com.android.contacts.calllog.CallTypeHelper;
import com.android.contacts.calllog.PhoneNumberHelper;
+import com.android.contacts.util.AbstractBackgroundTask;
+import com.android.contacts.util.BackgroundTask;
+import com.android.contacts.util.BackgroundTaskService;
import com.android.contacts.voicemail.VoicemailPlaybackFragment;
import com.android.contacts.voicemail.VoicemailStatusHelper;
import com.android.contacts.voicemail.VoicemailStatusHelper.StatusMessage;
@@ -34,7 +37,6 @@
import android.content.res.Resources;
import android.database.Cursor;
import android.net.Uri;
-import android.os.AsyncTask;
import android.os.Bundle;
import android.provider.CallLog;
import android.provider.CallLog.Calls;
@@ -87,6 +89,7 @@
private ImageView mMainActionView;
private ImageButton mMainActionPushLayerView;
private ImageView mContactBackgroundView;
+ private BackgroundTaskService mBackgroundTaskService;
private String mNumber = null;
private String mDefaultCountryIso;
@@ -144,6 +147,8 @@
setContentView(R.layout.call_detail);
+ mBackgroundTaskService = (BackgroundTaskService) getApplicationContext().getSystemService(
+ BackgroundTaskService.BACKGROUND_TASK_SERVICE);
mInflater = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE);
mResources = getResources();
@@ -164,13 +169,13 @@
mContactPhotoManager = ContactPhotoManager.getInstance(this);
getListView().setOnItemClickListener(this);
configureActionBar();
+ optionallyHandleVoicemail();
}
@Override
public void onResume() {
super.onResume();
updateData(getCallLogEntryUris());
- optionallyHandleVoicemail();
}
/**
@@ -210,15 +215,14 @@
}
private void markVoicemailAsRead(final Uri voicemailUri) {
- new AsyncTask<Void, Void, Void>() {
+ mBackgroundTaskService.submit(new AbstractBackgroundTask() {
@Override
- protected Void doInBackground(Void... params) {
+ public void doInBackground() {
ContentValues values = new ContentValues();
values.put(Voicemails.IS_READ, true);
getContentResolver().update(voicemailUri, values, null, null);
- return null;
}
- }.execute();
+ });
}
/**
@@ -662,12 +666,16 @@
}
callIds.append(ContentUris.parseId(callUri));
}
- runInBackgroundThenFinishActivity(new Runnable() {
+ mBackgroundTaskService.submit(new BackgroundTask() {
@Override
- public void run() {
+ public void doInBackground() {
getContentResolver().delete(Calls.CONTENT_URI_WITH_VOICEMAIL,
Calls._ID + " IN (" + callIds + ")", null);
}
+ @Override
+ public void onPostExecute() {
+ finish();
+ }
});
}
public void onMenuEditNumberBeforeCall(MenuItem menuItem) {
@@ -680,29 +688,16 @@
public void onMenuTrashVoicemail(MenuItem menuItem) {
final Uri voicemailUri = getVoicemailUri();
- runInBackgroundThenFinishActivity(new Runnable() {
+ mBackgroundTaskService.submit(new BackgroundTask() {
@Override
- public void run() {
+ public void doInBackground() {
getContentResolver().delete(voicemailUri, null, null);
}
- });
- }
-
- /**
- * Run a task in the background, and then finish this activity when the task is done.
- */
- private void runInBackgroundThenFinishActivity(final Runnable runnable) {
- new AsyncTask<Void, Void, Void>() {
@Override
- protected Void doInBackground(Void... params) {
- runnable.run();
- return null;
- }
- @Override
- protected void onPostExecute(Void result) {
+ public void onPostExecute() {
finish();
}
- }.execute();
+ });
}
private void configureActionBar() {
diff --git a/src/com/android/contacts/ContactLoader.java b/src/com/android/contacts/ContactLoader.java
index 9daa1e0..8416721 100644
--- a/src/com/android/contacts/ContactLoader.java
+++ b/src/com/android/contacts/ContactLoader.java
@@ -128,6 +128,7 @@
private byte[] mPhotoBinaryData;
private boolean mSendToVoicemail;
private String mCustomRingtone;
+ private boolean mIsUserProfile;
/**
* Constructor for case "no contact found". This must only be used for the
@@ -154,6 +155,8 @@
mInvitableAccountTypes = null;
mSendToVoicemail = false;
mCustomRingtone = null;
+ mIsUserProfile = false;
+
}
/**
@@ -162,7 +165,8 @@
private Result(Uri uri, Uri lookupUri, long directoryId, String lookupKey, long id,
long nameRawContactId, int displayNameSource, long photoId, String photoUri,
String displayName, String altDisplayName, String phoneticName, boolean starred,
- Integer presence, boolean sendToVoicemail, String customRingtone) {
+ Integer presence, boolean sendToVoicemail, String customRingtone,
+ boolean isUserProfile) {
mLookupUri = lookupUri;
mUri = uri;
mDirectoryId = directoryId;
@@ -183,6 +187,7 @@
mInvitableAccountTypes = Lists.newArrayList();
mSendToVoicemail = sendToVoicemail;
mCustomRingtone = customRingtone;
+ mIsUserProfile = isUserProfile;
}
private Result(Result from) {
@@ -217,6 +222,7 @@
mPhotoBinaryData = from.mPhotoBinaryData;
mSendToVoicemail = from.mSendToVoicemail;
mCustomRingtone = from.mCustomRingtone;
+ mIsUserProfile = from.mIsUserProfile;
}
/**
@@ -394,6 +400,10 @@
public String getCustomRingtone() {
return mCustomRingtone;
}
+
+ public boolean isUserProfile() {
+ return mIsUserProfile;
+ }
}
/**
@@ -471,6 +481,7 @@
Contacts.PHOTO_URI,
Contacts.SEND_TO_VOICEMAIL,
Contacts.CUSTOM_RINGTONE,
+ Contacts.IS_USER_PROFILE,
};
public final static int NAME_RAW_CONTACT_ID = 0;
@@ -542,6 +553,7 @@
public final static int PHOTO_URI = 61;
public final static int SEND_TO_VOICEMAIL = 62;
public final static int CUSTOM_RINGTONE = 63;
+ public final static int IS_USER_PROFILE = 64;
}
/**
@@ -808,6 +820,7 @@
: cursor.getInt(ContactQuery.CONTACT_PRESENCE);
final boolean sendToVoicemail = cursor.getInt(ContactQuery.SEND_TO_VOICEMAIL) == 1;
final String customRingtone = cursor.getString(ContactQuery.CUSTOM_RINGTONE);
+ final boolean isUserProfile = cursor.getInt(ContactQuery.IS_USER_PROFILE) == 1;
Uri lookupUri;
if (directoryId == Directory.DEFAULT || directoryId == Directory.LOCAL_INVISIBLE) {
@@ -820,7 +833,7 @@
return new Result(contactUri, lookupUri, directoryId, lookupKey, contactId,
nameRawContactId, displayNameSource, photoId, photoUri, displayName,
altDisplayName, phoneticName, starred, presence, sendToVoicemail,
- customRingtone);
+ customRingtone, isUserProfile);
}
/**
diff --git a/src/com/android/contacts/ContactPhotoManager.java b/src/com/android/contacts/ContactPhotoManager.java
index d8f4e65..0f7065d 100644
--- a/src/com/android/contacts/ContactPhotoManager.java
+++ b/src/com/android/contacts/ContactPhotoManager.java
@@ -97,6 +97,12 @@
public abstract void loadPhoto(ImageView view, Uri photoUri);
/**
+ * Remove photo from the supplied image view. This also cancels current pending load request
+ * inside this photo manager.
+ */
+ public abstract void removePhoto(ImageView view);
+
+ /**
* Temporarily stops loading photos from the database.
*/
public abstract void pause();
@@ -261,6 +267,12 @@
}
@Override
+ public void removePhoto(ImageView view) {
+ view.setImageDrawable(null);
+ mPendingRequests.remove(view);
+ }
+
+ @Override
public void refreshCache() {
for (BitmapHolder holder : mBitmapHolderCache.snapshot().values()) {
holder.fresh = false;
diff --git a/src/com/android/contacts/ContactSaveService.java b/src/com/android/contacts/ContactSaveService.java
index 221796a..3bb330f 100644
--- a/src/com/android/contacts/ContactSaveService.java
+++ b/src/com/android/contacts/ContactSaveService.java
@@ -46,6 +46,7 @@
import android.provider.ContactsContract.Contacts;
import android.provider.ContactsContract.Data;
import android.provider.ContactsContract.Groups;
+import android.provider.ContactsContract.Profile;
import android.provider.ContactsContract.RawContacts;
import android.util.Log;
import android.widget.Toast;
@@ -75,6 +76,7 @@
public static final String ACTION_SAVE_CONTACT = "saveContact";
public static final String EXTRA_CONTACT_STATE = "state";
public static final String EXTRA_SAVE_MODE = "saveMode";
+ public static final String EXTRA_SAVE_IS_PROFILE = "saveIsProfile";
public static final String ACTION_CREATE_GROUP = "createGroup";
public static final String ACTION_RENAME_GROUP = "renameGroup";
@@ -269,12 +271,13 @@
* using data presented as a set of ContentValues.
*/
public static Intent createSaveContactIntent(Context context, EntityDeltaList state,
- String saveModeExtraKey, int saveMode, Class<?> callbackActivity,
+ String saveModeExtraKey, int saveMode, boolean isProfile, Class<?> callbackActivity,
String callbackAction) {
Intent serviceIntent = new Intent(
context, ContactSaveService.class);
serviceIntent.setAction(ContactSaveService.ACTION_SAVE_CONTACT);
serviceIntent.putExtra(EXTRA_CONTACT_STATE, (Parcelable) state);
+ serviceIntent.putExtra(EXTRA_SAVE_IS_PROFILE, isProfile);
// Callback intent will be invoked by the service once the contact is
// saved. The service will put the URI of the new contact as "data" on
@@ -289,6 +292,7 @@
private void saveContact(Intent intent) {
EntityDeltaList state = intent.getParcelableExtra(EXTRA_CONTACT_STATE);
Intent callbackIntent = intent.getParcelableExtra(EXTRA_CALLBACK_INTENT);
+ boolean isProfile = intent.getBooleanExtra(EXTRA_SAVE_IS_PROFILE, false);
// Trim any empty fields, and RawContacts, before persisting
final AccountTypeManager accountTypes = AccountTypeManager.getInstance(this);
@@ -321,7 +325,8 @@
throw new IllegalStateException("Could not determine RawContact ID after save");
}
final Uri rawContactUri = ContentUris.withAppendedId(
- RawContacts.CONTENT_URI, rawContactId);
+ isProfile ? Profile.CONTENT_RAW_CONTACTS_URI : RawContacts.CONTENT_URI,
+ rawContactId);
lookupUri = RawContacts.getContactLookupUri(resolver, rawContactUri);
Log.v(TAG, "Saved contact. New URI: " + lookupUri);
break;
diff --git a/src/com/android/contacts/ContactsApplication.java b/src/com/android/contacts/ContactsApplication.java
index 1c8c080..1e791b6 100644
--- a/src/com/android/contacts/ContactsApplication.java
+++ b/src/com/android/contacts/ContactsApplication.java
@@ -18,6 +18,7 @@
import com.android.contacts.model.AccountTypeManager;
import com.android.contacts.test.InjectedServices;
+import com.android.contacts.util.BackgroundTaskService;
import com.google.common.annotations.VisibleForTesting;
import android.app.Application;
@@ -33,6 +34,7 @@
private static InjectedServices sInjectedServices;
private AccountTypeManager mAccountTypeManager;
private ContactPhotoManager mContactPhotoManager;
+ private BackgroundTaskService mBackgroundTaskService;
/**
* Overrides the system services with mocks for testing.
@@ -93,6 +95,13 @@
return mContactPhotoManager;
}
+ if (BackgroundTaskService.BACKGROUND_TASK_SERVICE.equals(name)) {
+ if (mBackgroundTaskService == null) {
+ mBackgroundTaskService = BackgroundTaskService.createBackgroundTaskService();
+ }
+ return mBackgroundTaskService;
+ }
+
return super.getSystemService(name);
}
diff --git a/src/com/android/contacts/activities/DialtactsActivity.java b/src/com/android/contacts/activities/DialtactsActivity.java
index 9daa9af..80bd5c1 100644
--- a/src/com/android/contacts/activities/DialtactsActivity.java
+++ b/src/com/android/contacts/activities/DialtactsActivity.java
@@ -20,10 +20,14 @@
import com.android.contacts.calllog.CallLogFragment;
import com.android.contacts.dialpad.DialpadFragment;
import com.android.contacts.interactions.PhoneNumberInteraction;
+import com.android.contacts.list.AccountFilterActivity;
+import com.android.contacts.list.ContactListFilter;
+import com.android.contacts.list.ContactListFilterController;
+import com.android.contacts.list.ContactListFilterController.ContactListFilterListener;
import com.android.contacts.list.ContactTileAdapter.DisplayType;
+import com.android.contacts.list.ContactTileListFragment;
import com.android.contacts.list.OnPhoneNumberPickerActionListener;
import com.android.contacts.list.PhoneNumberPickerFragment;
-import com.android.contacts.list.ContactTileListFragment;
import com.android.internal.telephony.ITelephony;
import android.app.ActionBar;
@@ -81,6 +85,8 @@
private static final int TAB_INDEX_COUNT = 3;
+ private static final int SUBACTIVITY_ACCOUNT_FILTER = 0;
+
/** Name of the dialtacts shared preferences */
static final String PREFS_DIALTACTS = "dialtacts";
static final boolean PREF_FAVORITES_AS_CONTACTS_DEFAULT = false;
@@ -98,6 +104,10 @@
}
public class ViewPagerAdapter extends FragmentPagerAdapter {
+ private DialpadFragment mDialpadFragment;
+ private CallLogFragment mCallLogFragment;
+ private ContactTileListFragment mContactTileListFragment;
+
public ViewPagerAdapter(FragmentManager fm) {
super(fm);
}
@@ -106,11 +116,20 @@
public Fragment getItem(int position) {
switch (position) {
case TAB_INDEX_DIALER:
- return new DialpadFragment();
+ if (mDialpadFragment == null) {
+ mDialpadFragment = new DialpadFragment();
+ }
+ return mDialpadFragment;
case TAB_INDEX_CALL_LOG:
- return new CallLogFragment();
+ if (mCallLogFragment == null) {
+ mCallLogFragment = new CallLogFragment();
+ }
+ return mCallLogFragment;
case TAB_INDEX_FAVORITES:
- return new ContactTileListFragment();
+ if (mContactTileListFragment == null) {
+ mContactTileListFragment = new ContactTileListFragment();
+ }
+ return mContactTileListFragment;
}
throw new IllegalStateException("No fragment at position " + position);
}
@@ -225,6 +244,28 @@
*/
private int mLastManuallySelectedFragment;
+ private ContactListFilterController mContactListFilterController;
+ private OnMenuItemClickListener mFilterOptionsMenuItemClickListener =
+ new OnMenuItemClickListener() {
+ @Override
+ public boolean onMenuItemClick(MenuItem item) {
+ final Intent intent =
+ new Intent(DialtactsActivity.this, AccountFilterActivity.class);
+ ContactListFilter filter = mContactListFilterController.getFilter();
+ startActivityForResult(intent, SUBACTIVITY_ACCOUNT_FILTER);
+ return true;
+ }
+ };
+
+ private OnMenuItemClickListener mSearchMenuItemClickListener =
+ new OnMenuItemClickListener() {
+ @Override
+ public boolean onMenuItemClick(MenuItem item) {
+ enterSearchUi();
+ return true;
+ }
+ };
+
/**
* Listener used when one of phone numbers in search UI is selected. This will initiate a
* phone call using the phone number.
@@ -299,6 +340,20 @@
setContentView(R.layout.dialtacts_activity);
+ mContactListFilterController = new ContactListFilterController(this);
+ mContactListFilterController.addListener(new ContactListFilterListener() {
+ @Override
+ public void onContactListFilterChanged() {
+ if (mSearchFragment == null || !mSearchFragment.isAdded()) {
+ Log.w(TAG, "Search Fragment isn't available when ContactListFilter is changed");
+ return;
+ }
+ mSearchFragment .setFilter(mContactListFilterController.getFilter());
+
+ invalidateOptionsMenu();
+ }
+ });
+
mViewPager = (ViewPager) findViewById(R.id.pager);
mViewPager.setAdapter(new ViewPagerAdapter(getFragmentManager()));
mViewPager.setOnPageChangeListener(mPageChangeListener);
@@ -583,17 +638,20 @@
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
final MenuItem searchMenuItem = menu.findItem(R.id.search_on_action_bar);
- if (mInSearchUi || getActionBar().getSelectedTab().getPosition() == TAB_INDEX_DIALER) {
+ final MenuItem filterOptionMenuItem = menu.findItem(R.id.filter_option);
+ Tab tab = getActionBar().getSelectedTab();
+ if (mInSearchUi) {
searchMenuItem.setVisible(false);
+ filterOptionMenuItem.setVisible(true);
+ filterOptionMenuItem.setOnMenuItemClickListener(
+ mFilterOptionsMenuItemClickListener);
+ } else if (tab == null || tab.getPosition() == TAB_INDEX_DIALER) {
+ searchMenuItem.setVisible(false);
+ filterOptionMenuItem.setVisible(false);
} else {
+ filterOptionMenuItem.setVisible(false);
searchMenuItem.setVisible(true);
- searchMenuItem.setOnMenuItemClickListener(new OnMenuItemClickListener() {
- @Override
- public boolean onMenuItemClick(MenuItem item) {
- enterSearchUi();
- return true;
- }
- });
+ searchMenuItem.setOnMenuItemClickListener(mSearchMenuItemClickListener);
}
return true;
@@ -753,4 +811,26 @@
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
return intent;
}
+
+ @Override
+ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
+ if (resultCode != Activity.RESULT_OK) {
+ return;
+ }
+ switch (requestCode) {
+ case SUBACTIVITY_ACCOUNT_FILTER: {
+ ContactListFilter filter = (ContactListFilter) data.getParcelableExtra(
+ AccountFilterActivity.KEY_EXTRA_CONTACT_LIST_FILTER);
+ if (filter == null) {
+ return;
+ }
+ if (filter.filterType == ContactListFilter.FILTER_TYPE_CUSTOM) {
+ mContactListFilterController.selectCustomFilter();
+ } else {
+ mContactListFilterController.setContactListFilter(filter, true);
+ }
+ }
+ break;
+ }
+ }
}
diff --git a/src/com/android/contacts/activities/GroupEditorActivity.java b/src/com/android/contacts/activities/GroupEditorActivity.java
index d61b6c3..f0d2aa1 100644
--- a/src/com/android/contacts/activities/GroupEditorActivity.java
+++ b/src/com/android/contacts/activities/GroupEditorActivity.java
@@ -107,7 +107,10 @@
@Override
public void onBackPressed() {
- mFragment.save(SaveMode.CLOSE);
+ // If the change could not be saved, then revert to the default "back" button behavior.
+ if (!mFragment.save(SaveMode.CLOSE)) {
+ super.onBackPressed();
+ }
}
@Override
diff --git a/src/com/android/contacts/activities/PeopleActivity.java b/src/com/android/contacts/activities/PeopleActivity.java
index 282e0b3..4da032e 100644
--- a/src/com/android/contacts/activities/PeopleActivity.java
+++ b/src/com/android/contacts/activities/PeopleActivity.java
@@ -42,7 +42,6 @@
import com.android.contacts.list.ContactsIntentResolver;
import com.android.contacts.list.ContactsRequest;
import com.android.contacts.list.ContactsUnavailableFragment;
-import com.android.contacts.list.CustomContactListFilterActivity;
import com.android.contacts.list.DefaultContactBrowseListFragment;
import com.android.contacts.list.DirectoryListLoader;
import com.android.contacts.list.OnContactBrowserActionListener;
@@ -109,7 +108,6 @@
private static final int SUBACTIVITY_NEW_GROUP = 2;
private static final int SUBACTIVITY_EDIT_GROUP = 3;
private static final int SUBACTIVITY_ACCOUNT_FILTER = 4;
- private static final int SUBACTIVITY_CUSTOMIZE_FILTER = 5;
private static final String KEY_SEARCH_MODE = "searchMode";
@@ -1443,23 +1441,14 @@
if (filter == null) {
return;
}
- // If this is a custom filter, launch the activity to customize the display list
if (filter.filterType == ContactListFilter.FILTER_TYPE_CUSTOM) {
- final Intent intent = new Intent(this,
- CustomContactListFilterActivity.class);
- startActivityForResult(intent, SUBACTIVITY_CUSTOMIZE_FILTER);
+ mContactListFilterController.selectCustomFilter();
} else {
mContactListFilterController.setContactListFilter(filter, true);
}
}
break;
}
- case SUBACTIVITY_CUSTOMIZE_FILTER: {
- if (resultCode == Activity.RESULT_OK) {
- mContactListFilterController.selectCustomFilter();
- }
- break;
- }
case SUBACTIVITY_NEW_GROUP:
case SUBACTIVITY_EDIT_GROUP: {
diff --git a/src/com/android/contacts/calllog/CallLogFragment.java b/src/com/android/contacts/calllog/CallLogFragment.java
index c2c7c12..c06b474 100644
--- a/src/com/android/contacts/calllog/CallLogFragment.java
+++ b/src/com/android/contacts/calllog/CallLogFragment.java
@@ -662,8 +662,6 @@
CallLogListItemViews views = CallLogListItemViews.fromView(view);
views.callView.setOnClickListener(mCallPlayOnClickListener);
views.playView.setOnClickListener(mCallPlayOnClickListener);
- // Do nothing when a plain photo is clicked. Without this, the list item will fire.
- views.plainPhotoView.setOnClickListener(null);
view.setTag(views);
}
@@ -801,18 +799,9 @@
private void setPhoto(CallLogListItemViews views, Uri thumbnailUri, long contactId,
String lookupKey) {
- if (contactId == -1) {
- // This does not correspond to a contact, do not use the QuickContactBadge.
- mContactPhotoManager.loadPhoto(views.plainPhotoView, thumbnailUri);
- views.plainPhotoView.setVisibility(View.VISIBLE);
- views.quickContactView.setVisibility(View.INVISIBLE);
- } else {
- views.quickContactView.assignContactUri(
- Contacts.getLookupUri(contactId, lookupKey));
- mContactPhotoManager.loadPhoto(views.quickContactView, thumbnailUri);
- views.quickContactView.setVisibility(View.VISIBLE);
- views.plainPhotoView.setVisibility(View.INVISIBLE);
- }
+ views.quickContactView.assignContactUri(contactId == -1 ? null :
+ Contacts.getLookupUri(contactId, lookupKey));
+ mContactPhotoManager.loadPhoto(views.quickContactView, thumbnailUri);
}
/**
diff --git a/src/com/android/contacts/calllog/CallLogListItemViews.java b/src/com/android/contacts/calllog/CallLogListItemViews.java
index 368a868..21f2dc5 100644
--- a/src/com/android/contacts/calllog/CallLogListItemViews.java
+++ b/src/com/android/contacts/calllog/CallLogListItemViews.java
@@ -21,7 +21,6 @@
import android.content.Context;
import android.view.View;
-import android.widget.ImageView;
import android.widget.QuickContactBadge;
import android.widget.TextView;
@@ -31,8 +30,6 @@
public final class CallLogListItemViews {
/** The quick contact badge for the contact. */
public final QuickContactBadge quickContactView;
- /** The photo view without quick contact badge. */
- public final ImageView plainPhotoView;
/** The main action button on the entry. */
public final View callView;
/** The play action button used for voicemail. */
@@ -48,12 +45,11 @@
/** The text of the header in a stand-alone row, or null for other types of rows. */
public final TextView listHeaderTextView;
- private CallLogListItemViews(QuickContactBadge quickContactView, ImageView photoView,
+ private CallLogListItemViews(QuickContactBadge quickContactView,
View callView, View playView, View unheardView, View dividerView,
PhoneCallDetailsViews phoneCallDetailsViews, View listItemView,
TextView listHeaderTextView) {
this.quickContactView = quickContactView;
- this.plainPhotoView = photoView;
this.callView = callView;
this.playView = playView;
this.unheardView = unheardView;
@@ -66,7 +62,6 @@
public static CallLogListItemViews fromView(View view) {
return new CallLogListItemViews(
(QuickContactBadge) view.findViewById(R.id.quick_contact_photo),
- (ImageView) view.findViewById(R.id.plain_contact_photo),
view.findViewById(R.id.call_icon),
view.findViewById(R.id.play_icon),
view.findViewById(R.id.unheard_icon),
@@ -79,7 +74,6 @@
public static CallLogListItemViews createForTest(Context context) {
return new CallLogListItemViews(
new QuickContactBadge(context),
- new ImageView(context),
new View(context),
new View(context),
new View(context),
diff --git a/src/com/android/contacts/detail/ContactDetailDisplayUtils.java b/src/com/android/contacts/detail/ContactDetailDisplayUtils.java
index 0c59695..3bff950 100644
--- a/src/com/android/contacts/detail/ContactDetailDisplayUtils.java
+++ b/src/com/android/contacts/detail/ContactDetailDisplayUtils.java
@@ -209,7 +209,7 @@
*/
public static void setStarred(Result contactData, CheckBox starredView) {
// Check if the starred state should be visible
- if (!contactData.isDirectoryEntry()) {
+ if (!contactData.isDirectoryEntry() && !contactData.isUserProfile()) {
starredView.setVisibility(View.VISIBLE);
starredView.setChecked(contactData.getStarred());
} else {
diff --git a/src/com/android/contacts/detail/ContactDetailFragment.java b/src/com/android/contacts/detail/ContactDetailFragment.java
index 02e74dd..383f23b 100644
--- a/src/com/android/contacts/detail/ContactDetailFragment.java
+++ b/src/com/android/contacts/detail/ContactDetailFragment.java
@@ -1851,6 +1851,9 @@
// Only local contacts
if (mContactData == null || mContactData.isDirectoryEntry()) return false;
+ // User profile cannot be added to contacts
+ if (mContactData.isUserProfile()) return false;
+
// Only if exactly one raw contact
if (mContactData.getEntities().size() != 1) return false;
@@ -1923,7 +1926,7 @@
// and fire off the intent. we don't need a callback, as the database listener
// should update the ui
final Intent intent = ContactSaveService.createSaveContactIntent(getActivity(),
- contactDeltaList, "", 0, getActivity().getClass(),
+ contactDeltaList, "", 0, false, getActivity().getClass(),
UI.LIST_ALL_CONTACTS_ACTION);
getActivity().startService(intent);
}
diff --git a/src/com/android/contacts/editor/ContactEditorFragment.java b/src/com/android/contacts/editor/ContactEditorFragment.java
index e0f99ce..4126425 100644
--- a/src/com/android/contacts/editor/ContactEditorFragment.java
+++ b/src/com/android/contacts/editor/ContactEditorFragment.java
@@ -116,6 +116,8 @@
private static final String KEY_SHOW_JOIN_SUGGESTIONS = "showJoinSuggestions";
private static final String KEY_ENABLED = "enabled";
private static final String KEY_STATUS = "status";
+ private static final String KEY_NEW_LOCAL_PROFILE = "newLocalProfile";
+ private static final String KEY_IS_USER_PROFILE = "isUserProfile";
public static final String SAVE_MODE_EXTRA_KEY = "saveMode";
@@ -125,6 +127,8 @@
*/
public static final String INTENT_EXTRA_ADD_TO_DEFAULT_DIRECTORY = "addToDefaultDirectory";
+ public static final String INTENT_EXTRA_NEW_LOCAL_PROFILE = "newLocalProfile";
+
/**
* Modes that specify what the AsyncTask has to perform after saving
*/
@@ -245,6 +249,8 @@
private boolean mEnabled = true;
private boolean mRequestFocus;
+ private boolean mNewLocalProfile = false;
+ private boolean mIsUserProfile = false;
public ContactEditorFragment() {
}
@@ -348,6 +354,8 @@
mIntentExtras = intentExtras;
mAutoAddToDefaultGroup = mIntentExtras != null
&& mIntentExtras.containsKey(INTENT_EXTRA_ADD_TO_DEFAULT_DIRECTORY);
+ mNewLocalProfile = mIntentExtras != null
+ && mIntentExtras.getBoolean(INTENT_EXTRA_NEW_LOCAL_PROFILE);
}
public void setListener(Listener value) {
@@ -383,6 +391,8 @@
mAggregationSuggestionsRawContactId = savedState.getLong(KEY_SHOW_JOIN_SUGGESTIONS);
mEnabled = savedState.getBoolean(KEY_ENABLED);
mStatus = savedState.getInt(KEY_STATUS);
+ mNewLocalProfile = savedState.getBoolean(KEY_NEW_LOCAL_PROFILE);
+ mIsUserProfile = savedState.getBoolean(KEY_IS_USER_PROFILE);
}
}
@@ -430,6 +440,13 @@
setIntentExtras(mIntentExtras);
mIntentExtras = null;
+ // For user profile, change the contacts query URI
+ mIsUserProfile = data.isUserProfile();
+ if (mIsUserProfile) {
+ for (EntityDelta state : mState) {
+ state.setProfileQueryUri();
+ }
+ }
mRequestFocus = true;
bindEditors();
@@ -463,8 +480,8 @@
private void createContact() {
final List<AccountWithDataSet> accounts =
AccountTypeManager.getInstance(mContext).getAccounts(true);
- // No Accounts available. Create a phone-local contact.
- if (accounts.isEmpty()) {
+ // No Accounts available or creating a local profile. Create a phone-local contact.
+ if (accounts.isEmpty() || mNewLocalProfile) {
createContact(null);
return; // Don't show a dialog.
}
@@ -559,6 +576,11 @@
EntityModifier.ensureKindExists(insert, newAccountType, Event.CONTENT_ITEM_TYPE);
EntityModifier.ensureKindExists(insert, newAccountType, StructuredPostal.CONTENT_ITEM_TYPE);
+ // Set the correct URI for saving the contact as a profile
+ if (mNewLocalProfile) {
+ insert.setProfileQueryUri();
+ }
+
if (mState == null) {
// Create state if none exists yet
mState = EntityDeltaList.fromSingle(insert);
@@ -600,19 +622,13 @@
R.layout.external_raw_contact_editor_view, mContent, false);
((ExternalRawContactEditorView) editor).setListener(this);
} else {
- final RawContactEditorView rawContactEditor = (RawContactEditorView)
- inflater.inflate(R.layout.raw_contact_editor_view, mContent, false);
- // For existing contacts, only show the account header if there is more than 1 raw
- // contact in the aggregate contact.
- if (Intent.ACTION_EDIT.equals(mAction)) {
- rawContactEditor.setAccountHeaderVisible(numRawContacts > 1);
- }
- editor = rawContactEditor;
+ editor = (RawContactEditorView) inflater.inflate(R.layout.raw_contact_editor_view,
+ mContent, false);
}
if (Intent.ACTION_INSERT.equals(mAction) && numRawContacts == 1) {
final List<AccountWithDataSet> accounts =
AccountTypeManager.getInstance(mContext).getAccounts(true);
- if (accounts.size() > 1) {
+ if (accounts.size() > 1 && !mNewLocalProfile) {
addAccountSwitcher(mState.get(0), editor);
} else {
disableAccountSwitcher(editor);
@@ -695,7 +711,7 @@
values.getAsString(RawContacts.ACCOUNT_TYPE),
values.getAsString(RawContacts.DATA_SET));
final View accountView = editor.findViewById(R.id.account);
- final View anchorView = editor.findViewById(R.id.anchor_for_account_switcher);
+ final View anchorView = editor.findViewById(R.id.account_container);
accountView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@@ -907,8 +923,8 @@
setEnabled(false);
Intent intent = ContactSaveService.createSaveContactIntent(getActivity(), mState,
- SAVE_MODE_EXTRA_KEY, saveMode, getActivity().getClass(),
- ContactEditorActivity.ACTION_SAVE_COMPLETED);
+ SAVE_MODE_EXTRA_KEY, saveMode, mNewLocalProfile || mIsUserProfile,
+ getActivity().getClass(), ContactEditorActivity.ACTION_SAVE_COMPLETED);
getActivity().startService(intent);
return true;
}
@@ -1505,6 +1521,8 @@
outState.putBoolean(KEY_CONTACT_WRITABLE_FOR_JOIN, mContactWritableForJoin);
outState.putLong(KEY_SHOW_JOIN_SUGGESTIONS, mAggregationSuggestionsRawContactId);
outState.putBoolean(KEY_ENABLED, mEnabled);
+ outState.putBoolean(KEY_NEW_LOCAL_PROFILE, mNewLocalProfile);
+ outState.putBoolean(KEY_IS_USER_PROFILE, mIsUserProfile);
outState.putInt(KEY_STATUS, mStatus);
super.onSaveInstanceState(outState);
}
diff --git a/src/com/android/contacts/editor/EventFieldEditorView.java b/src/com/android/contacts/editor/EventFieldEditorView.java
index 4c5affd..e7da6c1 100644
--- a/src/com/android/contacts/editor/EventFieldEditorView.java
+++ b/src/com/android/contacts/editor/EventFieldEditorView.java
@@ -29,6 +29,8 @@
import android.app.Dialog;
import android.content.Context;
+import android.content.res.ColorStateList;
+import android.content.res.Resources;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.AttributeSet;
@@ -49,6 +51,13 @@
*/
private final static int DEFAULT_HOUR = 8;
+ /**
+ * Default string to show when there is no date selected yet.
+ */
+ private String mNoDateString;
+ private int mPrimaryTextColor;
+ private int mSecondaryTextColor;
+
private Button mDateView;
public EventFieldEditorView(Context context) {
@@ -68,6 +77,11 @@
protected void onFinishInflate() {
super.onFinishInflate();
+ Resources resources = mContext.getResources();
+ mPrimaryTextColor = resources.getColor(R.color.primary_text_color);
+ mSecondaryTextColor = resources.getColor(R.color.secondary_text_color);
+ mNoDateString = mContext.getString(R.string.add_new_entry_for_section);
+
mDateView = (Button) findViewById(R.id.date_view);
mDateView.setOnClickListener(new OnClickListener() {
@Override
@@ -105,12 +119,14 @@
final String column = editField.column;
String data = DateUtils.formatDate(getContext(), getEntry().getAsString(column));
if (TextUtils.isEmpty(data)) {
- data = " ";
+ mDateView.setText(mNoDateString);
+ mDateView.setTextColor(mSecondaryTextColor);
setDeleteButtonVisible(false);
} else {
+ mDateView.setText(data);
+ mDateView.setTextColor(mPrimaryTextColor);
setDeleteButtonVisible(true);
}
- mDateView.setText(data);
}
@Override
@@ -246,7 +262,8 @@
@Override
public void clearAllFields() {
// Update UI
- mDateView.setText("");
+ mDateView.setText(mNoDateString);
+ mDateView.setTextColor(mSecondaryTextColor);
// Update state
final String column = getKind().fieldList.get(0).column;
diff --git a/src/com/android/contacts/editor/ExternalRawContactEditorView.java b/src/com/android/contacts/editor/ExternalRawContactEditorView.java
index 734f013..04f4140 100644
--- a/src/com/android/contacts/editor/ExternalRawContactEditorView.java
+++ b/src/com/android/contacts/editor/ExternalRawContactEditorView.java
@@ -43,6 +43,7 @@
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
+import android.widget.Toast;
import java.util.ArrayList;
@@ -55,10 +56,10 @@
private View mPhotoStub;
private TextView mName;
- private TextView mReadOnlyWarning;
private Button mEditExternallyButton;
private ViewGroup mGeneral;
+ private View mAccountContainer;
private ImageView mAccountIcon;
private TextView mAccountTypeTextView;
private TextView mAccountNameTextView;
@@ -97,11 +98,11 @@
mPhotoStub = findViewById(R.id.stub_photo);
mName = (TextView) findViewById(R.id.read_only_name);
- mReadOnlyWarning = (TextView) findViewById(R.id.read_only_warning);
mEditExternallyButton = (Button) findViewById(R.id.button_edit_externally);
mEditExternallyButton.setOnClickListener(this);
mGeneral = (ViewGroup)findViewById(R.id.sect_general);
+ mAccountContainer = findViewById(R.id.account_container);
mAccountIcon = (ImageView) findViewById(R.id.account_icon);
mAccountTypeTextView = (TextView) findViewById(R.id.account_type);
mAccountNameTextView = (TextView) findViewById(R.id.account_name);
@@ -168,11 +169,17 @@
mName.setText(primary.getAsString(StructuredName.DISPLAY_NAME));
if (type.readOnly) {
- mReadOnlyWarning.setText(mContext.getString(R.string.contact_read_only));
- mReadOnlyWarning.setVisibility(View.VISIBLE);
+ mAccountContainer.setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ Toast.makeText(mContext, mContext.getString(R.string.contact_read_only),
+ Toast.LENGTH_SHORT).show();
+ }
+ });
mEditExternallyButton.setVisibility(View.GONE);
} else {
- mReadOnlyWarning.setVisibility(View.GONE);
+ mAccountContainer.setBackgroundDrawable(null);
+ mAccountContainer.setEnabled(false);
mEditExternallyButton.setVisibility(View.VISIBLE);
}
@@ -183,7 +190,7 @@
View field = mInflater.inflate(
R.layout.item_read_only_field, mGeneral, false);
TextView v;
- v = (TextView) field.findViewById(R.id.label);
+ v = (TextView) field.findViewById(R.id.kind_title);
v.setText(mContext.getText(R.string.phoneLabelsGroup));
v = (TextView) field.findViewById(R.id.data);
v.setText(PhoneNumberUtils.formatNumber(phone.getAsString(Phone.NUMBER),
@@ -200,7 +207,7 @@
View field = mInflater.inflate(
R.layout.item_read_only_field, mGeneral, false);
TextView v;
- v = (TextView) field.findViewById(R.id.label);
+ v = (TextView) field.findViewById(R.id.kind_title);
v.setText(mContext.getText(R.string.emailLabelsGroup));
v = (TextView) field.findViewById(R.id.data);
v.setText(email.getAsString(Email.DATA));
diff --git a/src/com/android/contacts/editor/GroupMembershipView.java b/src/com/android/contacts/editor/GroupMembershipView.java
index 9693915..042b80a 100644
--- a/src/com/android/contacts/editor/GroupMembershipView.java
+++ b/src/com/android/contacts/editor/GroupMembershipView.java
@@ -27,6 +27,8 @@
import android.app.Activity;
import android.content.Context;
+import android.content.res.ColorStateList;
+import android.content.res.Resources;
import android.database.Cursor;
import android.provider.ContactsContract.CommonDataKinds.GroupMembership;
import android.provider.ContactsContract.RawContacts;
@@ -95,6 +97,10 @@
private boolean mDefaultGroupVisibilityKnown;
private boolean mDefaultGroupVisible;
+ private String mNoGroupString;
+ private int mPrimaryTextColor;
+ private int mSecondaryTextColor;
+
public GroupMembershipView(Context context) {
super(context);
}
@@ -104,6 +110,15 @@
}
@Override
+ protected void onFinishInflate() {
+ super.onFinishInflate();
+ Resources resources = mContext.getResources();
+ mPrimaryTextColor = resources.getColor(R.color.primary_text_color);
+ mSecondaryTextColor = resources.getColor(R.color.secondary_text_color);
+ mNoGroupString = mContext.getString(R.string.add_new_entry_for_section);
+ }
+
+ @Override
public void setEnabled(boolean enabled) {
super.setEnabled(enabled);
if (mGroupList != null) {
@@ -187,9 +202,11 @@
mGroupList.setEnabled(isEnabled());
if (sb.length() == 0) {
- mGroupList.setText(" ");
+ mGroupList.setText(mNoGroupString);
+ mGroupList.setTextColor(mSecondaryTextColor);
} else {
mGroupList.setText(sb);
+ mGroupList.setTextColor(mPrimaryTextColor);
}
setVisibility(VISIBLE);
diff --git a/src/com/android/contacts/editor/KindSectionView.java b/src/com/android/contacts/editor/KindSectionView.java
index 3b46307..686939c 100644
--- a/src/com/android/contacts/editor/KindSectionView.java
+++ b/src/com/android/contacts/editor/KindSectionView.java
@@ -140,7 +140,7 @@
mTitleString = (kind.titleRes == -1 || kind.titleRes == 0)
? ""
: getResources().getString(kind.titleRes);
- mTitle.setText(mTitleString.toUpperCase());
+ mTitle.setText(mTitleString);
rebuildFromState();
updateAddFooterVisible();
diff --git a/src/com/android/contacts/editor/LabeledEditorView.java b/src/com/android/contacts/editor/LabeledEditorView.java
index 5bba2c4..bb25ea0 100644
--- a/src/com/android/contacts/editor/LabeledEditorView.java
+++ b/src/com/android/contacts/editor/LabeledEditorView.java
@@ -465,10 +465,12 @@
private class EditTypeAdapter extends ArrayAdapter<EditType> {
private final LayoutInflater mInflater;
private boolean mHasCustomSelection;
+ private int mTextColor;
public EditTypeAdapter(Context context) {
super(context, 0);
mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+ mTextColor = context.getResources().getColor(R.color.secondary_text_color);
if (mType != null && mType.customColumn != null) {
@@ -501,17 +503,18 @@
private View createViewFromResource(int position, View convertView, ViewGroup parent,
int resource) {
- View view;
TextView textView;
if (convertView == null) {
- view = mInflater.inflate(resource, parent, false);
+ textView = (TextView) mInflater.inflate(resource, parent, false);
+ textView.setAllCaps(true);
+ textView.setGravity(Gravity.RIGHT);
+ textView.setTextAppearance(mContext, android.R.style.TextAppearance_Small);
+ textView.setTextColor(mTextColor);
} else {
- view = convertView;
+ textView = (TextView) convertView;
}
- textView = (TextView) view;
-
EditType type = getItem(position);
String text;
if (type == CUSTOM_SELECTION) {
@@ -519,10 +522,8 @@
} else {
text = getContext().getString(type.labelRes);
}
- textView.setText(text.toUpperCase());
- textView.setGravity(Gravity.RIGHT);
- textView.setTextColor(Color.GRAY);
- return view;
+ textView.setText(text);
+ return textView;
}
}
}
diff --git a/src/com/android/contacts/editor/RawContactEditorView.java b/src/com/android/contacts/editor/RawContactEditorView.java
index 41f2ebd..6335cb6 100644
--- a/src/com/android/contacts/editor/RawContactEditorView.java
+++ b/src/com/android/contacts/editor/RawContactEditorView.java
@@ -70,7 +70,6 @@
private ViewGroup mFields;
- private View mAccountContainer;
private ImageView mAccountIcon;
private TextView mAccountTypeTextView;
private TextView mAccountNameTextView;
@@ -139,7 +138,6 @@
mFields = (ViewGroup)findViewById(R.id.sect_fields);
- mAccountContainer = findViewById(R.id.anchor_for_account_switcher);
mAccountIcon = (ImageView) findViewById(R.id.account_icon);
mAccountTypeTextView = (TextView) findViewById(R.id.account_type);
mAccountNameTextView = (TextView) findViewById(R.id.account_name);
@@ -153,10 +151,6 @@
});
}
- public void setAccountHeaderVisible(boolean visible) {
- mAccountContainer.setVisibility(visible ? View.VISIBLE : View.GONE);
- }
-
/**
* Set the internal state for this view, given a current
* {@link EntityDelta} state and the {@link AccountType} that
diff --git a/src/com/android/contacts/editor/TextFieldsEditorView.java b/src/com/android/contacts/editor/TextFieldsEditorView.java
index 0d8aba6..d3fa3b7 100644
--- a/src/com/android/contacts/editor/TextFieldsEditorView.java
+++ b/src/com/android/contacts/editor/TextFieldsEditorView.java
@@ -60,6 +60,7 @@
private ImageView mExpansionView;
private boolean mHideOptional = true;
private boolean mHasShortAndLongForms;
+ private int mHintTextColor;
public TextFieldsEditorView(Context context) {
super(context);
@@ -81,6 +82,7 @@
setDrawingCacheEnabled(true);
setAlwaysDrawnWithCacheEnabled(true);
+ mHintTextColor = getContext().getResources().getColor(R.color.secondary_text_color);
mFields = (ViewGroup) findViewById(R.id.editors);
mExpansionView = (ImageView) findViewById(R.id.expansion_view);
mExpansionViewContainer = findViewById(R.id.expansion_view_container);
@@ -173,6 +175,7 @@
fieldView.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT,
LayoutParams.WRAP_CONTENT));
fieldView.setTextAppearance(getContext(), kind.textAppearanceResourceId);
+ fieldView.setHintTextColor(mHintTextColor);
fieldView.setGravity(Gravity.TOP);
mFieldEditTexts[index] = fieldView;
fieldView.setId(vig.getId(state, kind, entry, index));
diff --git a/src/com/android/contacts/group/GroupBrowseListAdapter.java b/src/com/android/contacts/group/GroupBrowseListAdapter.java
index 1f06029..6571b99 100644
--- a/src/com/android/contacts/group/GroupBrowseListAdapter.java
+++ b/src/com/android/contacts/group/GroupBrowseListAdapter.java
@@ -153,8 +153,11 @@
if (currentGroupId == mGroupId) {
final ImageView[] children = getIconViewsSordedByFillOrder(icons);
for (int i = 0; i < children.length; i++) {
- final long photoId = i < photoIds.size() ? photoIds.get(i) : 0;
- mContactPhotoManager.loadPhoto(children[i], photoId);
+ if (i < photoIds.size()) {
+ mContactPhotoManager.loadPhoto(children[i], photoIds.get(i));
+ } else {
+ mContactPhotoManager.removePhoto(children[i]);
+ }
}
}
}
@@ -318,13 +321,16 @@
if (photoIds != null) {
// Cache is available. Let the photo manager load those IDs.
for (int i = 0; i < children.length; i++) {
- final long photoId = i < photoIds.size() ? photoIds.get(i) : 0;
- mContactPhotoManager.loadPhoto(children[i], photoId);
+ if (i < photoIds.size()) {
+ mContactPhotoManager.loadPhoto(children[i], photoIds.get(i));
+ } else {
+ mContactPhotoManager.removePhoto(children[i]);
+ }
}
} else {
// Cache is not available. Load photo IDs asynchronously.
for (ImageView child : children) {
- mContactPhotoManager.loadPhoto(child, 0);
+ mContactPhotoManager.removePhoto(child);
}
new AsyncPhotoIdLoadTask().execute(
new AsyncPhotoIdLoadArg(icons, entry.getGroupId(),
diff --git a/src/com/android/contacts/group/GroupDetailFragment.java b/src/com/android/contacts/group/GroupDetailFragment.java
index 019dc11..a27d3e0 100644
--- a/src/com/android/contacts/group/GroupDetailFragment.java
+++ b/src/com/android/contacts/group/GroupDetailFragment.java
@@ -405,8 +405,8 @@
@Override
public void onPrepareOptionsMenu(Menu menu) {
- mOptionsMenuEditable = isGroupEditable();
- mOptionsMenuGroupPresent = isGroupPresent();
+ mOptionsMenuEditable = isGroupEditable() && isVisible();
+ mOptionsMenuGroupPresent = isGroupPresent() && isVisible();
// Editing a group is always possible if a group is selected
// TODO: check for external group (member editable) buganizer #5049046
diff --git a/src/com/android/contacts/list/AccountFilterActivity.java b/src/com/android/contacts/list/AccountFilterActivity.java
index f99b14e..9d872da 100644
--- a/src/com/android/contacts/list/AccountFilterActivity.java
+++ b/src/com/android/contacts/list/AccountFilterActivity.java
@@ -19,7 +19,6 @@
import com.android.contacts.ContactsActivity;
import com.android.contacts.ContactsSearchManager;
import com.android.contacts.R;
-import com.android.contacts.activities.PeopleActivity;
import com.android.contacts.model.AccountType;
import com.android.contacts.model.AccountTypeManager;
import com.android.contacts.model.AccountWithDataSet;
@@ -35,7 +34,6 @@
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
-import android.widget.AdapterView.OnItemClickListener;
import android.widget.BaseAdapter;
import android.widget.ListView;
@@ -51,6 +49,8 @@
private static final String TAG = AccountFilterActivity.class.getSimpleName();
+ private static final int SUBACTIVITY_CUSTOMIZE_FILTER = 0;
+
public static final String KEY_EXTRA_CONTACT_LIST_FILTER = "contactListFilter";
private ListView mListView;
@@ -63,14 +63,9 @@
setContentView(R.layout.contact_list_filter);
mListView = (ListView) findViewById(com.android.internal.R.id.list);
- mListView.setOnItemClickListener(new OnItemClickListener() {
- @Override
- public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
- finishAndSetResult(mFilters.get(position));
- }
- });
+ mListView.setOnItemClickListener(this);
- ActionBar actionBar = getActionBar();
+ ActionBar actionBar = getActionBar();
if (actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(true);
}
@@ -104,15 +99,38 @@
mListView.setAdapter(new FilterListAdapter(this));
}
+ @Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
- finishAndSetResult(mFilters.get(position));
+ ContactListFilter filter = mFilters.get(position);
+ if (filter.filterType == ContactListFilter.FILTER_TYPE_CUSTOM) {
+ final Intent intent = new Intent(this,
+ CustomContactListFilterActivity.class);
+ startActivityForResult(intent, SUBACTIVITY_CUSTOMIZE_FILTER);
+ } else {
+ final Intent intent = new Intent();
+ intent.putExtra(KEY_EXTRA_CONTACT_LIST_FILTER, filter);
+ setResult(Activity.RESULT_OK, intent);
+ finish();
+ }
}
- private void finishAndSetResult(ContactListFilter filter) {
- final Intent intent = new Intent();
- intent.putExtra(KEY_EXTRA_CONTACT_LIST_FILTER, filter);
- setResult(Activity.RESULT_OK, intent);
- finish();
+ @Override
+ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
+ if (resultCode != Activity.RESULT_OK) {
+ return;
+ }
+
+ switch (requestCode) {
+ case SUBACTIVITY_CUSTOMIZE_FILTER: {
+ final Intent intent = new Intent();
+ ContactListFilter filter = ContactListFilter.createFilterWithType(
+ ContactListFilter.FILTER_TYPE_CUSTOM);
+ intent.putExtra(KEY_EXTRA_CONTACT_LIST_FILTER, filter);
+ setResult(Activity.RESULT_OK, intent);
+ finish();
+ break;
+ }
+ }
}
@Override
@@ -154,7 +172,7 @@
view = (ContactListFilterView) convertView;
} else {
view = (ContactListFilterView) mLayoutInflater.inflate(
- R.layout.filter_spinner_item, parent, false);
+ R.layout.contact_list_filter_item, parent, false);
}
view.setSingleAccount(mFilters.size() == 1);
ContactListFilter filter = mFilters.get(position);
@@ -168,10 +186,10 @@
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
- Intent intent = new Intent(this, PeopleActivity.class);
- intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
- startActivity(intent);
- finish();
+ // We have two logical "up" Activities: People and Phone.
+ // Instead of having one static "up" direction, behave like back as an
+ // exceptional case.
+ onBackPressed();
return true;
default:
break;
diff --git a/src/com/android/contacts/list/ContactEntryListAdapter.java b/src/com/android/contacts/list/ContactEntryListAdapter.java
index cd3a7ed..4ac54dc 100644
--- a/src/com/android/contacts/list/ContactEntryListAdapter.java
+++ b/src/com/android/contacts/list/ContactEntryListAdapter.java
@@ -35,6 +35,7 @@
import android.view.View;
import android.view.ViewGroup;
import android.widget.QuickContactBadge;
+import android.widget.SectionIndexer;
import android.widget.TextView;
import java.util.HashSet;
@@ -63,7 +64,17 @@
private boolean mDisplayPhotos;
private boolean mQuickContactEnabled;
+
+ /**
+ * indicates if contact queries include profile
+ */
private boolean mIncludeProfile;
+
+ /**
+ * indicates if query results includes a profile
+ */
+ private boolean mProfileExists;
+
private ContactPhotoManager mPhotoLoader;
private String mQueryString;
@@ -77,6 +88,9 @@
private boolean mSelectionVisible;
+ private ContactListFilter mFilter;
+ private String mContactsCount = "";
+
public ContactEntryListAdapter(Context context) {
super(context);
addPartitions();
@@ -92,6 +106,20 @@
((ContactListPinnedHeaderView)pinnedHeaderView).setSectionHeader(title);
}
+ protected void setPinnedHeaderContactsCount(View header) {
+ // Update the header with the contacts count only if a profile header exists
+ // otherwise, the contacts count are shown in the empty profile header view
+ if (mProfileExists) {
+ ((ContactListPinnedHeaderView)header).setCountView(mContactsCount);
+ } else {
+ clearPinnedHeaderContactsCount(header);
+ }
+ }
+
+ protected void clearPinnedHeaderContactsCount(View header) {
+ ((ContactListPinnedHeaderView)header).setCountView(null);
+ }
+
protected void addPartitions() {
addPartition(createDefaultDirectoryPartition());
}
@@ -276,6 +304,22 @@
mIncludeProfile = includeProfile;
}
+ public void setProfileExists(boolean exists) {
+ mProfileExists = exists;
+ // Stick the "ME" header for the profile
+ if (exists) {
+ SectionIndexer indexer = getIndexer();
+ if (indexer != null) {
+ ((ContactsSectionIndexer) indexer).setProfileHeader(
+ getContext().getString(R.string.user_profile_contacts_list_header));
+ }
+ }
+ }
+
+ public boolean hasProfile() {
+ return mProfileExists;
+ }
+
public void configureDirectoryLoader(DirectoryListLoader loader) {
loader.setDirectorySearchMode(mDirectorySearchMode);
loader.setLocalInvisibleDirectoryEnabled(LOCAL_INVISIBLE_DIRECTORY_ENABLED);
@@ -558,30 +602,15 @@
return true;
}
- @Override
- public Placement getItemPlacementInSection(int position) {
- // Special case code to prevent a section header from being displayed above the user's
- // profile entry.
- if (isUserProfile(position)) {
- // The user profile entry shouldn't display a section header above; the header should be
- // displayed on top of the item below.
- Placement placement = new Placement();
- placement.firstInSection = false;
- placement.lastInSection = false;
- placement.sectionHeader = null;
- return placement;
- } else if (position > 0 && isUserProfile(position - 1)) {
- // If the item in the previous position is the user's profile, behave as if this entry
- // is the first in the section.
- Placement profilePlacement = super.getItemPlacementInSection(position - 1);
- String profileHeader = profilePlacement.sectionHeader;
- Placement placement = super.getItemPlacementInSection(position);
- placement.firstInSection = true;
- placement.sectionHeader = profileHeader;
- return placement;
- } else {
- return super.getItemPlacementInSection(position);
- }
+ /**
+ * Returns the currently selected filter.
+ */
+ public ContactListFilter getFilter() {
+ return mFilter;
+ }
+
+ public void setFilter(ContactListFilter filter) {
+ mFilter = filter;
}
// TODO: move sharable logic (bindXX() methods) to here with extra arguments
@@ -611,4 +640,12 @@
}
return uri;
}
+
+ public void setContactsCount(String count) {
+ mContactsCount = count;
+ }
+
+ public String getContactsCount() {
+ return mContactsCount;
+ }
}
diff --git a/src/com/android/contacts/list/ContactEntryListFragment.java b/src/com/android/contacts/list/ContactEntryListFragment.java
index e32e131..4ddba75 100644
--- a/src/com/android/contacts/list/ContactEntryListFragment.java
+++ b/src/com/android/contacts/list/ContactEntryListFragment.java
@@ -134,6 +134,8 @@
private boolean mForceLoad;
+ protected boolean mUserProfileExists;
+
private static final int STATUS_NOT_LOADED = 0;
private static final int STATUS_LOADING = 1;
private static final int STATUS_LOADED = 2;
@@ -444,6 +446,7 @@
}
mAdapter.changeCursor(partitionIndex, data);
+ setProfileHeader();
showCount(partitionIndex, data);
if (!isLoading()) {
@@ -499,6 +502,14 @@
}
/**
+ * Shows a view at the top of the list with a pseudo local profile prompting the user to add
+ * a local profile. Default implementation does nothing.
+ */
+ protected void setProfileHeader() {
+ mUserProfileExists = false;
+ }
+
+ /**
* Provides logic that dismisses this fragment. The default implementation
* does nothing.
*/
@@ -544,13 +555,13 @@
mListView.setFastScrollEnabled(hasScrollbar);
mListView.setFastScrollAlwaysVisible(hasScrollbar);
mListView.setVerticalScrollbarPosition(mVerticalScrollbarPosition);
+ mListView.setScrollBarStyle(ListView.SCROLLBARS_OUTSIDE_OVERLAY);
int leftPadding = 0;
int rightPadding = 0;
if (mVerticalScrollbarPosition == View.SCROLLBAR_POSITION_LEFT) {
leftPadding = mContext.getResources().getDimensionPixelOffset(
R.dimen.list_visible_scrollbar_padding);
- mListView.setScrollBarStyle(ListView.SCROLLBARS_OUTSIDE_OVERLAY);
- } else if (hasScrollbar){
+ } else {
rightPadding = mContext.getResources().getDimensionPixelOffset(
R.dimen.list_visible_scrollbar_padding);
}
@@ -585,6 +596,9 @@
public void setIncludeProfile(boolean flag) {
mIncludeProfile = flag;
+ if(mAdapter != null) {
+ mAdapter.setIncludeProfile(flag);
+ }
}
public void setSearchMode(boolean flag) {
diff --git a/src/com/android/contacts/list/ContactListAdapter.java b/src/com/android/contacts/list/ContactListAdapter.java
index 467dcc3..51cc965 100644
--- a/src/com/android/contacts/list/ContactListAdapter.java
+++ b/src/com/android/contacts/list/ContactListAdapter.java
@@ -115,32 +115,16 @@
private ContactListFilter mFilter;
- // View types for entries in the list view.
- private final int mViewTypeProfileEntry;
-
-
public ContactListAdapter(Context context) {
super(context);
mUnknownNameText = context.getText(R.string.missing_name);
- mViewTypeProfileEntry = getViewTypeCount() - 1;
}
public CharSequence getUnknownNameText() {
return mUnknownNameText;
}
- /**
- * Returns the currently selected filter.
- */
- public ContactListFilter getFilter() {
- return mFilter;
- }
-
- public void setFilter(ContactListFilter filter) {
- mFilter = filter;
- }
-
public long getSelectedContactDirectoryId() {
return mSelectedContactDirectoryId;
}
@@ -240,12 +224,7 @@
@Override
protected View newView(Context context, int partition, Cursor cursor, int position,
ViewGroup parent) {
- ContactListItemView view;
- if (getItemViewType(position) == mViewTypeProfileEntry) {
- view = new ContactListProfileItemView(context, null);
- } else {
- view = new ContactListItemView(context, null);
- }
+ ContactListItemView view = new ContactListItemView(context, null);
view.setUnknownNameText(mUnknownNameText);
view.setTextWithHighlightingFactory(getTextWithHighlightingFactory());
view.setQuickContactEnabled(isQuickContactEnabled());
@@ -253,32 +232,23 @@
return view;
}
- @Override
- public int getItemViewType(int position) {
- return isUserProfile(position)
- ? mViewTypeProfileEntry
- : super.getItemViewType(position);
- }
-
- @Override
- public int getItemViewTypeCount() {
- return super.getItemViewTypeCount() + 1;
- }
-
- @Override
- public int getViewTypeCount() {
- // One extra view type - the user's profile entry view.
- return super.getViewTypeCount() + 1;
- }
-
- protected void bindSectionHeaderAndDivider(ContactListItemView view, int position) {
+ protected void bindSectionHeaderAndDivider(ContactListItemView view, int position,
+ Cursor cursor) {
if (isSectionHeaderDisplayEnabled()) {
Placement placement = getItemPlacementInSection(position);
- view.setSectionHeader(placement.firstInSection ? placement.sectionHeader : null);
+
+ // First position, set the contacts number string
+ if (position == 0 && cursor.getInt(CONTACT_IS_USER_PROFILE) == 1) {
+ view.setCountView(getContactsCount());
+ } else {
+ view.setCountView(null);
+ }
+ view.setSectionHeader(placement.sectionHeader);
view.setDividerVisible(!placement.lastInSection);
} else {
view.setSectionHeader(null);
view.setDividerVisible(true);
+ view.setCountView(null);
}
}
@@ -398,4 +368,15 @@
return null;
}
+
+ @Override
+ public void changeCursor(int partitionIndex, Cursor cursor) {
+ super.changeCursor(partitionIndex, cursor);
+
+ // Check if a profile exists
+ if (cursor != null && cursor.getCount() > 0) {
+ cursor.moveToFirst();
+ setProfileExists(cursor.getInt(CONTACT_IS_USER_PROFILE) == 1);
+ }
+ }
}
diff --git a/src/com/android/contacts/list/ContactListItemView.java b/src/com/android/contacts/list/ContactListItemView.java
index 4c20dca..0fe8d0d 100644
--- a/src/com/android/contacts/list/ContactListItemView.java
+++ b/src/com/android/contacts/list/ContactListItemView.java
@@ -115,6 +115,7 @@
private TextView mDataView;
private TextView mSnippetView;
private TextView mStatusView;
+ private TextView mCountView;
private ImageView mPresenceIcon;
private char[] mHighlightedPrefix;
@@ -346,6 +347,11 @@
mHeaderTextView.measure(
MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY),
MeasureSpec.makeMeasureSpec(mHeaderBackgroundHeight, MeasureSpec.EXACTLY));
+ if (mCountView != null) {
+ mCountView.measure(
+ MeasureSpec.makeMeasureSpec(width, MeasureSpec.AT_MOST),
+ MeasureSpec.makeMeasureSpec(mHeaderBackgroundHeight, MeasureSpec.EXACTLY));
+ }
mHeaderBackgroundHeight = Math.max(mHeaderBackgroundHeight,
mHeaderTextView.getMeasuredHeight());
height += (mHeaderBackgroundHeight + mHeaderUnderlineHeight);
@@ -370,6 +376,12 @@
0,
width - mPaddingRight,
mHeaderBackgroundHeight);
+ if (mCountView != null) {
+ mCountView.layout(width - mPaddingRight - mCountView.getMeasuredWidth(),
+ 0,
+ width - mPaddingRight,
+ mHeaderBackgroundHeight);
+ }
mHeaderDivider.layout(leftBound,
mHeaderBackgroundHeight,
width - mPaddingRight,
@@ -921,6 +933,36 @@
}
/**
+ * Returns the text view for the contacts count, creating it if necessary.
+ */
+ public TextView getCountView() {
+ if (mCountView == null) {
+ mCountView = new TextView(mContext);
+ mCountView.setSingleLine(true);
+ mCountView.setEllipsize(getTextEllipsis());
+ mCountView.setTextAppearance(mContext, android.R.style.TextAppearance_Medium);
+ mCountView.setTextColor(R.color.contact_count_text_color);
+ addView(mCountView);
+ }
+ return mCountView;
+ }
+
+ /**
+ * Adds or updates a text view for the contacts count.
+ */
+ public void setCountView(CharSequence text) {
+ if (TextUtils.isEmpty(text)) {
+ if (mCountView != null) {
+ mCountView.setVisibility(View.GONE);
+ }
+ } else {
+ getCountView();
+ mCountView.setText(text);
+ mCountView.setVisibility(VISIBLE);
+ }
+ }
+
+ /**
* Adds or updates a text view for the status.
*/
public void setStatus(CharSequence text) {
diff --git a/src/com/android/contacts/list/ContactListPinnedHeaderView.java b/src/com/android/contacts/list/ContactListPinnedHeaderView.java
index 5d0d7b1..a689045 100644
--- a/src/com/android/contacts/list/ContactListPinnedHeaderView.java
+++ b/src/com/android/contacts/list/ContactListPinnedHeaderView.java
@@ -45,9 +45,11 @@
private final int mHeaderUnderlineColor;
private final int mPaddingRight;
private final int mPaddingLeft;
+ private final int mContactsCountTextColor;
private int mHeaderBackgroundHeight;
private TextView mHeaderTextView;
+ private TextView mCountTextView = null;
private View mHeaderDivider;
public ContactListPinnedHeaderView(Context context, AttributeSet attrs) {
@@ -72,6 +74,8 @@
R.styleable.ContactListItemView_list_item_padding_left, 0);
mPaddingRight = a.getDimensionPixelOffset(
R.styleable.ContactListItemView_list_item_padding_right, 0);
+ mContactsCountTextColor = a.getColor(
+ R.styleable.ContactListItemView_list_item_contacts_count_text_color, Color.BLACK);
a.recycle();
@@ -93,8 +97,13 @@
int width = resolveSize(0, widthMeasureSpec);
mHeaderTextView.measure(
- MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY),
+ MeasureSpec.makeMeasureSpec(width, MeasureSpec.AT_MOST),
MeasureSpec.makeMeasureSpec(mHeaderBackgroundHeight, MeasureSpec.EXACTLY));
+ if (isViewMeasurable(mCountTextView)) {
+ mCountTextView.measure(
+ MeasureSpec.makeMeasureSpec(width, MeasureSpec.AT_MOST),
+ MeasureSpec.makeMeasureSpec(mHeaderBackgroundHeight, MeasureSpec.EXACTLY));
+ }
setMeasuredDimension(width, mHeaderBackgroundHeight + mHeaderUnderlineHeight);
}
@@ -105,8 +114,16 @@
mHeaderTextView.layout(mHeaderTextIndent + mPaddingLeft,
0,
- width,
+ mHeaderTextView.getMeasuredWidth() + mHeaderTextIndent + mPaddingLeft,
mHeaderBackgroundHeight);
+
+ if (isViewMeasurable(mCountTextView)) {
+ mCountTextView.layout(width - mPaddingRight - mCountTextView.getMeasuredWidth(),
+ 0,
+ width,
+ mHeaderBackgroundHeight);
+ }
+
mHeaderDivider.layout(mPaddingLeft,
mHeaderBackgroundHeight,
width,
@@ -134,4 +151,23 @@
// view (ListView).
forceLayout();
}
+
+ public void setCountView(String count) {
+ if (mCountTextView == null) {
+ mCountTextView = new TextView(mContext);
+ mCountTextView.setTextColor(mContactsCountTextColor);
+ mCountTextView.setTextSize(mHeaderTextSize);
+ addView(mCountTextView);
+ }
+ mCountTextView.setText(count);
+ if (count == null || count.isEmpty()) {
+ mCountTextView.setVisibility(View.GONE);
+ } else {
+ mCountTextView.setVisibility(View.VISIBLE);
+ }
+ }
+
+ private boolean isViewMeasurable(View view) {
+ return (view != null && view.getVisibility() == View.VISIBLE);
+ }
}
diff --git a/src/com/android/contacts/list/ContactListProfileItemView.java b/src/com/android/contacts/list/ContactListProfileItemView.java
deleted file mode 100644
index f189366..0000000
--- a/src/com/android/contacts/list/ContactListProfileItemView.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * 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.
- */
-package com.android.contacts.list;
-
-import com.android.contacts.R;
-
-import android.content.Context;
-import android.content.res.TypedArray;
-import android.database.Cursor;
-import android.util.AttributeSet;
-import android.widget.TextView;
-
-/**
- * Contact list entry that represents the user's personal profile data.
- */
-public class ContactListProfileItemView extends ContactListItemView {
-
- public ContactListProfileItemView(Context context, AttributeSet attrs) {
- super(context, attrs);
-
- TypedArray a = getContext().obtainStyledAttributes(attrs, R.styleable.ContactListItemView);
- setDefaultPhotoViewSize(a.getDimensionPixelOffset(
- R.styleable.ContactListItemView_list_item_profile_photo_size, 0));
- }
-
- @Override
- public TextView getNameTextView() {
- TextView nameTextView = super.getNameTextView();
- nameTextView.setTextAppearance(getContext(), android.R.style.TextAppearance_Large);
- return nameTextView;
- }
-
- @Override
- public void showDisplayName(Cursor cursor, int nameColumnIndex, int alternativeNameColumnIndex,
- boolean highlightingEnabled, int displayOrder) {
- getNameTextView().setText(getContext().getText(R.string.profile_display_name));
- }
-}
diff --git a/src/com/android/contacts/list/ContactsSectionIndexer.java b/src/com/android/contacts/list/ContactsSectionIndexer.java
index a80d1de..109b8ba 100644
--- a/src/com/android/contacts/list/ContactsSectionIndexer.java
+++ b/src/com/android/contacts/list/ContactsSectionIndexer.java
@@ -93,4 +93,10 @@
*/
return index >= 0 ? index : -index - 2;
}
+
+ public void setProfileHeader(String header) {
+ if (mSections != null && mSections.length > 0) {
+ mSections[0] = header;
+ }
+ }
}
diff --git a/src/com/android/contacts/list/CustomContactListFilterActivity.java b/src/com/android/contacts/list/CustomContactListFilterActivity.java
index e0965cc..26610dc 100644
--- a/src/com/android/contacts/list/CustomContactListFilterActivity.java
+++ b/src/com/android/contacts/list/CustomContactListFilterActivity.java
@@ -29,6 +29,7 @@
import com.android.contacts.util.WeakAsyncTask;
import com.google.android.collect.Lists;
+import android.app.ActionBar;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.LoaderManager.LoaderCallbacks;
@@ -107,6 +108,12 @@
mList.setOnCreateContextMenuListener(this);
mList.setAdapter(mAdapter);
+
+ ActionBar actionBar = getActionBar();
+ if (actionBar != null) {
+ // android.R.id.home will be triggered in onOptionsItemSelected()
+ actionBar.setDisplayHomeAsUpEnabled(true);
+ }
}
public static class CustomFilterConfigurationLoader extends AsyncTaskLoader<AccountSet> {
@@ -801,12 +808,6 @@
}
}
- /** {@inheritDoc} */
- @Override
- public void onBackPressed() {
- doSaveAction();
- }
-
@SuppressWarnings("unchecked")
private void doSaveAction() {
if (mAdapter == null || mAdapter.mAccounts == null) {
@@ -897,4 +898,18 @@
ContactsSearchManager.startSearch(this, initialQuery);
}
}
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ switch (item.getItemId()) {
+ case android.R.id.home:
+ // Pretend cancel.
+ setResult(Activity.RESULT_CANCELED);
+ finish();
+ return true;
+ default:
+ break;
+ }
+ return super.onOptionsItemSelected(item);
+ }
}
diff --git a/src/com/android/contacts/list/DefaultContactBrowseListFragment.java b/src/com/android/contacts/list/DefaultContactBrowseListFragment.java
index ded35a4..8590c29 100644
--- a/src/com/android/contacts/list/DefaultContactBrowseListFragment.java
+++ b/src/com/android/contacts/list/DefaultContactBrowseListFragment.java
@@ -16,13 +16,18 @@
package com.android.contacts.list;
import com.android.contacts.R;
+import com.android.contacts.editor.ContactEditorFragment;
+import android.content.Intent;
import android.database.Cursor;
+import android.provider.ContactsContract.Contacts;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
+import android.widget.Button;
import android.widget.FrameLayout;
+import android.widget.ListView;
import android.widget.ProgressBar;
import android.widget.TextView;
@@ -35,6 +40,11 @@
private TextView mCounterHeaderView;
private View mSearchHeaderView;
private TextView mAccountFilterHeaderView;
+ private View mAccountFilterHeaderContainer;
+ private View mProfileHeader;
+ private Button mProfileMessage;
+ private FrameLayout mMessageContainer;
+ private View mProfileTitle;
public DefaultContactBrowseListFragment() {
setPhotoLoaderEnabled(true);
@@ -65,8 +75,15 @@
super.onCreateView(inflater, container);
mAccountFilterHeaderView = (TextView) getView().findViewById(R.id.account_filter_header);
+ mAccountFilterHeaderContainer =
+ getView().findViewById(R.id.account_filter_header_container);
mCounterHeaderView = (TextView) getView().findViewById(R.id.contacts_count);
+ // Create an empty user profile header and hide it for now (it will be visible if the
+ // contacts list will have no user profile).
+ addEmptyUserProfileHeader(inflater);
+ showEmptyUserProfile(false);
+
// Putting the header view inside a container will allow us to make
// it invisible later. See checkHeaderViewVisibility()
FrameLayout headerContainer = new FrameLayout(inflater.getContext());
@@ -107,11 +124,11 @@
}
if (filter != null && filter.filterType != ContactListFilter.FILTER_TYPE_ALL_ACCOUNTS &&
!isSearchMode() && filter.filterType != ContactListFilter.FILTER_TYPE_CUSTOM) {
+ mAccountFilterHeaderContainer.setVisibility(View.VISIBLE);
mAccountFilterHeaderView.setText(getContext().getString(
R.string.listAllContactsInAccount, filter.accountName));
- mAccountFilterHeaderView.setVisibility(View.VISIBLE);
} else {
- mAccountFilterHeaderView.setVisibility(View.GONE);
+ mAccountFilterHeaderContainer.setVisibility(View.GONE);
}
}
@@ -122,7 +139,11 @@
if (count != 0) {
String format = getResources().getQuantityText(
R.plurals.listTotalAllContacts, count).toString();
- mCounterHeaderView.setText(String.format(format, count));
+ if (mUserProfileExists) {
+ getAdapter().setContactsCount(String.format(format, count));
+ } else {
+ mCounterHeaderView.setText(String.format(format, count));
+ }
} else {
ContactListFilter filter = getFilter();
int filterType = filter != null ? filter.filterType
@@ -173,6 +194,56 @@
}
mSearchHeaderView.setVisibility(View.VISIBLE);
}
+ showEmptyUserProfile(false);
}
}
+
+ @Override
+ protected void setProfileHeader() {
+ mUserProfileExists = getAdapter().hasProfile();
+ showEmptyUserProfile(!mUserProfileExists && !isSearchMode());
+ }
+
+ private void showEmptyUserProfile(boolean show) {
+ // Changing visibility of just the mProfileHeader doesn't do anything unless
+ // you change visibility of its children, hence the call to mCounterHeaderView
+ // and mProfileTitle
+ mProfileHeader.setVisibility(show ? View.VISIBLE : View.GONE);
+ mCounterHeaderView.setVisibility(show ? View.VISIBLE : View.GONE);
+ mProfileTitle.setVisibility(show ? View.VISIBLE : View.GONE);
+ mMessageContainer.setVisibility(show ? View.VISIBLE : View.GONE);
+ mProfileMessage.setVisibility(show ? View.VISIBLE : View.GONE);
+ }
+
+ /**
+ * This method creates a pseudo user profile contact. When the returned query doesn't have
+ * a profile, this methods creates 2 views that are inserted as headers to the listview:
+ * 1. A header view with the "ME" title and the contacts count.
+ * 2. A button that prompts the user to create a local profile
+ */
+ private void addEmptyUserProfileHeader(LayoutInflater inflater) {
+
+ ListView list = getListView();
+ // Put a header with the "ME" name and a view for the number of contacts
+ mProfileHeader = inflater.inflate(R.layout.user_profile_header, null, false);
+ mCounterHeaderView = (TextView) mProfileHeader.findViewById(R.id.contacts_count);
+ mProfileTitle = mProfileHeader.findViewById(R.id.profile_title);
+ list.addHeaderView(mProfileHeader, null, false);
+
+ // Add a selectable view with a message inviting the user to create a local profile
+ // The view is embedded in a frame view since you cannot change the visibility of a
+ // view in a ListView without having a parent view.
+ mMessageContainer = new FrameLayout(inflater.getContext());
+ mProfileMessage = (Button)inflater.inflate(R.layout.user_profile_button, null, false);
+ mMessageContainer.addView(mProfileMessage);
+ list.addHeaderView(mMessageContainer, null, true);
+
+ mProfileMessage.setOnClickListener(new View.OnClickListener() {
+ public void onClick(View v) {
+ Intent intent = new Intent(Intent.ACTION_INSERT, Contacts.CONTENT_URI);
+ intent.putExtra(ContactEditorFragment.INTENT_EXTRA_NEW_LOCAL_PROFILE, true);
+ startActivity(intent);
+ }
+ });
+ }
}
diff --git a/src/com/android/contacts/list/DefaultContactListAdapter.java b/src/com/android/contacts/list/DefaultContactListAdapter.java
index 8e96690..e9804f5 100644
--- a/src/com/android/contacts/list/DefaultContactListAdapter.java
+++ b/src/com/android/contacts/list/DefaultContactListAdapter.java
@@ -229,7 +229,7 @@
view.setActivated(isSelectedContact(partition, cursor));
}
- bindSectionHeaderAndDivider(view, position);
+ bindSectionHeaderAndDivider(view, position, cursor);
if (isQuickContactEnabled()) {
bindQuickContact(view, partition, cursor,
diff --git a/src/com/android/contacts/list/JoinContactListAdapter.java b/src/com/android/contacts/list/JoinContactListAdapter.java
index e7a9eb9..e764125 100644
--- a/src/com/android/contacts/list/JoinContactListAdapter.java
+++ b/src/com/android/contacts/list/JoinContactListAdapter.java
@@ -217,7 +217,7 @@
}
case PARTITION_ALL_CONTACTS: {
final ContactListItemView view = (ContactListItemView)itemView;
- bindSectionHeaderAndDivider(view, position);
+ bindSectionHeaderAndDivider(view, position, cursor);
bindPhoto(view, partition, cursor);
bindName(view, cursor);
break;
diff --git a/src/com/android/contacts/list/PhoneNumberListAdapter.java b/src/com/android/contacts/list/PhoneNumberListAdapter.java
index 21a7846..87fb60f 100644
--- a/src/com/android/contacts/list/PhoneNumberListAdapter.java
+++ b/src/com/android/contacts/list/PhoneNumberListAdapter.java
@@ -22,15 +22,21 @@
import android.net.Uri;
import android.net.Uri.Builder;
import android.provider.ContactsContract;
+import android.provider.ContactsContract.CommonDataKinds.GroupMembership;
import android.provider.ContactsContract.CommonDataKinds.Phone;
import android.provider.ContactsContract.ContactCounts;
+import android.provider.ContactsContract.Contacts;
import android.provider.ContactsContract.Data;
import android.provider.ContactsContract.Directory;
+import android.provider.ContactsContract.RawContacts;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
+import java.util.ArrayList;
+import java.util.List;
+
/**
* A cursor adapter for the {@link Phone#CONTENT_TYPE} content type.
*/
@@ -79,6 +85,20 @@
public void configureLoader(CursorLoader loader, long directoryId) {
Uri uri;
+ if (directoryId != Directory.DEFAULT) {
+ Log.w(TAG, "PhoneNumberListAdapter is not ready for non-default directory ID ("
+ + "directoryId: " + directoryId + ")");
+ }
+
+ final ContactListFilter filter = getFilter();
+ if (filter != null &&
+ (filter.filterType != ContactListFilter.FILTER_TYPE_ALL_ACCOUNTS &&
+ filter.filterType != ContactListFilter.FILTER_TYPE_ACCOUNT &&
+ filter.filterType != ContactListFilter.FILTER_TYPE_CUSTOM)) {
+ throw new IllegalArgumentException("Unexpected filter type came " +
+ "(type: " + filter.filterType + ", toString: " + filter + ")");
+ }
+
if (isSearchMode()) {
String query = getQueryString();
Builder builder = Phone.CONTENT_FILTER_URI.buildUpon();
@@ -102,6 +122,7 @@
}
loader.setProjection(PHONES_PROJECTION);
+ configureSelection(loader, directoryId, filter);
}
loader.setUri(uri);
@@ -114,6 +135,59 @@
}
}
+ private void configureSelection(
+ CursorLoader loader, long directoryId, ContactListFilter filter) {
+ if (filter == null || directoryId != Directory.DEFAULT) {
+ return;
+ }
+
+ final StringBuilder selection = new StringBuilder();
+ final List<String> selectionArgs = new ArrayList<String>();
+
+ switch (filter.filterType) {
+ case ContactListFilter.FILTER_TYPE_ALL_ACCOUNTS: {
+ break;
+ }
+ case ContactListFilter.FILTER_TYPE_CUSTOM: {
+ selection.append(Contacts.IN_VISIBLE_GROUP + "=1");
+ selection.append(" AND " + Contacts.HAS_PHONE_NUMBER + "=1");
+ break;
+ }
+ case ContactListFilter.FILTER_TYPE_ACCOUNT: {
+ selection.append("(");
+
+ selection.append(RawContacts.ACCOUNT_TYPE + "=?"
+ + " AND " + RawContacts.ACCOUNT_NAME + "=?");
+ selectionArgs.add(filter.accountType);
+ selectionArgs.add(filter.accountName);
+ if (filter.dataSet != null) {
+ selection.append(" AND " + RawContacts.DATA_SET + "=?");
+ selectionArgs.add(filter.dataSet);
+ } else {
+ selection.append(" AND " + RawContacts.DATA_SET + " IS NULL");
+ }
+ selection.append(")");
+ break;
+ }
+ case ContactListFilter.FILTER_TYPE_GROUP: {
+ selection.append(Data.MIMETYPE + "=?"
+ + " AND " + GroupMembership.GROUP_ROW_ID + "=?");
+ selectionArgs.add(GroupMembership.CONTENT_ITEM_TYPE);
+ selectionArgs.add(String.valueOf(filter.groupId));
+ break;
+ }
+
+ case ContactListFilter.FILTER_TYPE_SINGLE_CONTACT:
+ case ContactListFilter.FILTER_TYPE_STARRED:
+ case ContactListFilter.FILTER_TYPE_WITH_PHONE_NUMBERS_ONLY:
+ default:
+ throw new IllegalArgumentException("Unexpected filter type came " +
+ "(type: " + filter.filterType + ", toString: " + filter + ")");
+ }
+ loader.setSelection(selection.toString());
+ loader.setSelectionArgs(selectionArgs.toArray(new String[0]));
+ }
+
protected static Uri buildSectionIndexerUri(Uri uri) {
return uri.buildUpon()
.appendQueryParameter(ContactCounts.ADDRESS_BOOK_INDEX_EXTRAS, "true").build();
diff --git a/src/com/android/contacts/list/PhoneNumberPickerFragment.java b/src/com/android/contacts/list/PhoneNumberPickerFragment.java
index 1866ea0..306efbd 100644
--- a/src/com/android/contacts/list/PhoneNumberPickerFragment.java
+++ b/src/com/android/contacts/list/PhoneNumberPickerFragment.java
@@ -19,14 +19,19 @@
import com.android.contacts.R;
import com.android.contacts.list.ShortcutIntentBuilder.OnShortcutIntentCreatedListener;
+import android.app.Activity;
import android.content.Intent;
+import android.content.SharedPreferences;
import android.net.Uri;
+import android.os.Bundle;
+import android.preference.PreferenceManager;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Adapter;
+import android.widget.TextView;
/**
* Fragment containing a phone number list for picking.
@@ -38,6 +43,14 @@
private OnPhoneNumberPickerActionListener mListener;
private String mShortcutAction;
+ private SharedPreferences mPrefs;
+ private ContactListFilter mFilter;
+
+ private TextView mAccountFilterHeaderView;
+ private View mAccountFilterHeaderContainer;
+
+ private static final String KEY_FILTER = "filter";
+
/**
* Used to remember the result of {@link #setNameHighlightingEnabled(boolean)} when it is called
* before this Fragment is attached to its parent Activity. The value will be used after
@@ -64,6 +77,66 @@
}
@Override
+ protected void onCreateView(LayoutInflater inflater, ViewGroup container) {
+ super.onCreateView(inflater, container);
+
+ mAccountFilterHeaderView = (TextView) getView().findViewById(R.id.account_filter_header);
+ mAccountFilterHeaderContainer =
+ getView().findViewById(R.id.account_filter_header_container);
+ updateFilterHeaderView();
+ }
+
+ @Override
+ public void setSearchMode(boolean flag) {
+ super.setSearchMode(flag);
+ updateFilterHeaderView();
+ }
+
+ private void updateFilterHeaderView() {
+ if (mAccountFilterHeaderView != null) {
+ ContactListFilter filter = getFilter();
+ if (filter != null
+ && !isSearchMode()
+ && filter.filterType == ContactListFilter.FILTER_TYPE_ACCOUNT) {
+ mAccountFilterHeaderContainer.setVisibility(View.VISIBLE);
+ mAccountFilterHeaderView.setText(getContext().getString(
+ R.string.listAllContactsInAccount, filter.accountName));
+ } else {
+ mAccountFilterHeaderContainer.setVisibility(View.GONE);
+ }
+ }
+ }
+
+ @Override
+ public void onAttach(Activity activity) {
+ super.onAttach(activity);
+ mPrefs = PreferenceManager.getDefaultSharedPreferences(activity);
+ }
+
+ @Override
+ public void onDetach() {
+ super.onDetach();
+ mPrefs = null;
+ }
+
+ @Override
+ public void restoreSavedState(Bundle savedState) {
+ super.restoreSavedState(savedState);
+
+ if (savedState == null) {
+ return;
+ }
+
+ mFilter = savedState.getParcelable(KEY_FILTER);
+ }
+
+ @Override
+ public void onSaveInstanceState(Bundle outState) {
+ super.onSaveInstanceState(outState);
+ outState.putParcelable(KEY_FILTER, mFilter);
+ }
+
+ @Override
public boolean onOptionsItemSelected(MenuItem item) {
final int itemId = item.getItemId();
if (itemId == android.R.id.home) { // See ActionBar#setDisplayHomeAsUpEnabled()
@@ -122,6 +195,20 @@
}
@Override
+ protected void configureAdapter() {
+ super.configureAdapter();
+
+ ContactEntryListAdapter adapter = getAdapter();
+ if (adapter == null) {
+ return;
+ }
+
+ if (!isSearchMode() && mFilter != null) {
+ adapter.setFilter(mFilter);
+ }
+ }
+
+ @Override
protected View inflateView(LayoutInflater inflater, ViewGroup container) {
return inflater.inflate(R.layout.contacts_list_content, null);
}
@@ -171,4 +258,24 @@
mDelayedNameHighlightingEnabled = null;
}
}
+
+ public ContactListFilter getFilter() {
+ return mFilter;
+ }
+
+ public void setFilter(ContactListFilter filter) {
+ if ((mFilter == null && filter == null) ||
+ (mFilter != null && mFilter.equals(filter))) {
+ return;
+ }
+
+ mFilter = filter;
+ if (mPrefs != null) {
+ // Save the preference now.
+ ContactListFilter.storeToPreferences(mPrefs, mFilter);
+ }
+
+ reloadData();
+ updateFilterHeaderView();
+ }
}
diff --git a/src/com/android/contacts/model/BaseAccountType.java b/src/com/android/contacts/model/BaseAccountType.java
index aca2d3c..0846197 100644
--- a/src/com/android/contacts/model/BaseAccountType.java
+++ b/src/com/android/contacts/model/BaseAccountType.java
@@ -205,7 +205,7 @@
DataKind kind = addKind(new DataKind(Phone.CONTENT_ITEM_TYPE, R.string.phoneLabelsGroup,
android.R.drawable.sym_action_call, 10, true,
R.layout.text_fields_editor_view, android.R.style.TextAppearance_Medium));
- kind.iconAltRes = R.drawable.sym_action_sms;
+ kind.iconAltRes = R.drawable.ic_text_holo_light;
kind.iconAltResDark = R.drawable.ic_text_holo_dark;
kind.actionHeader = new PhoneActionInflater();
kind.actionAltHeader = new PhoneActionAltInflater();
diff --git a/src/com/android/contacts/model/EntityDelta.java b/src/com/android/contacts/model/EntityDelta.java
index fe084f4..97ab347 100644
--- a/src/com/android/contacts/model/EntityDelta.java
+++ b/src/com/android/contacts/model/EntityDelta.java
@@ -31,6 +31,7 @@
import android.provider.BaseColumns;
import android.provider.ContactsContract.CommonDataKinds.GroupMembership;
import android.provider.ContactsContract.Data;
+import android.provider.ContactsContract.Profile;
import android.provider.ContactsContract.RawContacts;
import android.util.Log;
@@ -66,6 +67,12 @@
private ValuesDelta mValues;
/**
+ * URI used for contacts queries, by default it is set to query raw contacts.
+ * It can be set to query the profile's raw contact(s).
+ */
+ private Uri mContactsQueryUri = RawContacts.CONTENT_URI;
+
+ /**
* Internal map of children values from {@link Entity#getSubValues()}, which
* we store here sorted into {@link Data#MIMETYPE} bins.
*/
@@ -367,7 +374,7 @@
if (beforeId == null || beforeVersion == null) return;
final ContentProviderOperation.Builder builder = ContentProviderOperation
- .newAssertQuery(RawContacts.CONTENT_URI);
+ .newAssertQuery(mContactsQueryUri);
builder.withSelection(RawContacts._ID + "=" + beforeId, null);
builder.withValue(RawContacts.VERSION, beforeVersion);
buildInto.add(builder.build());
@@ -398,7 +405,7 @@
}
// Build possible operation at Contact level
- builder = mValues.buildDiff(RawContacts.CONTENT_URI);
+ builder = mValues.buildDiff(mContactsQueryUri);
possibleAdd(buildInto, builder);
// Build operations for all children
@@ -435,7 +442,7 @@
buildInto.add(builder.build());
} else if (isContactInsert) {
// Restore aggregation mode as last operation
- builder = ContentProviderOperation.newUpdate(RawContacts.CONTENT_URI);
+ builder = ContentProviderOperation.newUpdate(mContactsQueryUri);
builder.withValue(RawContacts.AGGREGATION_MODE, RawContacts.AGGREGATION_MODE_DEFAULT);
builder.withSelection(RawContacts._ID + "=?", new String[1]);
builder.withSelectionBackReference(0, firstIndex);
@@ -448,7 +455,7 @@
* {@link RawContacts#AGGREGATION_MODE} to the given value.
*/
protected Builder buildSetAggregationMode(Long beforeId, int mode) {
- Builder builder = ContentProviderOperation.newUpdate(RawContacts.CONTENT_URI);
+ Builder builder = ContentProviderOperation.newUpdate(mContactsQueryUri);
builder.withValue(RawContacts.AGGREGATION_MODE, mode);
builder.withSelection(RawContacts._ID + "=" + beforeId, null);
return builder;
@@ -465,6 +472,7 @@
final int size = this.getEntryCount(false);
dest.writeInt(size);
dest.writeParcelable(mValues, flags);
+ dest.writeParcelable(mContactsQueryUri, flags);
for (ArrayList<ValuesDelta> mimeEntries : mEntries.values()) {
for (ValuesDelta child : mimeEntries) {
dest.writeParcelable(child, flags);
@@ -476,12 +484,20 @@
final ClassLoader loader = getClass().getClassLoader();
final int size = source.readInt();
mValues = source.<ValuesDelta> readParcelable(loader);
+ mContactsQueryUri = source.<Uri> readParcelable(loader);
for (int i = 0; i < size; i++) {
final ValuesDelta child = source.<ValuesDelta> readParcelable(loader);
this.addEntry(child);
}
}
+ /**
+ * Used to set the query URI to the profile URI to store profiles.
+ */
+ public void setProfileQueryUri() {
+ mContactsQueryUri = Profile.CONTENT_RAW_CONTACTS_URI;
+ }
+
public static final Parcelable.Creator<EntityDelta> CREATOR = new Parcelable.Creator<EntityDelta>() {
public EntityDelta createFromParcel(Parcel in) {
final EntityDelta state = new EntityDelta();
diff --git a/src/com/android/contacts/quickcontact/QuickContactActivity.java b/src/com/android/contacts/quickcontact/QuickContactActivity.java
index d8f9c2c..af18917 100644
--- a/src/com/android/contacts/quickcontact/QuickContactActivity.java
+++ b/src/com/android/contacts/quickcontact/QuickContactActivity.java
@@ -21,7 +21,6 @@
import com.android.contacts.R;
import com.android.contacts.model.AccountTypeManager;
import com.android.contacts.model.DataKind;
-import com.android.contacts.util.Constants;
import com.android.contacts.util.ContactBadgeUtil;
import com.android.contacts.util.DataStatus;
import com.android.contacts.util.NotifyingAsyncQueryHandler;
@@ -83,10 +82,6 @@
import java.util.Set;
// TODO: Save selected tab index during rotation
-// TODO: Handle GTalk Audio/Videochat secondary actions
-// TODO: Don't do a query in QuickContactBadge
-// TODO: Fix bug when QuickContact is dismissed using HOME or task switching
-// (it will relaunch with the previous contact)
// Missing assets and specs:
// Pushed states for list items
diff --git a/src/com/android/contacts/util/AbstractBackgroundTask.java b/src/com/android/contacts/util/AbstractBackgroundTask.java
new file mode 100644
index 0000000..c492e7c
--- /dev/null
+++ b/src/com/android/contacts/util/AbstractBackgroundTask.java
@@ -0,0 +1,29 @@
+/*
+ * 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.
+ */
+
+package com.android.contacts.util;
+
+import com.android.contacts.util.BackgroundTask;
+
+/**
+ * Base class you can use if you only want to override the {@link #doInBackground()} method.
+ */
+public abstract class AbstractBackgroundTask implements BackgroundTask {
+ @Override
+ public void onPostExecute() {
+ // No action necessary.
+ }
+}
diff --git a/src/com/android/contacts/util/BackgroundTask.java b/src/com/android/contacts/util/BackgroundTask.java
new file mode 100644
index 0000000..ba791fb
--- /dev/null
+++ b/src/com/android/contacts/util/BackgroundTask.java
@@ -0,0 +1,31 @@
+/*
+ * 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.
+ */
+
+package com.android.contacts.util;
+
+/**
+ * Simple interface to improve the testability of code using AsyncTasks.
+ * <p>
+ * Provides a trivial replacement for no-arg versions of AsyncTask clients. We may extend this
+ * to add more functionality as we require.
+ * <p>
+ * The same memory-visibility guarantees are made here as are made for AsyncTask objects, namely
+ * that fields set in {@link #doInBackground()} are visible to {@link #onPostExecute()}.
+ */
+public interface BackgroundTask {
+ public void doInBackground();
+ public void onPostExecute();
+}
diff --git a/src/com/android/contacts/util/BackgroundTaskService.java b/src/com/android/contacts/util/BackgroundTaskService.java
new file mode 100644
index 0000000..00f9e3e
--- /dev/null
+++ b/src/com/android/contacts/util/BackgroundTaskService.java
@@ -0,0 +1,54 @@
+/*
+ * 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.
+ */
+
+package com.android.contacts.util;
+
+import android.os.AsyncTask;
+
+/**
+ * Service used to submit tasks to run in the background.
+ * <p>
+ * BackgroundTaskService makes the same memory-visibility guarantees that AsyncTask which it
+ * emulates makes, namely that fields set in the {@link BackgroundTask#doInBackground()} method
+ * will be visible to the {@link BackgroundTask#onPostExecute()} method.
+ */
+public abstract class BackgroundTaskService {
+ public static final String BACKGROUND_TASK_SERVICE = BackgroundTaskService.class.getName();
+
+ public abstract void submit(BackgroundTask task);
+
+ public static BackgroundTaskService createBackgroundTaskService() {
+ return new AsyncTaskBackgroundTaskService();
+ }
+
+ private static final class AsyncTaskBackgroundTaskService extends BackgroundTaskService {
+ @Override
+ public void submit(final BackgroundTask task) {
+ new AsyncTask<Void, Void, Void>() {
+ @Override
+ protected Void doInBackground(Void... params) {
+ task.doInBackground();
+ return null;
+ }
+
+ @Override
+ protected void onPostExecute(Void result) {
+ task.onPostExecute();
+ }
+ }.execute();
+ }
+ }
+}
diff --git a/src/com/android/contacts/voicemail/VoicemailPlaybackFragment.java b/src/com/android/contacts/voicemail/VoicemailPlaybackFragment.java
index fcf99b6..0b30cd9 100644
--- a/src/com/android/contacts/voicemail/VoicemailPlaybackFragment.java
+++ b/src/com/android/contacts/voicemail/VoicemailPlaybackFragment.java
@@ -20,6 +20,7 @@
import static com.android.contacts.CallDetailActivity.EXTRA_VOICEMAIL_URI;
import com.android.contacts.R;
+import com.android.contacts.util.BackgroundTaskService;
import com.android.ex.variablespeed.MediaPlayerProxy;
import com.android.ex.variablespeed.VariableSpeed;
import com.google.common.base.Preconditions;
@@ -36,7 +37,6 @@
import android.widget.ImageButton;
import android.widget.SeekBar;
import android.widget.TextView;
-import android.widget.Toast;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
@@ -97,10 +97,15 @@
boolean startPlayback = arguments.getBoolean(EXTRA_VOICEMAIL_START_PLAYBACK, false);
mPresenter = new VoicemailPlaybackPresenter(new PlaybackViewImpl(),
createMediaPlayer(mScheduledExecutorService), voicemailUri,
- mScheduledExecutorService, startPlayback);
+ mScheduledExecutorService, startPlayback, getBackgroundTaskService());
mPresenter.onCreate(savedInstanceState);
}
+ private BackgroundTaskService getBackgroundTaskService() {
+ return (BackgroundTaskService) getActivity().getApplicationContext().getSystemService(
+ BackgroundTaskService.BACKGROUND_TASK_SERVICE);
+ }
+
@Override
public void onSaveInstanceState(Bundle outState) {
mPresenter.onSaveInstanceState(outState);
@@ -213,6 +218,11 @@
}
@Override
+ public void setIsBuffering() {
+ mTextController.setPermanentText(getString(R.string.voicemail_buffering));
+ }
+
+ @Override
public int getDesiredClipPosition() {
return mPlaybackSeek.getProgress();
}
@@ -224,7 +234,7 @@
mStartStopButton.setEnabled(false);
mPlaybackSeek.setProgress(0);
mPlaybackSeek.setEnabled(false);
- Toast.makeText(getActivity(), R.string.voicemail_playback_error, Toast.LENGTH_SHORT);
+ mTextController.setPermanentText(getString(R.string.voicemail_playback_error));
Log.e(TAG, "Could not play voicemail", e);
}
diff --git a/src/com/android/contacts/voicemail/VoicemailPlaybackPresenter.java b/src/com/android/contacts/voicemail/VoicemailPlaybackPresenter.java
index 6f3a625..e901fab 100644
--- a/src/com/android/contacts/voicemail/VoicemailPlaybackPresenter.java
+++ b/src/com/android/contacts/voicemail/VoicemailPlaybackPresenter.java
@@ -19,6 +19,8 @@
import static android.util.MathUtils.constrain;
import com.android.contacts.R;
+import com.android.contacts.util.BackgroundTask;
+import com.android.contacts.util.BackgroundTaskService;
import com.android.ex.variablespeed.MediaPlayerProxy;
import com.android.ex.variablespeed.SingleThreadedMediaPlayerProxy;
@@ -58,6 +60,7 @@
void setStartStopListener(View.OnClickListener listener);
void setPositionSeekListener(SeekBar.OnSeekBarChangeListener listener);
void setSpeakerphoneListener(View.OnClickListener listener);
+ void setIsBuffering();
void setClipPosition(int clipPositionInMillis, int clipLengthInMillis);
int getDesiredClipPosition();
void playbackStarted();
@@ -124,18 +127,48 @@
private final Uri mVoicemailUri;
/** Start playing in onCreate iff this is true. */
private final boolean mStartPlayingImmediately;
+ /** Used to run background tasks that need to interact with the ui. */
+ private final BackgroundTaskService mBackgroundTaskService;
public VoicemailPlaybackPresenter(PlaybackView view, MediaPlayerProxy player,
Uri voicemailUri, ScheduledExecutorService executorService,
- boolean startPlayingImmediately) {
+ boolean startPlayingImmediately, BackgroundTaskService backgroundTaskService) {
mView = view;
mPlayer = player;
mVoicemailUri = voicemailUri;
mStartPlayingImmediately = startPlayingImmediately;
+ mBackgroundTaskService = backgroundTaskService;
mPositionUpdater = new PositionUpdater(executorService, SLIDER_UPDATE_PERIOD_MILLIS);
}
public void onCreate(Bundle bundle) {
+ mView.setIsBuffering();
+ mBackgroundTaskService.submit(new BackgroundTask() {
+ private Exception mException;
+
+ @Override
+ public void doInBackground() {
+ try {
+ mPlayer.reset();
+ mPlayer.setDataSource(mView.getDataSourceContext(), mVoicemailUri);
+ mPlayer.prepare();
+ } catch (IOException e) {
+ mException = e;
+ }
+ }
+
+ @Override
+ public void onPostExecute() {
+ if (mException == null) {
+ postSuccessfulPrepareActions();
+ } else {
+ mView.playbackError(mException);
+ }
+ }
+ });
+ }
+
+ private void postSuccessfulPrepareActions() {
mView.setPositionSeekListener(new PlaybackPositionListener());
mView.setStartStopListener(new StartStopButtonListener());
mView.setSpeakerphoneListener(new SpeakerphoneListener());
@@ -144,7 +177,7 @@
mView.setSpeakerPhoneOn(mView.isSpeakerPhoneOn());
mView.setRateDecreaseButtonListener(createRateDecreaseListener());
mView.setRateIncreaseButtonListener(createRateIncreaseListener());
- mView.setClipPosition(0, 0);
+ mView.setClipPosition(0, mPlayer.getDuration());
mView.playbackStopped();
if (mStartPlayingImmediately) {
resetPrepareStartPlaying(0);
diff --git a/src/com/android/contacts/widget/IndexerListAdapter.java b/src/com/android/contacts/widget/IndexerListAdapter.java
index 4cd7af0..a5aeb0f 100644
--- a/src/com/android/contacts/widget/IndexerListAdapter.java
+++ b/src/com/android/contacts/widget/IndexerListAdapter.java
@@ -70,6 +70,16 @@
*/
protected abstract void setPinnedSectionTitle(View pinnedHeaderView, String title);
+ /**
+ * Sets the contacts count in the pinned header.
+ */
+ protected abstract void setPinnedHeaderContactsCount(View header);
+
+ /**
+ * clears the contacts count in the pinned header and makes the view invisible.
+ */
+ protected abstract void clearPinnedHeaderContactsCount(View header);
+
public boolean isSectionHeaderDisplayEnabled() {
return mSectionHeaderDisplayEnabled;
}
@@ -174,7 +184,11 @@
listView.setHeaderInvisible(index, false);
} else {
setPinnedSectionTitle(mHeader, (String)mIndexer.getSections()[section]);
-
+ if (section == 0) {
+ setPinnedHeaderContactsCount(mHeader);
+ } else {
+ clearPinnedHeaderContactsCount(mHeader);
+ }
// Compute the item position where the current partition begins
int partitionStart = getPositionForPartition(mIndexedPartition);
if (hasHeader(mIndexedPartition)) {
diff --git a/tests/src/com/android/contacts/CallDetailActivityTest.java b/tests/src/com/android/contacts/CallDetailActivityTest.java
index 7e225c4..c060af5 100644
--- a/tests/src/com/android/contacts/CallDetailActivityTest.java
+++ b/tests/src/com/android/contacts/CallDetailActivityTest.java
@@ -16,10 +16,14 @@
package com.android.contacts;
+import com.android.contacts.test.InjectedServices;
+import com.android.contacts.util.BackgroundTaskService;
import com.android.contacts.util.IntegrationTestUtils;
import com.android.contacts.util.LocaleTestUtils;
+import com.android.contacts.util.FakeBackgroundTaskService;
import com.android.internal.view.menu.ContextMenuBuilder;
import com.google.common.base.Preconditions;
+import com.google.common.util.concurrent.Executors;
import android.app.Activity;
import android.content.ContentResolver;
@@ -28,6 +32,7 @@
import android.content.Intent;
import android.net.Uri;
import android.provider.CallLog;
+import android.provider.VoicemailContract.Voicemails;
import android.test.ActivityInstrumentationTestCase2;
import android.test.suitebuilder.annotation.LargeTest;
import android.test.suitebuilder.annotation.Suppress;
@@ -42,10 +47,12 @@
*/
@LargeTest
public class CallDetailActivityTest extends ActivityInstrumentationTestCase2<CallDetailActivity> {
- private static final String FAKE_VOICEMAIL_URI_STRING = "content://fake_uri";
+ private static final String FAKE_VOICEMAIL_URI_STRING = ContentUris.withAppendedId(
+ Voicemails.CONTENT_URI, Integer.MAX_VALUE).toString();
private Uri mUri;
private IntegrationTestUtils mTestUtils;
private LocaleTestUtils mLocaleTestUtils;
+ private FakeBackgroundTaskService mMockBackgroundTaskService;
public CallDetailActivityTest() {
super(CallDetailActivity.class);
@@ -54,6 +61,11 @@
@Override
protected void setUp() throws Exception {
super.setUp();
+ InjectedServices injectedServices = new InjectedServices();
+ mMockBackgroundTaskService = new FakeBackgroundTaskService();
+ injectedServices.setSystemService(BackgroundTaskService.BACKGROUND_TASK_SERVICE,
+ mMockBackgroundTaskService);
+ ContactsApplication.injectServices(injectedServices);
// I don't like the default of focus-mode for tests, the green focus border makes the
// screenshots look weak.
setActivityInitialTouchMode(true);
@@ -70,9 +82,47 @@
mLocaleTestUtils = null;
cleanUpUri();
mTestUtils = null;
+ ContactsApplication.injectServices(null);
super.tearDown();
}
+ public void testInitialActivityStartsWithBuffering() throws Throwable {
+ setActivityIntentForTestVoicemailEntry();
+ CallDetailActivity activity = getActivity();
+ // When the activity first starts, we will show "buffering..." on the screen.
+ // The duration should not be visible.
+ assertHasOneTextViewContaining(activity, "buffering...");
+ assertZeroTextViewsContaining(activity, "00:00");
+ }
+
+ public void testInvalidVoicemailShowsErrorMessage() throws Throwable {
+ setActivityIntentForTestVoicemailEntry();
+ CallDetailActivity activity = getActivity();
+ // If we run all the background tasks, one of them should have prepared the media player.
+ // Preparing the media player will have thrown an IOException since the file doesn't exist.
+ // This should have put a failed to play message on screen, buffering is gone.
+ runAllBackgroundTasks();
+ assertHasOneTextViewContaining(activity, "failed to play voicemail");
+ assertZeroTextViewsContaining(activity, "buffering...");
+ }
+
+ public void testOnResumeDoesNotCreateManyFragments() throws Throwable {
+ // There was a bug where every time the activity was resumed, a new fragment was created.
+ // Before the fix, this was failing reproducibly with at least 3 "buffering..." views.
+ setActivityIntentForTestVoicemailEntry();
+ final CallDetailActivity activity = getActivity();
+ getInstrumentation().runOnMainSync(new Runnable() {
+ @Override
+ public void run() {
+ getInstrumentation().callActivityOnPause(activity);
+ getInstrumentation().callActivityOnResume(activity);
+ getInstrumentation().callActivityOnPause(activity);
+ getInstrumentation().callActivityOnResume(activity);
+ }
+ });
+ assertHasOneTextViewContaining(activity, "buffering...");
+ }
+
/**
* Test for bug where increase rate button with invalid voicemail causes a crash.
* <p>
@@ -80,7 +130,6 @@
* then click the play button (which just reported an error), then after that try to adjust the
* rate. See http://b/5047879.
*/
- @Suppress
public void testClickIncreaseRateButtonWithInvalidVoicemailDoesNotCrash() throws Throwable {
setActivityIntentForTestVoicemailEntry();
Activity activity = getActivity();
@@ -89,7 +138,6 @@
}
/** Test for bug where missing Extras on intent used to start Activity causes NPE. */
- @Suppress
public void testCallLogUriWithMissingExtrasShouldNotCauseNPE() throws Exception {
setActivityIntentForTestCallEntry();
getActivity();
@@ -100,7 +148,6 @@
* <p>
* See http://b/5054103.
*/
- @Suppress
public void testVoicemailDoesNotHaveRemoveFromCallLog() throws Throwable {
setActivityIntentForTestVoicemailEntry();
CallDetailActivity activity = getActivity();
@@ -184,4 +231,24 @@
private ContentResolver getContentResolver() {
return getInstrumentation().getTargetContext().getContentResolver();
}
+
+ private TextView assertHasOneTextViewContaining(Activity activity, String text)
+ throws Throwable {
+ List<TextView> views = mTestUtils.getTextViewsWithString(activity, text);
+ assertEquals("There should have been one TextView with text '" + text + "' but found "
+ + views, 1, views.size());
+ return views.get(0);
+ }
+
+ private void assertZeroTextViewsContaining(Activity activity, String text) throws Throwable {
+ List<TextView> views = mTestUtils.getTextViewsWithString(activity, text);
+ assertEquals("There should have been no TextViews with text '" + text + "' but found "
+ + views, 0, views.size());
+ }
+
+ private void runAllBackgroundTasks() {
+ mMockBackgroundTaskService.runAllBackgroundTasks(
+ Executors.sameThreadExecutor(),
+ FakeBackgroundTaskService.createMainSyncExecutor(getInstrumentation()));
+ }
}
diff --git a/tests/src/com/android/contacts/activities/CallLogActivityTests.java b/tests/src/com/android/contacts/activities/CallLogActivityTests.java
index 827bd37..7043eb0 100644
--- a/tests/src/com/android/contacts/activities/CallLogActivityTests.java
+++ b/tests/src/com/android/contacts/activities/CallLogActivityTests.java
@@ -281,8 +281,7 @@
mAdapter.bindStandAloneView(view, getActivity(), mCursor);
CallLogListItemViews views = (CallLogListItemViews) view.getTag();
- assertEquals(View.VISIBLE, views.quickContactView.getVisibility());
- assertEquals(View.INVISIBLE, views.plainPhotoView.getVisibility());
+ assertTrue(views.quickContactView.isEnabled());
}
@MediumTest
@@ -293,8 +292,7 @@
mAdapter.bindStandAloneView(view, getActivity(), mCursor);
CallLogListItemViews views = (CallLogListItemViews) view.getTag();
- assertEquals(View.INVISIBLE, views.quickContactView.getVisibility());
- assertEquals(View.VISIBLE, views.plainPhotoView.getVisibility());
+ assertFalse(views.quickContactView.isEnabled());
}
@MediumTest
diff --git a/tests/src/com/android/contacts/activities/PeopleActivityTest.java b/tests/src/com/android/contacts/activities/PeopleActivityTest.java
index 8cef001..fe6d60a 100644
--- a/tests/src/com/android/contacts/activities/PeopleActivityTest.java
+++ b/tests/src/com/android/contacts/activities/PeopleActivityTest.java
@@ -102,6 +102,12 @@
ContactsApplication.injectServices(services);
}
+ @Override
+ protected void tearDown() throws Exception {
+ ContactsApplication.injectServices(null);
+ super.tearDown();
+ }
+
public void testSingleAccountNoGroups() {
// This two-pane UI test only makes sense if we run with two panes.
// Let's ignore this in the single pane case
diff --git a/tests/src/com/android/contacts/tests/mocks/MockContactPhotoManager.java b/tests/src/com/android/contacts/tests/mocks/MockContactPhotoManager.java
index 6da205b..416b841 100644
--- a/tests/src/com/android/contacts/tests/mocks/MockContactPhotoManager.java
+++ b/tests/src/com/android/contacts/tests/mocks/MockContactPhotoManager.java
@@ -37,6 +37,11 @@
}
@Override
+ public void removePhoto(ImageView view) {
+ view.setImageDrawable(null);
+ }
+
+ @Override
public void pause() {
}
diff --git a/tests/src/com/android/contacts/util/FakeBackgroundTaskService.java b/tests/src/com/android/contacts/util/FakeBackgroundTaskService.java
new file mode 100644
index 0000000..a9d80b4
--- /dev/null
+++ b/tests/src/com/android/contacts/util/FakeBackgroundTaskService.java
@@ -0,0 +1,81 @@
+/*
+ * 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.
+ */
+
+package com.android.contacts.util;
+
+import com.google.common.collect.Lists;
+import com.google.common.util.concurrent.Executors;
+
+import android.app.Instrumentation;
+
+import java.util.List;
+import java.util.concurrent.Executor;
+
+/**
+ * Simple test implementation of BackgroundTaskService.
+ */
+public class FakeBackgroundTaskService extends BackgroundTaskService {
+ private final List<BackgroundTask> mSubmittedTasks = Lists.newArrayList();
+
+ @Override
+ public void submit(BackgroundTask task) {
+ mSubmittedTasks.add(task);
+ }
+
+ public List<BackgroundTask> getSubmittedTasks() {
+ return mSubmittedTasks;
+ }
+
+ public static Executor createMainSyncExecutor(final Instrumentation instrumentation) {
+ return new Executor() {
+ @Override
+ public void execute(Runnable runnable) {
+ instrumentation.runOnMainSync(runnable);
+ }
+ };
+ }
+
+ /**
+ * Executes the background tasks, using the supplied executors.
+ * <p>
+ * This is most commonly used with {@link Executors#sameThreadExecutor()} for the first argument
+ * and {@link #createMainSyncExecutor(Instrumentation)}, so that the test thread can directly
+ * run the tasks in the background, then have the onPostExecute methods happen on the main ui
+ * thread.
+ */
+ public void runAllBackgroundTasks(Executor doInBackgroundExecutor,
+ final Executor onPostExecuteExecutor) {
+ for (final BackgroundTask task : getSubmittedTasks()) {
+ final Object visibilityLock = new Object();
+ doInBackgroundExecutor.execute(new Runnable() {
+ @Override
+ public void run() {
+ synchronized (visibilityLock) {
+ task.doInBackground();
+ }
+ onPostExecuteExecutor.execute(new Runnable() {
+ @Override
+ public void run() {
+ synchronized (visibilityLock) {
+ task.onPostExecute();
+ }
+ }
+ });
+ }
+ });
+ }
+ }
+}