diff options
author | Michael Jurka <mikejurka@google.com> | 2011-09-12 17:04:53 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-09-12 17:04:53 -0700 |
commit | f1c8adc9ae4a3f8619da2f9942d026c2bc411882 (patch) | |
tree | 2622fc000db2eca3810e0b6f55ecc6cd05071897 /packages/SystemUI/src/com/android/systemui/SwipeHelper.java | |
parent | bd5c9768c4432c6cb2bfa5f521d49ff03c087ff8 (diff) | |
parent | 0e8063a3b447e1aa5cc3171db42f735b3b6ae78e (diff) | |
download | frameworks_base-f1c8adc9ae4a3f8619da2f9942d026c2bc411882.zip frameworks_base-f1c8adc9ae4a3f8619da2f9942d026c2bc411882.tar.gz frameworks_base-f1c8adc9ae4a3f8619da2f9942d026c2bc411882.tar.bz2 |
Merge "Bug fixes in Recents"
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/SwipeHelper.java')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/SwipeHelper.java | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/SwipeHelper.java b/packages/SystemUI/src/com/android/systemui/SwipeHelper.java index ec36de7..07281d4 100644 --- a/packages/SystemUI/src/com/android/systemui/SwipeHelper.java +++ b/packages/SystemUI/src/com/android/systemui/SwipeHelper.java @@ -41,9 +41,10 @@ public class SwipeHelper { public static final int Y = 1; private float SWIPE_ESCAPE_VELOCITY = 100f; // dp/sec - private int MAX_ESCAPE_ANIMATION_DURATION = 500; // ms - private int MAX_DISMISS_VELOCITY = 1000; // dp/sec - private static final int SNAP_ANIM_LEN = SLOW_ANIMATIONS ? 1000 : 250; // ms + private int DEFAULT_ESCAPE_ANIMATION_DURATION = 200; // ms + private int MAX_ESCAPE_ANIMATION_DURATION = 400; // ms + private int MAX_DISMISS_VELOCITY = 2000; // dp/sec + private static final int SNAP_ANIM_LEN = SLOW_ANIMATIONS ? 1000 : 150; // ms public static float ALPHA_FADE_START = 0f; // fraction of thumbnail width // where fade starts @@ -126,7 +127,10 @@ public class SwipeHelper { } else if (pos < viewSize * (1.0f - ALPHA_FADE_START)) { result = 1.0f + (viewSize * ALPHA_FADE_START + pos) / fadeSize; } - return result; + // Make .03 alpha the minimum so you always see the item a bit-- slightly below + // .03, the item disappears entirely (as if alpha = 0) and that discontinuity looks + // a bit jarring + return Math.max(0.03f, result); } // invalidate the view's own bounds all the way up the view hierarchy @@ -213,7 +217,10 @@ public class SwipeHelper { duration = Math.min(duration, (int) (Math.abs(newPos - getTranslation(animView)) * 1000f / Math .abs(velocity))); + } else { + duration = DEFAULT_ESCAPE_ANIMATION_DURATION; } + ObjectAnimator anim = createTranslationAnimation(animView, newPos); anim.setInterpolator(new LinearInterpolator()); anim.setDuration(duration); |