From 099592e51291f9b08abf775f1e5f43dcbc95a050 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Fri, 18 Apr 2014 11:33:46 -0700 Subject: Add favorites/star icon to the phone favorite tile view. Bug: 14116267 Change-Id: Id4ea8dafcfe4fa46ab0ea7677cada4f2e64aff7a --- src/com/android/dialer/list/PhoneFavoriteTileView.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/com') diff --git a/src/com/android/dialer/list/PhoneFavoriteTileView.java b/src/com/android/dialer/list/PhoneFavoriteTileView.java index 047f381ae..7fe4eaa65 100644 --- a/src/com/android/dialer/list/PhoneFavoriteTileView.java +++ b/src/com/android/dialer/list/PhoneFavoriteTileView.java @@ -21,6 +21,7 @@ import android.content.Context; import android.text.TextUtils; import android.util.AttributeSet; import android.view.View; +import android.widget.ImageView; import com.android.contacts.common.ContactPhotoManager; import com.android.contacts.common.MoreContactUtils; @@ -87,17 +88,20 @@ public abstract class PhoneFavoriteTileView extends ContactTileView { @Override public void loadFromContact(ContactEntry entry) { super.loadFromContact(entry); - mPhoneNumberString = null; // ... in case we're reusing the view + // Set phone number to null in case we're reusing the view. + mPhoneNumberString = null; if (entry != null) { - // Grab the phone-number to call directly... see {@link onClick()} + // Grab the phone-number to call directly. See {@link onClick()}. mPhoneNumberString = entry.phoneNumber; // If this is a blank entry, don't show anything. - // TODO krelease:Just hide the view for now. For this to truly look like an empty row + // TODO krelease: Just hide the view for now. For this to truly look like an empty row // the entire ContactTileRow needs to be hidden. if (entry == ContactEntry.BLANK_ENTRY) { setVisibility(View.INVISIBLE); } else { + final ImageView starIcon = (ImageView) findViewById(R.id.contact_star_icon); + starIcon.setVisibility(entry.isFavorite ? View.VISIBLE : View.GONE); setVisibility(View.VISIBLE); } } -- cgit v1.2.3