From 791082e22b50db98de6749bb5ef878d3ec483e28 Mon Sep 17 00:00:00 2001 From: Yorke Lee Date: Mon, 23 Sep 2013 15:13:37 -0700 Subject: Add number type label to favorites list Bug: 10888792 Change-Id: I60ab15389c01cdb5cebc72ede15cced93dca50ef --- res/layout/phone_favorite_regular_row_view.xml | 15 +++++++++ .../dialer/list/PhoneFavoriteRegularRowView.java | 4 --- .../dialer/list/PhoneFavoritesTileAdapter.java | 39 +++++++--------------- 3 files changed, 27 insertions(+), 31 deletions(-) diff --git a/res/layout/phone_favorite_regular_row_view.xml b/res/layout/phone_favorite_regular_row_view.xml index bf63642e6..c4c9c557a 100644 --- a/res/layout/phone_favorite_regular_row_view.xml +++ b/res/layout/phone_favorite_regular_row_view.xml @@ -53,6 +53,21 @@ android:ellipsize="marquee" android:textAlignment="viewStart" /> + + 0) { - id = cursor.getLong(mIdIndex); - } else if (counter >= TILES_SOFT_LIMIT) { + // We display a maximum of TILES_SOFT_LIMIT contacts, or the total number of starred + // whichever is greater. + if (starred < 1 && counter >= TILES_SOFT_LIMIT) { break; } else { - // The contact id for frequent contacts is stored in the .contact_id field rather - // than the _id field - id = cursor.getLong(mContactIdForFrequentIndex); + id = cursor.getLong(mContactIdIndex); } if (duplicates.get(id) == null) { @@ -305,20 +298,12 @@ public class PhoneFavoritesTileAdapter extends BaseAdapter implements Uri.withAppendedPath(Contacts.CONTENT_LOOKUP_URI, lookupKey), id); - // TODO krelease: These columns are temporarily unused for now so that - // the contact tiles will be treated like favorites since they don't have a phone - // number. Depending on how the final UX goes we will either remove or enable - // them again. - - /* - // Set phone number, label and status - final int phoneNumberType = cursor.getInt(mPhoneNumberTypeIndex); - final String phoneNumberCustomLabel = cursor.getString(mPhoneNumberLabelIndex); - contact.phoneLabel = (String) Phone.getTypeLabel(mResources, phoneNumberType, - phoneNumberCustomLabel); - contact.phoneNumber = cursor.getString(mPhoneNumberIndex); - contact.status = cursor.getString(mStatusIndex); - */ + // Set phone number, label and status + final int phoneNumberType = cursor.getInt(mPhoneNumberTypeIndex); + final String phoneNumberCustomLabel = cursor.getString(mPhoneNumberLabelIndex); + contact.phoneLabel = (String) Phone.getTypeLabel(mResources, phoneNumberType, + phoneNumberCustomLabel); + contact.phoneNumber = cursor.getString(mPhoneNumberIndex); contact.pinned = pinned; mContactEntries.add(contact); -- cgit v1.2.3