summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Soulos <psoulos@google.com>2014-07-15 14:08:50 -0700
committerPaul Soulos <psoulos@google.com>2014-07-15 14:08:50 -0700
commitcb4fcc7ef75c33411d2b900db7933c5bc4336527 (patch)
treea648d7ef5a41480e1ddd5128f058da82e6e3dc11 /src
parenta2fec386b90e3031249b6c09841fa289677edff6 (diff)
downloadpackages_apps_Contacts-cb4fcc7ef75c33411d2b900db7933c5bc4336527.tar.gz
packages_apps_Contacts-cb4fcc7ef75c33411d2b900db7933c5bc4336527.tar.bz2
packages_apps_Contacts-cb4fcc7ef75c33411d2b900db7933c5bc4336527.zip
Moves StructuredPostal above 3P data types
Bug: 16296394 Change-Id: Ideeb847733e63337d0bea4ded0ea937dcb0fd3c5
Diffstat (limited to 'src')
-rw-r--r--src/com/android/contacts/quickcontact/QuickContactActivity.java26
1 files changed, 8 insertions, 18 deletions
diff --git a/src/com/android/contacts/quickcontact/QuickContactActivity.java b/src/com/android/contacts/quickcontact/QuickContactActivity.java
index 1868d8743..d587f95ec 100644
--- a/src/com/android/contacts/quickcontact/QuickContactActivity.java
+++ b/src/com/android/contacts/quickcontact/QuickContactActivity.java
@@ -219,21 +219,13 @@ public class QuickContactActivity extends ContactsActivity {
private final ImageViewDrawableSetter mPhotoSetter = new ImageViewDrawableSetter();
/**
- * {@link #LEADING_MIMETYPES} and {@link #TRAILING_MIMETYPES} are used to sort MIME-types.
+ * {@link #LEADING_MIMETYPES} is used to sort MIME-types.
*
* <p>The MIME-types in {@link #LEADING_MIMETYPES} appear in the front of the dialog,
* in the order specified here.</p>
- *
- * <p>The ones in {@link #TRAILING_MIMETYPES} appear in the end of the dialog, in the order
- * specified here.</p>
- *
- * <p>The rest go between them, in the order in the array.</p>
*/
private static final List<String> LEADING_MIMETYPES = Lists.newArrayList(
- Phone.CONTENT_ITEM_TYPE, SipAddress.CONTENT_ITEM_TYPE, Email.CONTENT_ITEM_TYPE);
-
- /** See {@link #LEADING_MIMETYPES}. */
- private static final List<String> TRAILING_MIMETYPES = Lists.newArrayList(
+ Phone.CONTENT_ITEM_TYPE, SipAddress.CONTENT_ITEM_TYPE, Email.CONTENT_ITEM_TYPE,
StructuredPostal.CONTENT_ITEM_TYPE);
private static final List<String> ABOUT_CARD_MIMETYPES = Lists.newArrayList(
@@ -441,6 +433,12 @@ public class QuickContactActivity extends ContactsActivity {
}
};
+ /**
+ * Sorts among different mimetypes based off:
+ * 1. Times used
+ * 2. Last time used
+ * 3. Statically defined
+ */
private final Comparator<List<DataItem>> mAmongstMimeTypeDataItemComparator =
new Comparator<List<DataItem>> () {
@Override
@@ -475,14 +473,6 @@ public class QuickContactActivity extends ContactsActivity {
return 1;
}
}
- // Trailing types come last, so flip the returns
- for (String mimeType : TRAILING_MIMETYPES) {
- if (lhsMimeType.equals(mimeType)) {
- return 1;
- } else if (rhsMimeType.equals(mimeType)) {
- return -1;
- }
- }
return 0;
}
};