diff options
author | Michael Jurka <mikejurka@google.com> | 2013-03-13 12:55:46 +0100 |
---|---|---|
committer | Michael Jurka <mikejurka@google.com> | 2013-03-28 12:08:18 -0700 |
commit | f1ad608c28c79c8e9b83d83ce9154f1b7284f412 (patch) | |
tree | 67600627cdeaec5bedaac83b5d889a61b30f1e9c /src/com/android/launcher2/CellLayout.java | |
parent | b8f5c401de0a081557d8c014c0ecf00264d5f266 (diff) | |
download | android_packages_apps_Trebuchet-f1ad608c28c79c8e9b83d83ce9154f1b7284f412.tar.gz android_packages_apps_Trebuchet-f1ad608c28c79c8e9b83d83ce9154f1b7284f412.tar.bz2 android_packages_apps_Trebuchet-f1ad608c28c79c8e9b83d83ce9154f1b7284f412.zip |
Fix jumps in the beginning of animations
If the first draw frame of an animation is
expensive, which it often is, it causes a big
jump. Added a helper class which automatically
adjusts the animation start time if the first
frame is more than 16ms.
Change-Id: I100edbc41c2abe930a32d6bcf0a782ea9735f7f9
Diffstat (limited to 'src/com/android/launcher2/CellLayout.java')
-rw-r--r-- | src/com/android/launcher2/CellLayout.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/com/android/launcher2/CellLayout.java b/src/com/android/launcher2/CellLayout.java index 98fcdea07..ddb9b6418 100644 --- a/src/com/android/launcher2/CellLayout.java +++ b/src/com/android/launcher2/CellLayout.java @@ -241,7 +241,7 @@ public class CellLayout extends ViewGroup { for (int i = 0; i < mDragOutlineAnims.length; i++) { final InterruptibleInOutAnimator anim = - new InterruptibleInOutAnimator(duration, fromAlphaValue, toAlphaValue); + new InterruptibleInOutAnimator(this, duration, fromAlphaValue, toAlphaValue); anim.getAnimator().setInterpolator(mEaseOutInterpolator); final int thisIndex = i; anim.getAnimator().addUpdateListener(new AnimatorUpdateListener() { @@ -1128,7 +1128,7 @@ public class CellLayout extends ViewGroup { return true; } - ValueAnimator va = LauncherAnimUtils.ofFloat(0f, 1f); + ValueAnimator va = LauncherAnimUtils.ofFloat(child, 0f, 1f); va.setDuration(duration); mReorderAnimators.put(lp, va); @@ -2324,7 +2324,7 @@ public class CellLayout extends ViewGroup { if (finalDeltaX == 0 && finalDeltaY == 0) { return; } - ValueAnimator va = LauncherAnimUtils.ofFloat(0f, 1f); + ValueAnimator va = LauncherAnimUtils.ofFloat(child, 0f, 1f); a = va; va.setRepeatMode(ValueAnimator.REVERSE); va.setRepeatCount(ValueAnimator.INFINITE); |