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)
diff --git a/src/com/android/dialer/list/PhoneFavoriteTileView.java b/src/com/android/dialer/list/PhoneFavoriteTileView.java
index d9f2f97..471601d 100644
--- a/src/com/android/dialer/list/PhoneFavoriteTileView.java
+++ b/src/com/android/dialer/list/PhoneFavoriteTileView.java
@@ -24,11 +24,8 @@
 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 @@
     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 @@
     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 @@
     @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 @@
         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);
+        }
+    }
 }