summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorke Lee <yorkelee@google.com>2014-06-04 18:08:15 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-06-04 18:08:15 +0000
commit19ffffed635aec481dfaa1483a69755834d6d40d (patch)
tree768c7cf7ebfaccaa824f2f3c976422606c294560
parent16e0909b915b736cc4cc68dbfabb0cd151f2c60d (diff)
parent51003da60bd31ddabba1debfb1e3ab97c0feda58 (diff)
am 51003da6: Merge "Fix for recent card shadow disappearing" into lmp-preview-dev
* commit '51003da60bd31ddabba1debfb1e3ab97c0feda58': Fix for recent card shadow disappearing
-rw-r--r--src/com/android/dialer/list/ShortcutCardsAdapter.java13
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();