summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYorke Lee <yorkelee@google.com>2013-09-23 15:13:37 -0700
committerYorke Lee <yorkelee@google.com>2013-09-23 20:28:40 -0700
commit791082e22b50db98de6749bb5ef878d3ec483e28 (patch)
tree57c048da251e46313c7d8fe9fdb31b16bd0a0a10 /src
parentd73ea85ab5903dbac8cc4f5e5bdb55261607feb7 (diff)
downloadandroid_packages_apps_Dialer-791082e22b50db98de6749bb5ef878d3ec483e28.tar.gz
android_packages_apps_Dialer-791082e22b50db98de6749bb5ef878d3ec483e28.tar.bz2
android_packages_apps_Dialer-791082e22b50db98de6749bb5ef878d3ec483e28.zip
Add number type label to favorites list
Bug: 10888792 Change-Id: I60ab15389c01cdb5cebc72ede15cced93dca50ef
Diffstat (limited to 'src')
-rw-r--r--src/com/android/dialer/list/PhoneFavoriteRegularRowView.java4
-rw-r--r--src/com/android/dialer/list/PhoneFavoritesTileAdapter.java39
2 files changed, 12 insertions, 31 deletions
diff --git a/src/com/android/dialer/list/PhoneFavoriteRegularRowView.java b/src/com/android/dialer/list/PhoneFavoriteRegularRowView.java
index b4ad78467..91b09d7d6 100644
--- a/src/com/android/dialer/list/PhoneFavoriteRegularRowView.java
+++ b/src/com/android/dialer/list/PhoneFavoriteRegularRowView.java
@@ -18,15 +18,11 @@ package com.android.dialer.list;
import android.content.Context;
import android.content.res.Resources;
import android.util.AttributeSet;
-import android.view.GestureDetector;
import android.view.View;
import com.android.contacts.common.util.ViewUtil;
import com.android.dialer.R;
-import com.android.dialer.list.PhoneFavoritesTileAdapter.ContactTileRow;
-
-
public class PhoneFavoriteRegularRowView extends PhoneFavoriteTileView {
private static final String TAG = PhoneFavoriteRegularRowView.class.getSimpleName();
private static final boolean DEBUG = false;
diff --git a/src/com/android/dialer/list/PhoneFavoritesTileAdapter.java b/src/com/android/dialer/list/PhoneFavoritesTileAdapter.java
index 2b232e869..6969f6f6c 100644
--- a/src/com/android/dialer/list/PhoneFavoritesTileAdapter.java
+++ b/src/com/android/dialer/list/PhoneFavoritesTileAdapter.java
@@ -106,16 +106,11 @@ public class PhoneFavoritesTileAdapter extends BaseAdapter implements
protected int mPresenceIndex;
protected int mStatusIndex;
- /**
- * Only valid when {@link DisplayType#STREQUENT_PHONE_ONLY} is true
- *
- * TODO krelease: Remove entirely if not needed
- */
private int mPhoneNumberIndex;
private int mPhoneNumberTypeIndex;
private int mPhoneNumberLabelIndex;
protected int mPinnedIndex;
- protected int mContactIdForFrequentIndex;
+ protected int mContactIdIndex;
private final int mPaddingInPixels;
@@ -209,7 +204,7 @@ public class PhoneFavoritesTileAdapter extends BaseAdapter implements
mPhoneNumberTypeIndex = ContactTileLoaderFactory.PHONE_NUMBER_TYPE;
mPhoneNumberLabelIndex = ContactTileLoaderFactory.PHONE_NUMBER_LABEL;
mPinnedIndex = ContactTileLoaderFactory.PINNED;
- mContactIdForFrequentIndex = ContactTileLoaderFactory.CONTACT_ID_FOR_FREQUENT;
+ mContactIdIndex = ContactTileLoaderFactory.CONTACT_ID_FOR_DATA;
}
/**
@@ -274,14 +269,12 @@ public class PhoneFavoritesTileAdapter extends BaseAdapter implements
final int starred = cursor.getInt(mStarredIndex);
final long id;
- if (starred > 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);