diff options
author | Yorke Lee <yorkelee@google.com> | 2014-06-03 00:41:39 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-06-03 00:41:39 +0000 |
commit | 51003da60bd31ddabba1debfb1e3ab97c0feda58 (patch) | |
tree | acb3d6db1d1b895621c53e03ded1ae4a38d08081 | |
parent | 44198fe16e007fa60afe8ebf32b1bdd17141fb9e (diff) | |
parent | 53e2ce195ed7d06d5dca8ae8bd02f6990e090a0d (diff) |
Merge "Fix for recent card shadow disappearing" into lmp-preview-dev
-rw-r--r-- | src/com/android/dialer/list/ShortcutCardsAdapter.java | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/com/android/dialer/list/ShortcutCardsAdapter.java b/src/com/android/dialer/list/ShortcutCardsAdapter.java index 2ce7ea499..128871dcd 100644 --- a/src/com/android/dialer/list/ShortcutCardsAdapter.java +++ b/src/com/android/dialer/list/ShortcutCardsAdapter.java @@ -213,6 +213,9 @@ public class ShortcutCardsAdapter extends BaseAdapter { private SwipeHelper mSwipeHelper; private OnItemGestureListener mOnItemSwipeListener; + private float mPreviousTranslationZ = 0; + private Rect mClipRect = new Rect(); + public SwipeableShortcutCard(Context context) { super(context); final float densityScale = getResources().getDisplayMetrics().density; @@ -244,8 +247,9 @@ public class ShortcutCardsAdapter extends BaseAdapter { actionView.getPaddingEnd(), mCallLogPaddingBottom); - view.setTranslationZ(getResources().getDimensionPixelSize( - R.dimen.recent_call_log_item_translation_z)); + mPreviousTranslationZ = getResources().getDimensionPixelSize( + R.dimen.recent_call_log_item_translation_z); + view.setTranslationZ(mPreviousTranslationZ); super.addView(view); } @@ -307,9 +311,6 @@ public class ShortcutCardsAdapter extends BaseAdapter { mOnItemSwipeListener = listener; } - private float mPreviousTranslationZ = 0; - private Rect mClipRect = new Rect(); - /** * Clips the card by a specified amount. * @@ -325,7 +326,7 @@ public class ShortcutCardsAdapter extends BaseAdapter { int width = viewToClip.getWidth(); int height = viewToClip.getHeight(); - if (ratioHidden <= 0.01f) { + if (ratioHidden <= 0.001f) { viewToClip.setTranslationZ(mPreviousTranslationZ); } else if (viewToClip.getTranslationZ() != 0){ mPreviousTranslationZ = viewToClip.getTranslationZ(); |