Merge change 26115 into eclair
* changes:
Change to use depressed chiclet when showing diambig resolve list. Fixes bug # 2093651
diff --git a/res/drawable-finger/btn_dial_voicemail.xml b/res/drawable-finger/btn_dial_voicemail.xml
new file mode 100644
index 0000000..8669f0f
--- /dev/null
+++ b/res/drawable-finger/btn_dial_voicemail.xml
@@ -0,0 +1,32 @@
+<?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.
+-->
+
+<!-- Background resource for dial voicemail button for the various 12 key dialers. -->
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <!-- Disabled views -->
+ <item android:state_focused="true" android:state_enabled="false"
+ android:drawable="@drawable/btn_dial_action_left_disable_focused" />
+ <item android:state_enabled="false"
+ android:drawable="@drawable/btn_dial_action_left_disable" />
+
+ <!-- Enabled views -->
+ <item android:state_pressed="true" android:state_enabled="true"
+ android:drawable="@drawable/btn_dial_action_left_pressed" />
+ <item android:state_focused="true" android:state_enabled="true"
+ android:drawable="@drawable/btn_dial_action_left_selected" />
+ <item android:state_enabled="true"
+ android:drawable="@drawable/btn_dial_action_left_normal" />
+</selector>
diff --git a/res/drawable-hdpi-finger/btn_dial_action_left_disable.9.png b/res/drawable-hdpi-finger/btn_dial_action_left_disable.9.png
new file mode 100755
index 0000000..7ba8672
--- /dev/null
+++ b/res/drawable-hdpi-finger/btn_dial_action_left_disable.9.png
Binary files differ
diff --git a/res/drawable-hdpi-finger/btn_dial_action_left_disable_focused.9.png b/res/drawable-hdpi-finger/btn_dial_action_left_disable_focused.9.png
new file mode 100755
index 0000000..b4300b6
--- /dev/null
+++ b/res/drawable-hdpi-finger/btn_dial_action_left_disable_focused.9.png
Binary files differ
diff --git a/res/drawable-hdpi-finger/btn_dial_action_left_normal.9.png b/res/drawable-hdpi-finger/btn_dial_action_left_normal.9.png
new file mode 100755
index 0000000..7ba8672
--- /dev/null
+++ b/res/drawable-hdpi-finger/btn_dial_action_left_normal.9.png
Binary files differ
diff --git a/res/drawable-hdpi-finger/btn_dial_action_left_pressed.9.png b/res/drawable-hdpi-finger/btn_dial_action_left_pressed.9.png
new file mode 100755
index 0000000..1dc40b7
--- /dev/null
+++ b/res/drawable-hdpi-finger/btn_dial_action_left_pressed.9.png
Binary files differ
diff --git a/res/drawable-hdpi-finger/btn_dial_action_left_selected.9.png b/res/drawable-hdpi-finger/btn_dial_action_left_selected.9.png
new file mode 100755
index 0000000..4f6c7cf
--- /dev/null
+++ b/res/drawable-hdpi-finger/btn_dial_action_left_selected.9.png
Binary files differ
diff --git a/res/drawable-hdpi-finger/ic_dial_action_voice_mail.png b/res/drawable-hdpi-finger/ic_dial_action_voice_mail.png
new file mode 100755
index 0000000..8a3f366
--- /dev/null
+++ b/res/drawable-hdpi-finger/ic_dial_action_voice_mail.png
Binary files differ
diff --git a/res/drawable-mdpi-finger/btn_dial_action_left_disable.9.png b/res/drawable-mdpi-finger/btn_dial_action_left_disable.9.png
new file mode 100755
index 0000000..6ab27d8
--- /dev/null
+++ b/res/drawable-mdpi-finger/btn_dial_action_left_disable.9.png
Binary files differ
diff --git a/res/drawable-mdpi-finger/btn_dial_action_left_disable_focused.9.png b/res/drawable-mdpi-finger/btn_dial_action_left_disable_focused.9.png
new file mode 100755
index 0000000..5bba3c4
--- /dev/null
+++ b/res/drawable-mdpi-finger/btn_dial_action_left_disable_focused.9.png
Binary files differ
diff --git a/res/drawable-mdpi-finger/btn_dial_action_left_normal.9.png b/res/drawable-mdpi-finger/btn_dial_action_left_normal.9.png
new file mode 100755
index 0000000..6ab27d8
--- /dev/null
+++ b/res/drawable-mdpi-finger/btn_dial_action_left_normal.9.png
Binary files differ
diff --git a/res/drawable-mdpi-finger/btn_dial_action_left_pressed.9.png b/res/drawable-mdpi-finger/btn_dial_action_left_pressed.9.png
new file mode 100755
index 0000000..542abe7
--- /dev/null
+++ b/res/drawable-mdpi-finger/btn_dial_action_left_pressed.9.png
Binary files differ
diff --git a/res/drawable-mdpi-finger/btn_dial_action_left_selected.9.png b/res/drawable-mdpi-finger/btn_dial_action_left_selected.9.png
new file mode 100755
index 0000000..34caba1
--- /dev/null
+++ b/res/drawable-mdpi-finger/btn_dial_action_left_selected.9.png
Binary files differ
diff --git a/res/drawable-mdpi-finger/ic_dial_action_voice_mail.png b/res/drawable-mdpi-finger/ic_dial_action_voice_mail.png
new file mode 100755
index 0000000..cb07d1a
--- /dev/null
+++ b/res/drawable-mdpi-finger/ic_dial_action_voice_mail.png
Binary files differ
diff --git a/res/layout-finger/contacts_list_item_photo.xml b/res/layout-finger/contacts_list_item_photo.xml
index 0330534..9f762ab 100644
--- a/res/layout-finger/contacts_list_item_photo.xml
+++ b/res/layout-finger/contacts_list_item_photo.xml
@@ -50,7 +50,7 @@
android:gravity="center"
android:scaleType="centerInside"
/>
-
+
<android.widget.FasttrackBadgeWidget android:id="@+id/photo"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
@@ -58,6 +58,14 @@
style="@*android:style/Widget.FasttrackBadgeWidget.WindowMedium" />
/>
+ <ImageView android:id="@+id/noFastTrackphoto"
+ android:layout_alignParentLeft="true"
+ android:layout_centerVertical="true"
+ android:layout_marginRight="8dip"
+ style="@*android:style/Widget.FasttrackBadgeWidget.WindowMedium"
+ android:background="@null" />
+ />
+
<TextView android:id="@+id/label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
diff --git a/res/layout-finger/twelve_key_dialer.xml b/res/layout-finger/twelve_key_dialer.xml
index b350f4f..c904deb 100644
--- a/res/layout-finger/twelve_key_dialer.xml
+++ b/res/layout-finger/twelve_key_dialer.xml
@@ -63,15 +63,24 @@
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_gravity="center_horizontal"
- android:layout_marginBottom="7dip"
+ android:layout_marginBottom="6dip"
android:orientation="horizontal">
+ <!-- Onscreen "Voicemail" button -->
+ <ImageButton android:id="@+id/voicemailButton"
+ android:layout_width="90dip"
+ android:layout_height="52dip"
+ android:layout_gravity="center_vertical"
+ android:state_enabled="false"
+ android:background="@drawable/btn_dial_voicemail"
+ android:src="@drawable/ic_dial_action_voice_mail" />
+
<!-- Onscreen "Dial" button, used on all platforms by
default. Its usage can be disabled using resources (see
config.xml.) -->
<ImageButton android:id="@+id/dialButton"
android:layout_width="116dip"
- android:layout_height="50dip"
+ android:layout_height="52dip"
android:layout_gravity="center_vertical"
android:state_enabled="false"
android:background="@drawable/btn_dial_action"
diff --git a/res/layout-land-finger/twelve_key_dialer.xml b/res/layout-land-finger/twelve_key_dialer.xml
index 2978799..9547ed5 100644
--- a/res/layout-land-finger/twelve_key_dialer.xml
+++ b/res/layout-land-finger/twelve_key_dialer.xml
@@ -64,15 +64,24 @@
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_gravity="center_horizontal"
- android:layout_marginBottom="7dip"
+ android:layout_marginBottom="6dip"
android:orientation="horizontal">
+ <!-- Onscreen "Voicemail" button -->
+ <ImageButton android:id="@+id/voicemailButton"
+ android:layout_width="90dip"
+ android:layout_height="52dip"
+ android:layout_gravity="center_vertical"
+ android:state_enabled="false"
+ android:background="@drawable/btn_dial_voicemail"
+ android:src="@drawable/ic_dial_action_voice_mail" />
+
<!-- Onscreen "Dial" button, used on all platforms by
default. Its usage can be disabled using resources (see
config.xml.) -->
<ImageButton android:id="@+id/dialButton"
android:layout_width="116dip"
- android:layout_height="50dip"
+ android:layout_height="52dip"
android:layout_gravity="center_vertical"
android:state_enabled="false"
android:background="@drawable/btn_dial_action"
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 43c1c82..4de02ba 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -29,11 +29,11 @@
<!-- Name of activity that allows users to create shortcuts on the home screen to dial a contact.
This shows up in a list of things like bookmark, folder, music playlist, etc -->
- <string name="shortcutDialContact">Direct Dial</string>
+ <string name="shortcutDialContact">Direct dial</string>
<!-- Name of activity that allows users to create shortcuts on the home screen to message (SMS) a contact.
This shows up in a list of things like bookmark, folder, music playlist, etc -->
- <string name="shortcutMessageContact">Direct Message</string>
+ <string name="shortcutMessageContact">Direct message</string>
<!-- Activity title when the user is selecting a contact for a shortcut. -->
<string name="shortcutActivityTitle">Choose a contact shortcut</string>
@@ -336,7 +336,7 @@
<string name="syncAllGroups">Sync all contacts</string>
<!-- The name of the system "My Contacts" group. This should be kept in sync with the web UI -->
- <string name="groupNameMyContacts">My Contacts</string>
+ <string name="groupNameMyContacts">My contacts</string>
<!-- The group type that displays only contacts with phone numbers -->
<string name="groupNameWithPhones">Contacts with phone numbers</string>
@@ -363,7 +363,7 @@
<string name="listSeparatorCallNumber_edit">Phone numbers</string>
<!-- Separator in the contact details list describing that the items below it will send an SMS/MMS to a phone number -->
- <string name="listSeparatorSendSmsMms">Send Text</string>
+ <string name="listSeparatorSendSmsMms">Send text</string>
<!-- Separator in the contact details list describing that the items below it will send an email -->
<string name="listSeparatorSendEmail">Send email</string>
@@ -417,7 +417,7 @@
<string name="liveFolderPhone">Contacts with phone numbers</string>
<!-- Menu item used to send an SMS or MMS message to a phone number -->
- <string name="menu_sendTextMessage">Send Text message</string>
+ <string name="menu_sendTextMessage">Send text message</string>
<!-- Menu item used to call a contact from the call log -->
<string name="recentCalls_callNumber">Call <xliff:g id="name">%s</xliff:g></string>
@@ -477,35 +477,35 @@
<!-- Displayed full screen when the user has no contacts and they are displaying the My Contacts group, and contact syncing is disabled -->
- <string name="noContactsHelpText">"You don't have any contacts.\n\nTo add contacts, press <font fgcolor="#ffffffff"><b>Menu</b></font> and select:\n
+ <string name="noContactsHelpText">"You don't have any contacts.\n\nTo add contacts, press <font fgcolor="#ffffffff"><b>Menu</b></font> and touch:\n
\n<li><font fgcolor="#ffffffff"><b>New contact</b></font> to create a new contact from scratch\n</li>
- \n<li><font fgcolor="#ffffffff"><b>Import contacts</b></font> to add contacts from your SIM card\n</li>"
+ \n<li><font fgcolor="#ffffffff"><b>Import/Export</b></font>\n</li>"
</string>
<!-- Displayed full screen when the user has no contacts and they are displaying the My Contacts group, and contact syncing is enabled -->
- <string name="noContactsHelpTextWithSync">"You don't have any contacts.\n\nTo add contacts, press <font fgcolor="#ffffffff"><b>Menu</b></font> and select:\n
- \n<li><font fgcolor="#ffffffff"><b>Display groups</b></font> to select contact groups to make visible\n</li>
+ <string name="noContactsHelpTextWithSync">"You don't have any contacts.\n\nTo add contacts, press <font fgcolor="#ffffffff"><b>Menu</b></font> and touch:\n
+ \n<li><font fgcolor="#ffffffff"><b>Display groups</b></font> to change which contact groups are visible\n</li>
\n<li><font fgcolor="#ffffffff"><b>New contact</b></font> to create a new contact from scratch\n</li>
- \n<li><font fgcolor="#ffffffff"><b>Import contacts</b></font> to add contacts from your SIM card\n</li>"
+ \n<li><font fgcolor="#ffffffff"><b>Import/Export</b></font>\n</li>"
</string>
<!-- Displayed full screen when the user has no contacts and they are displaying the My Contacts group, and contact syncing is disabled, and there is no sim card (cdma)-->
- <string name="noContactsNoSimHelpText">"You don't have any contacts.\n\nTo add contacts, press <font fgcolor="#ffffffff"><b>Menu</b></font> and select:\n
+ <string name="noContactsNoSimHelpText">"You don't have any contacts.\n\nTo add contacts, press <font fgcolor="#ffffffff"><b>Menu</b></font> and touch:\n
\n<li><font fgcolor="#ffffffff"><b>New contact</b></font> to create a new contact from scratch\n</li>
- \n<li><font fgcolor="#ffffffff"><b>Import contacts</b></font> to add contacts from your SD card\n</li>"
+ \n<li><font fgcolor="#ffffffff"><b>Import/Export</b></font>\n</li>"
</string>
<!-- Displayed full screen when the user has no contacts and they are displaying the My Contacts group, and contact syncing is enabled, and there is no sim card (cdma) -->
- <string name="noContactsNoSimHelpTextWithSync">"You don't have any contacts.\n\nTo add contacts, press <font fgcolor="#ffffffff"><b>Menu</b></font> and select:\n
- \n<li><font fgcolor="#ffffffff"><b>Display groups</b></font> to select contact groups to make visible\n</li>
+ <string name="noContactsNoSimHelpTextWithSync">"You don't have any contacts.\n\nTo add contacts, press <font fgcolor="#ffffffff"><b>Menu</b></font> and touch:\n
+ \n<li><font fgcolor="#ffffffff"><b>Display groups</b></font> to change which contact groups are visible\n</li>
\n<li><font fgcolor="#ffffffff"><b>New contact</b></font> to create a new contact from scratch\n</li>
- \n<li><font fgcolor="#ffffffff"><b>Import contacts</b></font> to add contacts from your SD card\n</li>"
+ \n<li><font fgcolor="#ffffffff"><b>Import/Export</b></font>\n</li>"
</string>
<!-- Displayed full screen when the user has no favorites and they are displaying the favorites tab -->
<string name="noFavoritesHelpText">"You don't have any favorites.\n
\nTo add a contact to your list of favorites:\n
- \n<li>Touch Contacts\n</li>
+ \n<li>Touch the Contacts tab\n</li>
\n<li>Touch the contact you want to add to your favorites\n</li>
\n<li>Touch the star next to the contact\'s name\n</li>"
</string>
@@ -514,7 +514,7 @@
<string name="seclectSyncGroups_title">Select groups to sync</string>
<!-- Live folder label for all contacts -->
- <string name="liveFolder_all_label">All Contacts</string>
+ <string name="liveFolder_all_label">All contacts</string>
<!-- Live folder label for only starred contacts -->
<string name="liveFolder_favorites_label">Starred</string>
@@ -613,7 +613,7 @@
<string name="favoritesFrquentSeparator">Frequently called</string>
<!-- Dialog title when prompting before creating a contact -->
- <string name="add_contact_dlg_title">Add Contact</string>
+ <string name="add_contact_dlg_title">Add contact</string>
<!-- Dialog message when prompting before creating a contact. Includes
the email address, e.g. "Add xyz@foo.com to contacts?" -->
<string name="add_contact_dlg_message_fmt">Add \"<xliff:g id="email">%s</xliff:g>\" to contacts?</string>
@@ -708,13 +708,13 @@
<string name="description_image_button_pound">pound</string>
<!-- Dialog title shown when SD Card does not exist -->
- <string name="no_sdcard_title">No SD Card</string>
+ <string name="no_sdcard_title">No SD card</string>
<!-- Dialog message shown when SDcard does not exist -->
- <string name="no_sdcard_message">No SD Card detected</string>
+ <string name="no_sdcard_message">No SD card detected</string>
<!-- Dialog title shown when searching VCard data from SD Card -->
- <string name="searching_vcard_title">Searching for VCard</string>
+ <string name="searching_vcard_title">Searching for vCard</string>
<!-- Dialog title shown when asking a user whether import contact data from SIM or SD Card -->
<string name="select_import_type_title">Where would you like to import contacts from?</string>
@@ -738,37 +738,37 @@
<string name="import_all_vcard_string">Import all vCard files</string>
<!-- Dialog message shown when searching VCard data from SD Card -->
- <string name="searching_vcard_message">Searching for VCard data on VCard</string>
+ <string name="searching_vcard_message">Searching for vCard data on SD card</string>
<!-- Dialog title shown when searching VCard data failed. -->
- <string name="scanning_sdcard_failed_title">Scanning SD Card failed</string>
+ <string name="scanning_sdcard_failed_title">Scanning SD card failed</string>
<!-- Dialog message shown when searching VCard data failed. -->
- <string name="scanning_sdcard_failed_message">Scanning SD Card failed</string>
+ <string name="scanning_sdcard_failed_message">Scanning SD card failed</string>
<!-- The failed reason: "I/O Error" -->
<string name="fail_reason_io_error">I/O Error (Reason: \"<xliff:g id="fail_reason">%s</xliff:g>\")</string>
<!-- The failed reason: "Failed to parse VCard data" -->
- <string name="fail_reason_vcard_parse_error">Failed to parse VCard with some unexpected reason</string>
+ <string name="fail_reason_vcard_parse_error">Failed to parse vCard for unexpected reason</string>
<!-- The failed reason: "The VCard is not supported right now, but may be supported in the future" -->
- <string name="fail_reason_vcard_not_supported_error">Failed to parse VCard though it seems in valid format, since the current implementation does not support it</string>
+ <string name="fail_reason_vcard_not_supported_error">Failed to parse vCard though it seems in valid format, since the current implementation does not support it</string>
<!-- The failed reason: "There is no VCard file" -->
- <string name="fail_reason_no_vcard_file">No VCard file found on SD Card</string>
+ <string name="fail_reason_no_vcard_file">No vCard file found on SD dard</string>
<!-- The failed reason: "There is no valid VCard entry in the file(s)" -->
- <string name="fail_reason_no_vcard_entry">No valid VCard entry found for your selection</string>
+ <string name="fail_reason_no_vcard_entry">No valid vCard entry found for your selection</string>
<!-- The failed reason: "One or more files failed to be imported. (<a list of file names>)" -->
<string name="fail_reason_failed_to_read_files">One or more files failed to be imported (%s).</string>
<!-- Dialog title shown when a user is asked to select VCard file -->
- <string name="select_vcard_title">Select VCard file</string>
+ <string name="select_vcard_title">Select vCard file</string>
<!-- Dialog message shown when a user is asked to choose VCard file -->
- <string name="select_vcard_message">Please select a VCard file to import</string>
+ <string name="select_vcard_message">Please select a vCard file to import</string>
<!-- The message shown while reading a vCard file/entry. The first argument is like
"Reading VCard" or "Reading VCard files" and the second is the display name of the current
@@ -776,19 +776,19 @@
<string name="progress_shower_message"><xliff:g id="action" example="Reading VCard">%s</xliff:g>\n<xliff:g id="filename" example="foo.vcf">%s</xliff:g></string>
<!-- Dialog title shown when reading VCard data -->
- <string name="reading_vcard_title">Reading VCard</string>
+ <string name="reading_vcard_title">Reading vCard</string>
<!-- Dialog message shown when reading a VCard file -->
- <string name="reading_vcard_message">Reading VCard file(s)</string>
+ <string name="reading_vcard_message">Reading vCard file(s)</string>
<!-- Dialog message shown when importing VCard data into local database -->
- <string name="importing_vcard_message">Importing VCard data</string>
+ <string name="importing_vcard_message">Importing vCard data</string>
<!-- Dialog title shown when reading VCard data failed -->
- <string name="reading_vcard_failed_title">Reading of VCard data has failed</string>
+ <string name="reading_vcard_failed_title">Reading of vCard data has failed</string>
<!-- Dialog message shown when reading VCard data failed -->
- <string name="reading_vcard_failed_message">VCard data could not be read\nReason for failure: \"<xliff:g id="fail_reason">%s</xliff:g>\"</string>
+ <string name="reading_vcard_failed_message">Could not read vCard.\nReason for failure: \"<xliff:g id="fail_reason">%s</xliff:g>\"</string>
<!-- Message while reading one vCard file "(current number) of (total number) contacts" The order of "current number" and "total number" cannot be changed (like "total: (total number), current: (current number)")-->
<string name="reading_vcard_contacts"><xliff:g id="current_number">%s</xliff:g> of <xliff:g id="total_number">%s</xliff:g> contacts</string>
@@ -800,22 +800,22 @@
<string name="export_contact_list">Export contacts</string>
<!-- Dialog title shown when a user confirms whether he/she export Contact data -->
- <string name="confirm_export_title">Confirmation for export</string>
+ <string name="confirm_export_title">Confirm export</string>
<!-- Dialog message shown when a user confirms whether he/she export Contact data -->
- <string name="confirm_export_message">Is it ok to export your contact list to \"<xliff:g id="vcard_filename">%s</xliff:g>\"?</string>
+ <string name="confirm_export_message">Are you sure you want to export your contact list to \"<xliff:g id="vcard_filename">%s</xliff:g>\"?</string>
<!-- Dialog title shown when exporting Contact data failed -->
- <string name="exporting_contact_failed_title">Exporting contact data has failed</string>
+ <string name="exporting_contact_failed_title">Failed to export contact data</string>
<!-- Dialog message shown when exporting Contact data failed -->
- <string name="exporting_contact_failed_message">Exporting contact data has failed\nReason for failure: \"<xliff:g id="fail_reason">%s</xliff:g>\"</string>
+ <string name="exporting_contact_failed_message">Failed to export contact data.\nReason for failure: \"<xliff:g id="fail_reason">%s</xliff:g>\"</string>
<!-- The failed reason: "Too many vcard files on the SD Card" -->
- <string name="fail_reason_too_many_vcard">Too many VCard data on the SD Card</string>
+ <string name="fail_reason_too_many_vcard">Too many vCard files on the SD card</string>
<!-- The failed reason: "Too long filename". This error usually does not happen. -->
- <string name="fail_reason_too_long_filename">Too long filename is required (\"<xliff:g id="filename">%s</xliff:g>\")</string>
+ <string name="fail_reason_too_long_filename">Required filename is too long (\"<xliff:g id="filename">%s</xliff:g>\")</string>
<!-- The failed reason: "Cannot open or create the destination directory" -->
<string name="fail_reason_cannot_open_destination_dir">Cannot open or create the destination directory\"<xliff:g id="dir_name">%s</xliff:g>\"</string>
@@ -842,8 +842,8 @@
<string name="search_settings_description">Names of your contacts</string>
<!-- Menu items for dialpad options as part of Pause and Wait ftr -->
- <string name="add_2sec_pause">Add 2-sec Pause</string>
- <string name="add_wait">Add Wait</string>
+ <string name="add_2sec_pause">Add 2-sec pause</string>
+ <string name="add_wait">Add wait</string>
<!-- Label for onscreen "Dial" button -->
<string name="dial_button_label">Dial</string>
diff --git a/src/com/android/contacts/ContactsListActivity.java b/src/com/android/contacts/ContactsListActivity.java
index 6354aa0..dc5f8f8 100644
--- a/src/com/android/contacts/ContactsListActivity.java
+++ b/src/com/android/contacts/ContactsListActivity.java
@@ -16,6 +16,14 @@
package com.android.contacts;
+import com.android.contacts.model.ContactsSource;
+import com.android.contacts.model.Sources;
+import com.android.contacts.model.ContactsSource.DataKind;
+import com.android.contacts.model.ContactsSource.EditType;
+import com.android.contacts.ui.DisplayGroupsActivity;
+import com.android.contacts.ui.DisplayGroupsActivity.Prefs;
+import com.android.contacts.util.Constants;
+
import android.accounts.Account;
import android.app.Activity;
import android.app.AlertDialog;
@@ -95,14 +103,6 @@
import android.widget.TextView;
import android.widget.AbsListView.OnScrollListener;
-import com.android.contacts.model.ContactsSource;
-import com.android.contacts.model.Sources;
-import com.android.contacts.model.ContactsSource.DataKind;
-import com.android.contacts.model.ContactsSource.EditType;
-import com.android.contacts.ui.DisplayGroupsActivity;
-import com.android.contacts.ui.DisplayGroupsActivity.Prefs;
-import com.android.contacts.util.Constants;
-
import java.lang.ref.SoftReference;
import java.lang.ref.WeakReference;
import java.util.HashMap;
@@ -174,6 +174,8 @@
static final int MODE_MASK_NO_DATA = 0x04000000;
/** Mask for showing a call button in the list */
static final int MODE_MASK_SHOW_CALL_BUTTON = 0x02000000;
+ /** Mask to disable fasttrack (images will show as normal images) */
+ static final int MODE_MASK_DISABLE_FASTTRACK = 0x01000000;
/** Unknown mode */
static final int MODE_UNKNOWN = 0;
@@ -188,13 +190,17 @@
/** Show starred and the frequent */
static final int MODE_STREQUENT = 35 | MODE_MASK_SHOW_PHOTOS | MODE_MASK_SHOW_CALL_BUTTON;
/** Show all contacts and pick them when clicking */
- static final int MODE_PICK_CONTACT = 40 | MODE_MASK_PICKER | MODE_MASK_SHOW_PHOTOS;
+ static final int MODE_PICK_CONTACT = 40 | MODE_MASK_PICKER | MODE_MASK_SHOW_PHOTOS
+ | MODE_MASK_DISABLE_FASTTRACK;
/** Show all contacts as well as the option to create a new one */
- static final int MODE_PICK_OR_CREATE_CONTACT = 42 | MODE_MASK_PICKER | MODE_MASK_CREATE_NEW;
+ static final int MODE_PICK_OR_CREATE_CONTACT = 42 | MODE_MASK_PICKER | MODE_MASK_CREATE_NEW
+ | MODE_MASK_SHOW_PHOTOS | MODE_MASK_DISABLE_FASTTRACK;
/** Show all people through the legacy provider and pick them when clicking */
- static final int MODE_LEGACY_PICK_PERSON = 43 | MODE_MASK_PICKER;
+ static final int MODE_LEGACY_PICK_PERSON = 43 | MODE_MASK_PICKER | MODE_MASK_SHOW_PHOTOS
+ | MODE_MASK_DISABLE_FASTTRACK;
/** Show all people through the legacy provider as well as the option to create a new one */
- static final int MODE_LEGACY_PICK_OR_CREATE_PERSON = 44 | MODE_MASK_PICKER | MODE_MASK_CREATE_NEW;
+ static final int MODE_LEGACY_PICK_OR_CREATE_PERSON = 44 | MODE_MASK_PICKER | MODE_MASK_CREATE_NEW
+ | MODE_MASK_SHOW_PHOTOS | MODE_MASK_DISABLE_FASTTRACK;
/** Show all contacts and pick them when clicking, and allow creating a new contact */
static final int MODE_INSERT_OR_EDIT_CONTACT = 45 | MODE_MASK_PICKER | MODE_MASK_CREATE_NEW;
/** Show all phone numbers and pick them when clicking */
@@ -216,7 +222,7 @@
/** Show join suggestions followed by an A-Z list */
static final int MODE_JOIN_CONTACT = 70 | MODE_MASK_PICKER | MODE_MASK_NO_PRESENCE
- | MODE_MASK_NO_DATA | MODE_MASK_SHOW_PHOTOS;
+ | MODE_MASK_NO_DATA | MODE_MASK_SHOW_PHOTOS | MODE_MASK_DISABLE_FASTTRACK;
/** Maximum number of suggestions shown for joining aggregates */
static final int MAX_SUGGESTIONS = 4;
@@ -1131,7 +1137,8 @@
if (position == 0) {
intent = new Intent(Intent.ACTION_INSERT, Contacts.CONTENT_URI);
} else {
- // Edit
+ // Edit. adjusting position by subtracting header view count.
+ position -= getListView().getHeaderViewsCount();
final Uri uri = getSelectedUri(position);
intent = new Intent(Intent.ACTION_EDIT, uri);
}
@@ -1898,6 +1905,7 @@
public CharArrayBuffer dataBuffer = new CharArrayBuffer(128);
public ImageView presenceView;
public FasttrackBadgeWidget photoView;
+ public ImageView nonFastTrackPhotoView;
}
final static class PhotoInfo {
@@ -2195,6 +2203,7 @@
cache.dataView = (TextView) view.findViewById(R.id.data);
cache.presenceView = (ImageView) view.findViewById(R.id.presence);
cache.photoView = (FasttrackBadgeWidget) view.findViewById(R.id.photo);
+ cache.nonFastTrackPhotoView = (ImageView) view.findViewById(R.id.noFastTrackphoto);
view.setTag(cache);
return view;
@@ -2261,22 +2270,34 @@
// Set the photo, if requested
if (mDisplayPhotos) {
+ boolean useFastTrack = (mMode & MODE_MASK_DISABLE_FASTTRACK) == 0;
long photoId = 0;
if (!cursor.isNull(SUMMARY_PHOTO_ID_COLUMN_INDEX)) {
photoId = cursor.getLong(SUMMARY_PHOTO_ID_COLUMN_INDEX);
}
- final int position = cursor.getPosition();
- cache.photoView.setTag(new PhotoInfo(position, photoId));
+ ImageView viewToUse;
+ if (useFastTrack) {
+ viewToUse = cache.photoView;
+ // Build soft lookup reference
+ final long contactId = cursor.getLong(SUMMARY_ID_COLUMN_INDEX);
+ final String lookupKey = cursor.getString(SUMMARY_LOOKUP_KEY);
+ cache.photoView.assignContactUri(Contacts.getLookupUri(contactId, lookupKey));
+ cache.photoView.setVisibility(View.VISIBLE);
+ cache.nonFastTrackPhotoView.setVisibility(View.INVISIBLE);
+ } else {
+ viewToUse = cache.nonFastTrackPhotoView;
+ cache.photoView.setVisibility(View.INVISIBLE);
+ cache.nonFastTrackPhotoView.setVisibility(View.VISIBLE);
+ }
- // Build soft lookup reference
- final long contactId = cursor.getLong(SUMMARY_ID_COLUMN_INDEX);
- final String lookupKey = cursor.getString(SUMMARY_LOOKUP_KEY);
- cache.photoView.assignContactUri(Contacts.getLookupUri(contactId, lookupKey));
+
+ final int position = cursor.getPosition();
+ viewToUse.setTag(new PhotoInfo(position, photoId));
if (photoId == 0) {
- cache.photoView.setImageResource(R.drawable.ic_contact_list_picture);
+ viewToUse.setImageResource(R.drawable.ic_contact_list_picture);
} else {
Bitmap photo = null;
@@ -2292,10 +2313,10 @@
// Bind the photo, or use the fallback no photo resource
if (photo != null) {
- cache.photoView.setImageBitmap(photo);
+ viewToUse.setImageBitmap(photo);
} else {
// Cache miss
- cache.photoView.setImageResource(R.drawable.ic_contact_list_picture);
+ viewToUse.setImageResource(R.drawable.ic_contact_list_picture);
// Add it to a set of images that are populated asynchronously.
mItemsMissingImages.add(cache.photoView);
@@ -2303,7 +2324,7 @@
if (mScrollState != OnScrollListener.SCROLL_STATE_FLING) {
// Scrolling is idle or slow, go get the image right now.
- sendFetchImageMessage(cache.photoView);
+ sendFetchImageMessage(viewToUse);
}
}
}
diff --git a/src/com/android/contacts/DialtactsActivity.java b/src/com/android/contacts/DialtactsActivity.java
index 2ba3d26..9fb5f41 100644
--- a/src/com/android/contacts/DialtactsActivity.java
+++ b/src/com/android/contacts/DialtactsActivity.java
@@ -16,24 +16,21 @@
package com.android.contacts;
+import com.android.internal.telephony.ITelephony;
+
import android.app.Activity;
import android.app.TabActivity;
import android.content.Intent;
import android.content.SharedPreferences;
-import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Bundle;
import android.os.RemoteException;
import android.os.ServiceManager;
-import android.provider.CallLog;
-import android.provider.Contacts;
import android.provider.CallLog.Calls;
-import android.provider.Contacts.Intents.UI;
+import android.provider.ContactsContract.Intents.UI;
import android.util.Log;
-import android.view.KeyEvent;
import android.view.Window;
import android.widget.TabHost;
-import com.android.internal.telephony.ITelephony;
/**
* The dialer activity that has one tab with the virtual 12key dialer,
@@ -83,7 +80,7 @@
setCurrentTab(intent);
- if (intent.getAction().equals(Contacts.Intents.UI.FILTER_CONTACTS_ACTION)
+ if (intent.getAction().equals(UI.FILTER_CONTACTS_ACTION)
&& icicle == null) {
setupFilterText(intent);
}
@@ -235,7 +232,7 @@
fixIntent(newIntent);
setCurrentTab(newIntent);
final String action = newIntent.getAction();
- if (action.equals(Contacts.Intents.UI.FILTER_CONTACTS_ACTION)) {
+ if (action.equals(UI.FILTER_CONTACTS_ACTION)) {
setupFilterText(newIntent);
} else if (isDialIntent(newIntent)) {
setupDialUri(newIntent);
@@ -282,7 +279,7 @@
if ((intent.getFlags() & Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY) != 0) {
return;
}
- String filter = intent.getStringExtra(Contacts.Intents.UI.FILTER_TEXT_EXTRA_KEY);
+ String filter = intent.getStringExtra(UI.FILTER_TEXT_EXTRA_KEY);
if (filter != null && filter.length() > 0) {
mFilterText = filter;
}
diff --git a/src/com/android/contacts/TwelveKeyDialer.java b/src/com/android/contacts/TwelveKeyDialer.java
index 2e88d89..2be677a 100644
--- a/src/com/android/contacts/TwelveKeyDialer.java
+++ b/src/com/android/contacts/TwelveKeyDialer.java
@@ -93,8 +93,9 @@
private Drawable mDeleteEmptyBackground;
private View mDigitsAndBackspace;
private View mDialpad;
- private View mDialButton;
private View mVoicemailDialAndBackspaceRow;
+ private View mVoicemailButton;
+ private View mDialButton;
private ListView mDialpadChooser;
private DialpadChooserAdapter mDialpadChooserAdapter;
//Member variables for dialpad options
@@ -204,6 +205,8 @@
mVoicemailDialAndBackspaceRow = findViewById(R.id.voicemailAndDialAndBackspace);
+ initVoicemailButton();
+
// Check whether we should show the onscreen "Dial" button.
mDialButton = mVoicemailDialAndBackspaceRow.findViewById(R.id.dialButton);
@@ -673,6 +676,11 @@
placeCall();
return;
}
+ case R.id.voicemailButton: {
+ callVoicemail();
+ vibrate();
+ return;
+ }
}
}
@@ -1047,6 +1055,25 @@
}
/**
+ * Check if voicemail is enabled/accessible.
+ */
+ private void initVoicemailButton() {
+ boolean hasVoicemail = false;
+ try {
+ hasVoicemail = TelephonyManager.getDefault().getVoiceMailNumber() != null;
+ } catch (SecurityException se) {
+ // Possibly no READ_PHONE_STATE privilege.
+ }
+
+ mVoicemailButton = mVoicemailDialAndBackspaceRow.findViewById(R.id.voicemailButton);
+ if (hasVoicemail) {
+ mVoicemailButton.setOnClickListener(this);
+ } else {
+ mVoicemailButton.setEnabled(false);
+ }
+ }
+
+ /**
* This function return true if Wait menu item can be shown
* otherwise returns false. Assumes the passed string is non-empty
* and the 0th index check is not required.
diff --git a/src/com/android/contacts/ui/EditContactActivity.java b/src/com/android/contacts/ui/EditContactActivity.java
index 843615a..6059e62 100644
--- a/src/com/android/contacts/ui/EditContactActivity.java
+++ b/src/com/android/contacts/ui/EditContactActivity.java
@@ -736,12 +736,17 @@
final ArrayList<Account> writable = sources.getAccounts(true);
+ // No Accounts available. Create a phone-local contact.
+ if (writable.isEmpty()) {
+ selectAccount(null);
+ return null; // Don't show a dialog.
+ }
+
// In the common case of a single account being writable, auto-select
// it without showing a dialog.
if (writable.size() == 1) {
selectAccount(writable.get(0));
- // Signal to not show a dialog:
- return null;
+ return null; // Don't show a dialog.
}
final ArrayAdapter<Account> accountAdapter = new ArrayAdapter<Account>(target,
@@ -802,6 +807,13 @@
return builder;
}
+ /**
+ * Sets up EditContactActivity's mState for the account selected.
+ * Runs from a background thread.
+ *
+ * @param account may be null to signal a device-local contact should
+ * be created.
+ */
private void selectAccount(Account account) {
EditContactActivity target = mTarget.get();
if (target == null) {
@@ -809,13 +821,19 @@
}
final Sources sources = Sources.getInstance(target);
final ContentValues values = new ContentValues();
- values.put(RawContacts.ACCOUNT_NAME, account.name);
- values.put(RawContacts.ACCOUNT_TYPE, account.type);
+ if (account != null) {
+ values.put(RawContacts.ACCOUNT_NAME, account.name);
+ values.put(RawContacts.ACCOUNT_TYPE, account.type);
+ } else {
+ values.putNull(RawContacts.ACCOUNT_NAME);
+ values.putNull(RawContacts.ACCOUNT_TYPE);
+ }
// Parse any values from incoming intent
final EntityDelta insert = new EntityDelta(ValuesDelta.fromAfter(values));
- final ContactsSource source = sources.getInflatedSource(account.type,
- ContactsSource.LEVEL_CONSTRAINTS);
+ final ContactsSource source = sources.getInflatedSource(
+ account != null ? account.type : null,
+ ContactsSource.LEVEL_CONSTRAINTS);
final Bundle extras = target.getIntent().getExtras();
EntityModifier.parseExtras(target, source, insert, extras);