summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorYorke Lee <yorkelee@google.com>2014-03-03 12:07:57 -0800
committerJay Shrauner <shrauner@google.com>2014-03-05 01:57:45 +0000
commit876cb3961c6757e9faf56d7a1408efe098dbd0e4 (patch)
treea1ce7074d587d2d80064d6c9f11341c9042e6129 /src
parentdfc8165711e1b0b4568fc7876f259a44ee083012 (diff)
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 (cherry picked from commit 7846f2e0ed4def3202029f6ef5d6e0b350de0986)
Diffstat (limited to 'src')
-rw-r--r--src/com/android/dialer/list/PhoneFavoriteTileView.java25
1 files changed, 16 insertions, 9 deletions
diff --git a/src/com/android/dialer/list/PhoneFavoriteTileView.java b/src/com/android/dialer/list/PhoneFavoriteTileView.java
index d9f2f976e..471601d2b 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
@@ -251,4 +250,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);
+ }
+ }
}