Merge "Import revised translations."
diff --git a/res/drawable-sw580dp-hdpi/list_activated_holo.9.png b/res/drawable-sw580dp-hdpi/list_activated_holo.9.png
new file mode 100644
index 0000000..046b24a
--- /dev/null
+++ b/res/drawable-sw580dp-hdpi/list_activated_holo.9.png
Binary files differ
diff --git a/res/drawable-sw580dp-mdpi/list_activated_holo.9.png b/res/drawable-sw580dp-mdpi/list_activated_holo.9.png
new file mode 100644
index 0000000..1ff3373
--- /dev/null
+++ b/res/drawable-sw580dp-mdpi/list_activated_holo.9.png
Binary files differ
diff --git a/res/drawable-sw580dp-xhdpi/list_activated_holo.9.png b/res/drawable-sw580dp-xhdpi/list_activated_holo.9.png
new file mode 100644
index 0000000..2eb7c7e
--- /dev/null
+++ b/res/drawable-sw580dp-xhdpi/list_activated_holo.9.png
Binary files differ
diff --git a/res/layout/call_detail.xml b/res/layout/call_detail.xml
index c69f89f..076f37f 100644
--- a/res/layout/call_detail.xml
+++ b/res/layout/call_detail.xml
@@ -83,7 +83,7 @@
android:id="@+id/voicemail_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:paddingBottom="@dimen/call_log_icon_margin"
+ android:paddingBottom="@dimen/call_detail_button_spacing"
android:layout_below="@id/blue_separator"
android:background="@android:color/black"
>
@@ -135,7 +135,7 @@
<FrameLayout android:id="@+id/call_and_sms_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginBottom="@dimen/call_log_icon_margin"
+ android:layout_marginBottom="@dimen/call_detail_button_spacing"
android:layout_below="@id/voicemail_container"
android:background="@android:color/black"
>
diff --git a/res/layout/call_detail_history_header.xml b/res/layout/call_detail_history_header.xml
index 7fd7556..63c8673 100644
--- a/res/layout/call_detail_history_header.xml
+++ b/res/layout/call_detail_history_header.xml
@@ -48,8 +48,8 @@
<View
android:id="@+id/header_voicemail_container"
android:layout_width="match_parent"
- android:layout_height="142dip"
- android:layout_marginBottom="@dimen/call_log_icon_margin"
+ android:layout_height="140dip"
+ android:layout_marginBottom="@dimen/call_detail_button_spacing"
/>
<!-- Call and SMS -->
<View
diff --git a/res/layout/call_detail_history_item.xml b/res/layout/call_detail_history_item.xml
index fa5bc28..28a7da0 100644
--- a/res/layout/call_detail_history_item.xml
+++ b/res/layout/call_detail_history_item.xml
@@ -19,7 +19,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="@dimen/call_log_list_item_height"
- android:paddingTop="@dimen/call_log_icon_margin"
+ android:paddingTop="@dimen/call_log_inner_margin"
+ android:paddingBottom="@dimen/call_log_inner_margin"
android:paddingLeft="@dimen/call_log_indent_margin"
android:paddingRight="@dimen/call_log_outer_margin"
android:orientation="vertical"
diff --git a/res/layout/call_log_list_item.xml b/res/layout/call_log_list_item.xml
index 3458dd9..649dede 100644
--- a/res/layout/call_log_list_item.xml
+++ b/res/layout/call_log_list_item.xml
@@ -93,6 +93,7 @@
android:layout_height="match_parent"
android:layout_toRightOf="@id/quick_contact_photo"
android:layout_toLeftOf="@id/divider"
+ android:layout_alignWithParentIfMissing="true"
android:layout_centerVertical="true"
android:padding="@dimen/call_log_inner_margin"
android:orientation="vertical"
@@ -142,42 +143,29 @@
</LinearLayout>
</RelativeLayout>
- <LinearLayout
+ <TextView
android:id="@+id/call_log_header"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:paddingLeft="@dimen/call_log_outer_margin"
- android:paddingRight="@dimen/call_log_outer_margin"
+ style="?android:attr/listSeparatorTextViewStyle"
+ android:layout_marginLeft="@dimen/call_log_outer_margin"
+ android:layout_marginRight="@dimen/call_log_outer_margin"
android:paddingTop="@dimen/call_log_inner_margin"
android:paddingBottom="@dimen/call_log_inner_margin"
- android:orientation="vertical">
-
- <TextView
- android:id="@+id/call_log_header_text"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:paddingLeft="@dimen/call_log_inner_margin"
- android:paddingRight="@dimen/call_log_inner_margin"
- android:singleLine="true"
- android:ellipsize="end"
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:textStyle="bold"
- android:textColor="?attr/call_log_header_color"
- android:textAllCaps="true"
- android:focusable="true"
- />
- <View
- android:layout_width="match_parent"
- android:layout_height="2dip"
- android:background="@color/call_log_voicemail_highlight_color"/>
- </LinearLayout>
+ android:background="@drawable/list_section_divider_holo_custom"
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ android:textStyle="bold"
+ android:textColor="?attr/call_log_header_color"
+ android:textAllCaps="true"
+ android:singleLine="true"
+ android:ellipsize="end"
+ android:focusable="true"
+ />
<View
android:id="@+id/call_log_divider"
android:layout_width="match_parent"
android:layout_height="1px"
- android:layout_marginLeft="16dip"
- android:layout_marginRight="16dip"
- android:background="#1a1a1a"
+ android:layout_marginLeft="@dimen/call_log_outer_margin"
+ android:layout_marginRight="@dimen/call_log_outer_margin"
+ android:background="#55ffffff"
/>
</view>
diff --git a/res/layout/external_raw_contact_editor_view.xml b/res/layout/external_raw_contact_editor_view.xml
index a1e0754..f1ba198 100644
--- a/res/layout/external_raw_contact_editor_view.xml
+++ b/res/layout/external_raw_contact_editor_view.xml
@@ -40,8 +40,7 @@
android:singleLine="true"
android:ellipsize="end"
android:textAppearance="?android:attr/textAppearanceMedium"
- android:textColor="?android:attr/textColorSecondary"
- android:textStyle="bold"/>
+ android:textColor="?android:attr/textColorSecondary" />
<LinearLayout
android:id="@+id/stub_photo"
diff --git a/res/layout/item_read_only_field.xml b/res/layout/item_read_only_field.xml
index 5f8367f..2765cfa 100644
--- a/res/layout/item_read_only_field.xml
+++ b/res/layout/item_read_only_field.xml
@@ -24,28 +24,39 @@
android:id="@+id/kind_title_layout"
layout="@layout/edit_kind_title" />
+ <!-- Shown only when id/kind_title_layout is hidden, dividing a previous item and this item. -->
+ <View
+ android:id="@+id/divider"
+ android:layout_width="match_parent"
+ android:layout_height="1px"
+ android:layout_marginLeft="8dip"
+ android:layout_marginRight="8dip"
+ android:background="?android:attr/listDivider" />
+
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="@dimen/editor_min_line_item_height"
+ android:layout_marginLeft="16dip"
+ android:layout_marginRight="16dip"
android:orientation="horizontal">
<TextView
android:id="@+id/data"
- android:layout_width="wrap_content"
+ android:layout_width="0px"
android:layout_height="wrap_content"
+ android:layout_weight="1"
android:layout_gravity="center_vertical"
- android:layout_marginLeft="16dip"
android:textAppearance="?android:attr/textAppearanceMedium"
- android:textColor="?android:attr/textColorPrimary"
+ android:textColor="?android:attr/textColorSecondary"
android:singleLine="true"/>
<TextView
android:id="@+id/type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
- android:layout_marginLeft="8dip"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?android:attr/textColorSecondary"
+ android:textAllCaps="true"
android:singleLine="true"/>
</LinearLayout>
diff --git a/res/layout/playback_layout.xml b/res/layout/playback_layout.xml
index 161c5bd..efd45b8 100644
--- a/res/layout/playback_layout.xml
+++ b/res/layout/playback_layout.xml
@@ -16,7 +16,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="58dip"
- android:layout_marginRight="2dip"
+ android:layout_marginRight="@dimen/call_detail_button_spacing"
android:background="@drawable/dialpad_background"
android:layout_weight="1"
>
@@ -31,7 +31,6 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="58dip"
- android:layout_marginLeft="2dip"
android:background="@drawable/dialpad_background"
android:layout_weight="1"
>
@@ -50,7 +49,7 @@
android:layout_height="80dip"
android:background="@drawable/dialpad_background"
android:layout_below="@id/buttons_linear_layout"
- android:layout_marginTop="4dip"
+ android:layout_marginTop="@dimen/call_detail_button_spacing"
>
<!-- SeekBar left-right margin decreased from redlines 72dip by 8dip to account for
half thumb width (thumb is 16dip).
diff --git a/res/layout/stream_item_row_image_and_text.xml b/res/layout/stream_item_row_image_and_text.xml
index c5699f4..0ee6357 100644
--- a/res/layout/stream_item_row_image_and_text.xml
+++ b/res/layout/stream_item_row_image_and_text.xml
@@ -19,12 +19,13 @@
xmlns:ex="http://schemas.android.com/apk/res/com.android.contacts"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:layout_marginTop="@dimen/detail_update_section_between_items_padding"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginBottom="8dip"
+ android:layout_marginBottom="@dimen/detail_update_section_between_items_padding"
android:orientation="horizontal"
android:weightSum="2">
@@ -33,7 +34,7 @@
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
- android:layout_marginRight="@dimen/detail_update_section_between_items_horizontal_padding"
+ android:layout_marginRight="@dimen/detail_update_section_between_items_padding"
ex:ratio="1"
ex:direction="widthToHeight">
diff --git a/res/layout/stream_item_row_text_only.xml b/res/layout/stream_item_row_text_only.xml
index 919ee52..9d82edd 100644
--- a/res/layout/stream_item_row_text_only.xml
+++ b/res/layout/stream_item_row_text_only.xml
@@ -17,6 +17,7 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:layout_marginTop="@dimen/detail_update_section_between_items_padding"
android:orientation="vertical">
<TextView android:id="@+id/stream_item_html"
diff --git a/res/layout/stream_item_row_two_images.xml b/res/layout/stream_item_row_two_images.xml
index 3a524bf..7858f6f 100644
--- a/res/layout/stream_item_row_two_images.xml
+++ b/res/layout/stream_item_row_two_images.xml
@@ -18,13 +18,14 @@
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ex="http://schemas.android.com/apk/res/com.android.contacts"
android:layout_width="match_parent"
- android:layout_height="wrap_content">
+ android:layout_height="wrap_content"
+ android:layout_marginTop="@dimen/detail_update_section_between_items_padding">
<view
class="com.android.contacts.widget.ProportionalLayout"
android:layout_width="0dip"
android:layout_height="wrap_content"
- android:layout_marginRight="@dimen/detail_update_section_between_items_horizontal_padding"
+ android:layout_marginRight="@dimen/detail_update_section_between_items_padding"
android:layout_weight="1"
ex:ratio="1"
ex:direction="widthToHeight">
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 13bb791..f0ba3d5 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -116,8 +116,8 @@
<!-- Horizontal padding for individual stream items -->
<dimen name="detail_update_section_item_horizontal_padding">8dip</dimen>
- <!-- Horizontal padding between columns images and/or text in a single stream item -->
- <dimen name="detail_update_section_between_items_horizontal_padding">16dip</dimen>
+ <!-- Padding between columns images and/or text in a single stream item -->
+ <dimen name="detail_update_section_between_items_padding">1dip</dimen>
<!-- Horizontal padding between content sections within a stream item -->
<dimen name="detail_update_section_internal_padding">16dip</dimen>
@@ -249,9 +249,8 @@
<dimen name="call_log_indent_margin">24dip</dimen>
<dimen name="call_log_list_item_height">56dip</dimen>
<dimen name="call_log_list_contact_photo_size">64dip</dimen>
- <dimen name="call_detail_contact_background_height">174dip</dimen>
<dimen name="call_detail_contact_name_margin">24dip</dimen>
- <dimen name="call_detail_action_bar_height">60dip</dimen>
+ <dimen name="call_detail_button_spacing">2dip</dimen>
<!-- Empty message margins -->
<dimen name="empty_message_top_margin">48dip</dimen>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 43c4107..047c4aa 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -1796,8 +1796,9 @@
<!-- 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>
+ <!-- String describing the text on the header of the profile contact in the contacts list
+ This may be programatically capitalized. [CHAR LIMIT=20] -->
+ <string name="user_profile_contacts_list_header" msgid="9154761216179882405">Me</string>
<!-- Header label in the contact editor for a profile that is local to the device only (and not associated with any account) [CHAR LIMIT=25] -->
<string name="local_profile_title">My local profile</string>
@@ -1808,4 +1809,7 @@
<!-- Toast shown when the app starts showing all contacts regardless of its current
contact filter state. [CHAR LIMIT=64] -->
<string name="toast_displaying_all_contacts">Displaying all contacts</string>
+
+ <!-- Message in the standard "no account" prompt that encourages the user to add a Google account before continuing to use the People app [CHAR LIMIT=NONE] -->
+ <string name="no_account_prompt">People works better with a Google Account.\n\n\u2022 Access from any web browser.\n\u2022 Back up your contacts securely.</string>
</resources>
diff --git a/src/com/android/contacts/CallDetailActivity.java b/src/com/android/contacts/CallDetailActivity.java
index 0fadbfb..e008516 100644
--- a/src/com/android/contacts/CallDetailActivity.java
+++ b/src/com/android/contacts/CallDetailActivity.java
@@ -394,7 +394,7 @@
final Uri photoUri = firstDetails.photoUri;
// Set the details header, based on the first phone call.
- mPhoneCallDetailsHelper.setPhoneCallName(mHeaderTextView, firstDetails);
+ mPhoneCallDetailsHelper.setCallDetailsHeader(mHeaderTextView, firstDetails);
// Cache the details about the phone number.
final Uri numberCallUri = mPhoneNumberHelper.getCallUri(mNumber);
@@ -502,6 +502,7 @@
}
mHasEditNumberBeforeCall = canPlaceCallsTo && !isSipNumber && !isVoicemailNumber;
+ invalidateOptionsMenu();
ListView historyList = (ListView) findViewById(R.id.history);
historyList.setAdapter(
diff --git a/src/com/android/contacts/ContactLoader.java b/src/com/android/contacts/ContactLoader.java
index 0addb07..57defcf 100644
--- a/src/com/android/contacts/ContactLoader.java
+++ b/src/com/android/contacts/ContactLoader.java
@@ -1079,30 +1079,51 @@
}
// Now retrieve any photo records associated with the stream items.
- String[] streamItemIdArr = new String[streamItems.size()];
- StringBuilder streamItemPhotoSelection = new StringBuilder();
if (!streamItems.isEmpty()) {
- streamItemPhotoSelection.append(StreamItemPhotos.STREAM_ITEM_ID + " IN (");
- for (int i = 0; i < streamItems.size(); i++) {
- if (i > 0) {
- streamItemPhotoSelection.append(",");
+ if (result.isUserProfile()) {
+ // If the stream items we're loading are for the profile, we can't bulk-load the
+ // stream items with a custom selection.
+ for (StreamItemEntry entry : streamItems) {
+ Cursor siCursor = getContext().getContentResolver().query(
+ Uri.withAppendedPath(
+ ContentUris.withAppendedId(
+ StreamItems.CONTENT_URI, entry.getId()),
+ StreamItems.StreamItemPhotos.CONTENT_DIRECTORY),
+ null, null, null, null);
+ try {
+ while (siCursor.moveToNext()) {
+ entry.addPhoto(new StreamItemPhotoEntry(siCursor));
+ }
+ } finally {
+ siCursor.close();
+ }
}
- streamItemPhotoSelection.append("?");
- streamItemIdArr[i] = String.valueOf(streamItems.get(i).getId());
- }
- streamItemPhotoSelection.append(")");
- cursor = getContext().getContentResolver().query(StreamItems.CONTENT_PHOTO_URI,
- null, streamItemPhotoSelection.toString(), streamItemIdArr,
- StreamItemPhotos.STREAM_ITEM_ID);
- try {
- while (cursor.moveToNext()) {
- long streamItemId = cursor.getLong(
- cursor.getColumnIndex(StreamItemPhotos.STREAM_ITEM_ID));
- StreamItemEntry streamItem = streamItemsById.get(streamItemId);
- streamItem.addPhoto(new StreamItemPhotoEntry(cursor));
+ } else {
+ String[] streamItemIdArr = new String[streamItems.size()];
+ StringBuilder streamItemPhotoSelection = new StringBuilder();
+ streamItemPhotoSelection.append(StreamItemPhotos.STREAM_ITEM_ID + " IN (");
+ for (int i = 0; i < streamItems.size(); i++) {
+ if (i > 0) {
+ streamItemPhotoSelection.append(",");
+ }
+ streamItemPhotoSelection.append("?");
+ streamItemIdArr[i] = String.valueOf(streamItems.get(i).getId());
}
- } finally {
- cursor.close();
+ streamItemPhotoSelection.append(")");
+ Cursor sipCursor = getContext().getContentResolver().query(
+ StreamItems.CONTENT_PHOTO_URI,
+ null, streamItemPhotoSelection.toString(), streamItemIdArr,
+ StreamItemPhotos.STREAM_ITEM_ID);
+ try {
+ while (sipCursor.moveToNext()) {
+ long streamItemId = sipCursor.getLong(
+ sipCursor.getColumnIndex(StreamItemPhotos.STREAM_ITEM_ID));
+ StreamItemEntry streamItem = streamItemsById.get(streamItemId);
+ streamItem.addPhoto(new StreamItemPhotoEntry(sipCursor));
+ }
+ } finally {
+ sipCursor.close();
+ }
}
}
diff --git a/src/com/android/contacts/PhoneCallDetailsHelper.java b/src/com/android/contacts/PhoneCallDetailsHelper.java
index e79bdce..2d75c26 100644
--- a/src/com/android/contacts/PhoneCallDetailsHelper.java
+++ b/src/com/android/contacts/PhoneCallDetailsHelper.java
@@ -129,11 +129,12 @@
views.numberView.setText(numberText);
}
- /** Sets the name in the text view for the given phone call. */
- public void setPhoneCallName(TextView nameView, PhoneCallDetails details) {
+ /** Sets the text of the header view for the details page of a phone call. */
+ public void setCallDetailsHeader(TextView nameView, PhoneCallDetails details) {
final CharSequence nameText;
final CharSequence displayNumber =
- mPhoneNumberHelper.getDisplayNumber(details.number, details.formattedNumber);
+ mPhoneNumberHelper.getDisplayNumber(details.number,
+ mResources.getString(R.string.recentCalls_addToContact));
if (TextUtils.isEmpty(details.name)) {
nameText = displayNumber;
} else {
diff --git a/src/com/android/contacts/calllog/CallLogAdapter.java b/src/com/android/contacts/calllog/CallLogAdapter.java
index 604d528..bf1f857 100644
--- a/src/com/android/contacts/calllog/CallLogAdapter.java
+++ b/src/com/android/contacts/calllog/CallLogAdapter.java
@@ -542,7 +542,7 @@
|| section == CallLogQuery.SECTION_OLD_HEADER) {
views.listItemView.setVisibility(View.GONE);
views.bottomDivider.setVisibility(View.GONE);
- views.listHeaderView.setVisibility(View.VISIBLE);
+ views.listHeaderTextView.setVisibility(View.VISIBLE);
views.listHeaderTextView.setText(
section == CallLogQuery.SECTION_NEW_HEADER
? R.string.call_log_new_header
@@ -553,7 +553,7 @@
// Default case: an item in the call log.
views.listItemView.setVisibility(View.VISIBLE);
views.bottomDivider.setVisibility(isLastOfSection(c) ? View.GONE : View.VISIBLE);
- views.listHeaderView.setVisibility(View.GONE);
+ views.listHeaderTextView.setVisibility(View.GONE);
final String number = c.getString(CallLogQuery.NUMBER);
final long date = c.getLong(CallLogQuery.DATE);
diff --git a/src/com/android/contacts/calllog/CallLogListItemHelper.java b/src/com/android/contacts/calllog/CallLogListItemHelper.java
index 5951ea3..602c283 100644
--- a/src/com/android/contacts/calllog/CallLogListItemHelper.java
+++ b/src/com/android/contacts/calllog/CallLogListItemHelper.java
@@ -65,17 +65,14 @@
if (canPlay) {
// Playback action takes preference.
configurePlaySecondaryAction(views);
- views.unheardView.setVisibility(isHighlighted ? View.VISIBLE : View.GONE);
views.dividerView.setVisibility(View.VISIBLE);
} else if (canCall) {
// Call is the secondary action.
configureCallSecondaryAction(views);
- views.unheardView.setVisibility(View.GONE);
views.dividerView.setVisibility(View.VISIBLE);
} else {
// No action available.
views.secondaryActionView.setVisibility(View.GONE);
- views.unheardView.setVisibility(View.GONE);
views.dividerView.setVisibility(View.GONE);
}
}
diff --git a/src/com/android/contacts/calllog/CallLogListItemViews.java b/src/com/android/contacts/calllog/CallLogListItemViews.java
index 938b2e3..a2679e9 100644
--- a/src/com/android/contacts/calllog/CallLogListItemViews.java
+++ b/src/com/android/contacts/calllog/CallLogListItemViews.java
@@ -35,33 +35,27 @@
public final View primaryActionView;
/** The secondary action button on the entry. */
public final ImageView secondaryActionView;
- /** The icon used for unheard voicemail. */
- public final View unheardView;
/** The divider between the primary and secondary actions. */
public final View dividerView;
/** The details of the phone call. */
public final PhoneCallDetailsViews phoneCallDetailsViews;
/** The item view for a stand-alone row, or null for other types of rows. */
public final View listItemView;
- /** The header of a section. */
- public final View listHeaderView;
/** The text of the header of a section. */
public final TextView listHeaderTextView;
/** The divider to be shown below items. */
public final View bottomDivider;
private CallLogListItemViews(QuickContactBadge quickContactView, View primaryActionView,
- ImageView secondaryActionView, View unheardView, View dividerView,
+ ImageView secondaryActionView, View dividerView,
PhoneCallDetailsViews phoneCallDetailsViews, View listItemView,
- View listHeaderView, TextView listHeaderTextView, View bottomDivider) {
+ TextView listHeaderTextView, View bottomDivider) {
this.quickContactView = quickContactView;
this.primaryActionView = primaryActionView;
this.secondaryActionView = secondaryActionView;
- this.unheardView = unheardView;
this.dividerView = dividerView;
this.phoneCallDetailsViews = phoneCallDetailsViews;
this.listItemView = listItemView;
- this.listHeaderView = listHeaderView;
this.listHeaderTextView = listHeaderTextView;
this.bottomDivider = bottomDivider;
}
@@ -71,12 +65,10 @@
(QuickContactBadge) view.findViewById(R.id.quick_contact_photo),
view.findViewById(R.id.primary_action_view),
(ImageView) view.findViewById(R.id.secondary_action_icon),
- view.findViewById(R.id.unheard_icon),
view.findViewById(R.id.divider),
PhoneCallDetailsViews.fromView(view),
view.findViewById(R.id.call_log_item),
- view.findViewById(R.id.call_log_header),
- (TextView) view.findViewById(R.id.call_log_header_text),
+ (TextView) view.findViewById(R.id.call_log_header),
view.findViewById(R.id.call_log_divider));
}
@@ -86,10 +78,8 @@
new View(context),
new ImageView(context),
new View(context),
- new View(context),
PhoneCallDetailsViews.createForTest(context),
new View(context),
- new View(context),
new TextView(context),
new View(context));
}
diff --git a/src/com/android/contacts/editor/ExternalRawContactEditorView.java b/src/com/android/contacts/editor/ExternalRawContactEditorView.java
index 0a1ae74..9b4f988 100644
--- a/src/com/android/contacts/editor/ExternalRawContactEditorView.java
+++ b/src/com/android/contacts/editor/ExternalRawContactEditorView.java
@@ -252,12 +252,15 @@
private void bindData(
CharSequence titleText, CharSequence data, CharSequence type, boolean isFirstEntry) {
final View field = mInflater.inflate(R.layout.item_read_only_field, mGeneral, false);
+ final View divider = field.findViewById(R.id.divider);
if (isFirstEntry) {
final TextView titleView = (TextView) field.findViewById(R.id.kind_title);
titleView.setText(titleText);
+ divider.setVisibility(View.GONE);
} else {
View titleContainer = field.findViewById(R.id.kind_title_layout);
titleContainer.setVisibility(View.GONE);
+ divider.setVisibility(View.VISIBLE);
}
final TextView dataView = (TextView) field.findViewById(R.id.data);
dataView.setText(data);
diff --git a/src/com/android/contacts/list/ContactListItemView.java b/src/com/android/contacts/list/ContactListItemView.java
index 7e0940f..7e81dcd 100644
--- a/src/com/android/contacts/list/ContactListItemView.java
+++ b/src/com/android/contacts/list/ContactListItemView.java
@@ -673,6 +673,7 @@
mHeaderTextView.setText(title);
mHeaderTextView.setVisibility(View.VISIBLE);
mHeaderDivider.setVisibility(View.VISIBLE);
+ mHeaderTextView.setAllCaps(true);
mHeaderVisible = true;
} else {
if (mHeaderTextView != null) {
diff --git a/src/com/android/contacts/model/EntityDelta.java b/src/com/android/contacts/model/EntityDelta.java
index a045eb4..8244e9c 100644
--- a/src/com/android/contacts/model/EntityDelta.java
+++ b/src/com/android/contacts/model/EntityDelta.java
@@ -414,7 +414,14 @@
// Ignore children if parent was deleted
if (isContactDelete) continue;
- builder = child.buildDiff(Data.CONTENT_URI);
+ // Use the profile data URI if the contact is the profile.
+ if (mContactsQueryUri.equals(Profile.CONTENT_RAW_CONTACTS_URI)) {
+ builder = child.buildDiff(Uri.withAppendedPath(Profile.CONTENT_URI,
+ RawContacts.Data.CONTENT_DIRECTORY));
+ } else {
+ builder = child.buildDiff(Data.CONTENT_URI);
+ }
+
if (child.isInsert()) {
if (isContactInsert) {
// Parent is brand new insert, so back-reference _id
diff --git a/tests/src/com/android/contacts/PhoneCallDetailsHelperTest.java b/tests/src/com/android/contacts/PhoneCallDetailsHelperTest.java
index 7830a01..2dfd95a 100644
--- a/tests/src/com/android/contacts/PhoneCallDetailsHelperTest.java
+++ b/tests/src/com/android/contacts/PhoneCallDetailsHelperTest.java
@@ -201,14 +201,38 @@
setPhoneCallDetailsWithNumber(TEST_VOICEMAIL_NUMBER, "");
}
- public void testSetPhoneName_NumberOnly() {
- setPhoneCallNameWithNumberOnly();
+ public void testSetCallDetailsHeader_NumberOnly() {
+ setCallDetailsHeaderWithNumberOnly(TEST_NUMBER);
assertEquals(View.VISIBLE, mNameView.getVisibility());
- assertEquals(TEST_FORMATTED_NUMBER, mNameView.getText().toString());
+ assertEquals("Add to contacts", mNameView.getText().toString());
}
- public void testSetPhoneName() {
- setPhoneCallName("John Doe");
+ public void testSetCallDetailsHeader_UnknownNumber() {
+ setCallDetailsHeaderWithNumberOnly(CallerInfo.UNKNOWN_NUMBER);
+ assertEquals(View.VISIBLE, mNameView.getVisibility());
+ assertEquals("Unknown", mNameView.getText().toString());
+ }
+
+ public void testSetCallDetailsHeader_PrivateNumber() {
+ setCallDetailsHeaderWithNumberOnly(CallerInfo.PRIVATE_NUMBER);
+ assertEquals(View.VISIBLE, mNameView.getVisibility());
+ assertEquals("Private number", mNameView.getText().toString());
+ }
+
+ public void testSetCallDetailsHeader_PayphoneNumber() {
+ setCallDetailsHeaderWithNumberOnly(CallerInfo.PAYPHONE_NUMBER);
+ assertEquals(View.VISIBLE, mNameView.getVisibility());
+ assertEquals("Pay phone", mNameView.getText().toString());
+ }
+
+ public void testSetCallDetailsHeader_VoicemailNumber() {
+ setCallDetailsHeaderWithNumberOnly(TEST_VOICEMAIL_NUMBER);
+ assertEquals(View.VISIBLE, mNameView.getVisibility());
+ assertEquals("Voicemail", mNameView.getText().toString());
+ }
+
+ public void testSetCallDetailsHeader() {
+ setCallDetailsHeader("John Doe");
assertEquals(View.VISIBLE, mNameView.getVisibility());
assertEquals("John Doe", mNameView.getText().toString());
}
@@ -288,14 +312,14 @@
false);
}
- private void setPhoneCallNameWithNumberOnly() {
- mHelper.setPhoneCallName(mNameView,
- new PhoneCallDetails(TEST_NUMBER, TEST_FORMATTED_NUMBER, TEST_COUNTRY_ISO,
+ private void setCallDetailsHeaderWithNumberOnly(String number) {
+ mHelper.setCallDetailsHeader(mNameView,
+ new PhoneCallDetails(number, TEST_FORMATTED_NUMBER, TEST_COUNTRY_ISO,
TEST_GEOCODE, new int[]{ Calls.INCOMING_TYPE }, TEST_DATE, TEST_DURATION));
}
- private void setPhoneCallName(String name) {
- mHelper.setPhoneCallName(mNameView,
+ private void setCallDetailsHeader(String name) {
+ mHelper.setCallDetailsHeader(mNameView,
new PhoneCallDetails(TEST_NUMBER, TEST_FORMATTED_NUMBER, TEST_COUNTRY_ISO,
TEST_GEOCODE, new int[]{ Calls.INCOMING_TYPE }, TEST_DATE, TEST_DURATION,
name, 0, "", null, null));
diff --git a/tests/src/com/android/contacts/calllog/CallLogListItemHelperTest.java b/tests/src/com/android/contacts/calllog/CallLogListItemHelperTest.java
index 2c29608..ce3c14f 100644
--- a/tests/src/com/android/contacts/calllog/CallLogListItemHelperTest.java
+++ b/tests/src/com/android/contacts/calllog/CallLogListItemHelperTest.java
@@ -75,7 +75,6 @@
public void testSetPhoneCallDetails() {
setPhoneCallDetailsWithNumber("12125551234", "1-212-555-1234");
assertEquals(View.VISIBLE, mViews.secondaryActionView.getVisibility());
- assertEquals(View.GONE, mViews.unheardView.getVisibility());
}
public void testSetPhoneCallDetails_Unknown() {
@@ -96,32 +95,27 @@
public void testSetPhoneCallDetails_VoicemailNumber() {
setPhoneCallDetailsWithNumber(TEST_VOICEMAIL_NUMBER, TEST_VOICEMAIL_NUMBER);
assertEquals(View.VISIBLE, mViews.secondaryActionView.getVisibility());
- assertEquals(View.GONE, mViews.unheardView.getVisibility());
}
public void testSetPhoneCallDetails_ReadVoicemail() {
setPhoneCallDetailsWithTypes(Calls.VOICEMAIL_TYPE);
assertEquals(View.VISIBLE, mViews.secondaryActionView.getVisibility());
- assertEquals(View.GONE, mViews.unheardView.getVisibility());
}
public void testSetPhoneCallDetails_UnreadVoicemail() {
setUnreadPhoneCallDetailsWithTypes(Calls.VOICEMAIL_TYPE);
assertEquals(View.VISIBLE, mViews.secondaryActionView.getVisibility());
- assertEquals(View.VISIBLE, mViews.unheardView.getVisibility());
}
public void testSetPhoneCallDetails_VoicemailFromUnknown() {
setPhoneCallDetailsWithNumberAndType(CallerInfo.UNKNOWN_NUMBER, CallerInfo.UNKNOWN_NUMBER,
Calls.VOICEMAIL_TYPE);
assertEquals(View.VISIBLE, mViews.secondaryActionView.getVisibility());
- assertEquals(View.GONE, mViews.unheardView.getVisibility());
}
/** Asserts that the whole call area is gone. */
private void assertNoCallButton() {
assertEquals(View.GONE, mViews.secondaryActionView.getVisibility());
- assertEquals(View.GONE, mViews.unheardView.getVisibility());
assertEquals(View.GONE, mViews.dividerView.getVisibility());
}