From 7846f2e0ed4def3202029f6ef5d6e0b350de0986 Mon Sep 17 00:00:00 2001 From: Yorke Lee Date: Mon, 3 Mar 2014 12:07:57 -0800 Subject: Hide shadow overlay for contact tiles with letter tile avatars Also tweak layout of letter tiles to better match redlines Bug: 13101785 Change-Id: I1846947a389bbdccc30bfe388b24e80e8724a357 --- .../android/dialer/list/PhoneFavoriteTileView.java | 25 ++++++++++++++-------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/com/android/dialer/list/PhoneFavoriteTileView.java b/src/com/android/dialer/list/PhoneFavoriteTileView.java index 697a48113..16bf6293d 100644 --- a/src/com/android/dialer/list/PhoneFavoriteTileView.java +++ b/src/com/android/dialer/list/PhoneFavoriteTileView.java @@ -24,11 +24,8 @@ import android.content.ClipData; import android.content.Context; import android.text.TextUtils; import android.util.AttributeSet; -import android.util.Log; import android.view.GestureDetector; -import android.view.MotionEvent; import android.view.View; -import android.widget.ImageView; import com.android.contacts.common.ContactPhotoManager; import com.android.contacts.common.MoreContactUtils; @@ -51,11 +48,11 @@ public abstract class PhoneFavoriteTileView extends ContactTileView { private static final String TAG = PhoneFavoriteTileView.class.getSimpleName(); private static final boolean DEBUG = false; - // These parameters instruct the photo manager to display the default image/letter at 80% of + // These parameters instruct the photo manager to display the default image/letter at 70% of // its normal size, and vertically offset upwards 20% towards the top of the letter tile, to // make room for the contact name and number label at the bottom of the image. private static final float DEFAULT_IMAGE_LETTER_OFFSET = -0.2f; - private static final float DEFAULT_IMAGE_LETTER_SCALE = 0.8f; + private static final float DEFAULT_IMAGE_LETTER_SCALE = 0.70f; /** Length of all animations in miniseconds. */ private int mAnimationDuration; @@ -68,6 +65,8 @@ public abstract class PhoneFavoriteTileView extends ContactTileView { private View mUndoRemovalButton; /** The view that holds the list view row. */ protected ContactTileRow mParentRow; + /** View that contains the transparent shadow that is overlaid on top of the contact image. */ + private View mShadowOverlay; /** Users' most frequent phone number. */ private String mPhoneNumberString; @@ -91,10 +90,10 @@ public abstract class PhoneFavoriteTileView extends ContactTileView { @Override protected void onFinishInflate() { super.onFinishInflate(); - mFavoriteContactCard = findViewById(com.android.dialer.R.id.contact_favorite_card); - mRemovalDialogue = findViewById(com.android.dialer.R.id.favorite_remove_dialogue); - mUndoRemovalButton = findViewById(com.android.dialer.R.id - .favorite_remove_undo_button); + mShadowOverlay = findViewById(R.id.shadow_overlay); + mFavoriteContactCard = findViewById(R.id.contact_favorite_card); + mRemovalDialogue = findViewById(R.id.favorite_remove_dialogue); + mUndoRemovalButton = findViewById(R.id.favorite_remove_undo_button); mUndoRemovalButton.setOnClickListener(new OnClickListener() { @Override @@ -250,4 +249,12 @@ public abstract class PhoneFavoriteTileView extends ContactTileView { return new DefaultImageRequest(displayName, lookupKey, ContactPhotoManager.TYPE_DEFAULT, DEFAULT_IMAGE_LETTER_SCALE, DEFAULT_IMAGE_LETTER_OFFSET); } + + @Override + protected void configureViewForImage(boolean isDefaultImage) { + // Hide the shadow overlay if the image is a default image (i.e. colored letter tile) + if (mShadowOverlay != null) { + mShadowOverlay.setVisibility(isDefaultImage ? View.GONE : View.VISIBLE); + } + } } -- cgit v1.2.3