summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorYorke Lee <yorkelee@google.com>2014-03-03 21:41:09 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-03-03 21:41:10 +0000
commit735bc040c07b905266f7619b292bfa3bd638acd5 (patch)
treefcb369c85c16a2e48c9d39d0401b279892ac1c23 /src
parentcafbab132e3e415682212a1e7d0f2d56762dd3ee (diff)
parent7846f2e0ed4def3202029f6ef5d6e0b350de0986 (diff)
Merge "Hide shadow overlay for contact tiles with letter tile avatars"
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 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);
+ }
+ }
}