Merge "Support scrolling of Updates tab."
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 8cd1d8e..5bb6c2b 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -604,8 +604,11 @@
<!-- A nicely formatted call duration displayed when viewing call details. For example "42 mins 28 secs" -->
<string name="callDetailsDurationFormat"><xliff:g id="minutes" example="42">%s</xliff:g> mins <xliff:g id="seconds" example="28">%s</xliff:g> secs</string>
- <!-- A list separator for the Favorites tab indicating that items below it are frequently contacted contacts rather than starred contacts -->
- <string name="favoritesFrquentSeparator">Frequently contacted</string>
+ <!-- The text displayed on the divider for the Favorites tab in People app indicating that items below it are frequently contacted [CHAR LIMIT = 39] -->
+ <string name="favoritesFrequentContacted">Frequently contacted</string>
+
+ <!-- The text displayed on the divider for the Favorites tab in Phone app indicating that items below it are frequently called as opposed to starred contacts [CHAR LIMIT = 39] -->
+ <string name="favoritesFrequentCalled">Frequently called</string>
<!-- Dialog title when prompting before creating a contact -->
<string name="add_contact_dlg_title">Add contact</string>
diff --git a/src/com/android/contacts/calllog/ClearCallLogDialog.java b/src/com/android/contacts/calllog/ClearCallLogDialog.java
index 0f999bd..426732a 100644
--- a/src/com/android/contacts/calllog/ClearCallLogDialog.java
+++ b/src/com/android/contacts/calllog/ClearCallLogDialog.java
@@ -52,7 +52,7 @@
final AsyncTask<Void, Void, Void> task = new AsyncTask<Void, Void, Void>() {
@Override
protected Void doInBackground(Void... params) {
- resolver.delete(Calls.CONTENT_URI_WITH_VOICEMAIL, null, null);
+ resolver.delete(Calls.CONTENT_URI, null, null);
return null;
}
@Override
diff --git a/src/com/android/contacts/detail/ContactDetailFragment.java b/src/com/android/contacts/detail/ContactDetailFragment.java
index 02394f2..02e74dd 100644
--- a/src/com/android/contacts/detail/ContactDetailFragment.java
+++ b/src/com/android/contacts/detail/ContactDetailFragment.java
@@ -223,6 +223,9 @@
private boolean mTransitionAnimationRequested;
+ private boolean mIsUniqueNumber;
+ private boolean mIsUniqueEmail;
+
public ContactDetailFragment() {
// Explicit constructor for inflation
}
@@ -422,6 +425,9 @@
Collapser.collapseList(mPostalEntries);
Collapser.collapseList(mImEntries);
+ mIsUniqueNumber = mPhoneEntries.size() == 1;
+ mIsUniqueEmail = mEmailEntries.size() == 1;
+
// Make one aggregated list of all entries for display to the user.
setupFlattenedList();
@@ -1716,36 +1722,23 @@
String selectedMimeType = selectedEntry.mimetype;
+ // Defaults to true will only enable the detail to be copied to the clipboard.
+ boolean isUniqueMimeType = true;
+
// Only allow primary support for Phone and Email content types
- if (Phone.CONTENT_ITEM_TYPE.equals(selectedMimeType) ||
- Email.CONTENT_ITEM_TYPE.equals(selectedMimeType)) {
+ if (Phone.CONTENT_ITEM_TYPE.equals(selectedMimeType)) {
+ isUniqueMimeType = mIsUniqueNumber;
+ } else if (Email.CONTENT_ITEM_TYPE.equals(selectedMimeType)) {
+ isUniqueMimeType = mIsUniqueEmail;
+ }
- // Used to determine if entry is the only mime type of its kind
- boolean isUniqueMimeType = true;
-
- // Checking for unique mime type
- for (int positionCounter = 0; positionCounter < mAllEntries.size(); positionCounter++) {
- final ViewEntry entry = mAllEntries.get(positionCounter);
-
- // Ignoring cases where entry is not a detail entry
- if (entry.getViewType() != ViewAdapter.VIEW_TYPE_DETAIL_ENTRY) continue;
-
- final DetailViewEntry checkEntry = (DetailViewEntry) entry;
- if (positionCounter != info.position &&
- checkEntry.mimetype.equalsIgnoreCase(selectedMimeType)) {
- isUniqueMimeType = false;
- break;
- }
- }
-
- // Checking for previously set default
- if (selectedEntry.isPrimary) {
- menu.add(ContextMenu.NONE, ContextMenuIds.CLEAR_DEFAULT,
- ContextMenu.NONE, getString(R.string.clear_default));
- } else if (!isUniqueMimeType) {
- menu.add(ContextMenu.NONE, ContextMenuIds.SET_DEFAULT,
- ContextMenu.NONE, getString(R.string.set_default));
- }
+ // Checking for previously set default
+ if (selectedEntry.isPrimary) {
+ menu.add(ContextMenu.NONE, ContextMenuIds.CLEAR_DEFAULT,
+ ContextMenu.NONE, getString(R.string.clear_default));
+ } else if (!isUniqueMimeType) {
+ menu.add(ContextMenu.NONE, ContextMenuIds.SET_DEFAULT,
+ ContextMenu.NONE, getString(R.string.set_default));
}
}
diff --git a/src/com/android/contacts/list/ContactTileAdapter.java b/src/com/android/contacts/list/ContactTileAdapter.java
index 5850a4a..0d4eb8c 100644
--- a/src/com/android/contacts/list/ContactTileAdapter.java
+++ b/src/com/android/contacts/list/ContactTileAdapter.java
@@ -365,8 +365,12 @@
View dividerView = View.inflate(mContext, R.layout.list_separator, null);
dividerView.setFocusable(false);
TextView text = (TextView) dividerView.findViewById(R.id.header_text);
- text.setText(mContext.getString(R.string.favoritesFrquentSeparator));
- return dividerView;
+
+ text.setText(mDisplayType == DisplayType.STREQUENT_PHONE_ONLY ?
+ mContext.getString(R.string.favoritesFrequentCalled) :
+ mContext.getString(R.string.favoritesFrequentContacted));
+
+ return dividerView;
}
private int getLayoutResourceId(int viewType) {