diff options
author | Michael Jurka <mikejurka@google.com> | 2013-03-13 12:55:46 +0100 |
---|---|---|
committer | Arne Coucheron <arco68@gmail.com> | 2013-08-12 16:53:07 +0200 |
commit | 0ad71cd7c188bb29a9e4827efb92d45cb9a5d012 (patch) | |
tree | 06c0a504de2dc57d7313d281b6385fc0a4aea8ce /src/com/cyanogenmod/trebuchet/InterruptibleInOutAnimator.java | |
parent | 3a397cbf7fcece384ac2d3a65f61058015b4db36 (diff) | |
download | android_packages_apps_Trebuchet-0ad71cd7c188bb29a9e4827efb92d45cb9a5d012.tar.gz android_packages_apps_Trebuchet-0ad71cd7c188bb29a9e4827efb92d45cb9a5d012.tar.bz2 android_packages_apps_Trebuchet-0ad71cd7c188bb29a9e4827efb92d45cb9a5d012.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/cyanogenmod/trebuchet/InterruptibleInOutAnimator.java')
-rw-r--r-- | src/com/cyanogenmod/trebuchet/InterruptibleInOutAnimator.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/com/cyanogenmod/trebuchet/InterruptibleInOutAnimator.java b/src/com/cyanogenmod/trebuchet/InterruptibleInOutAnimator.java index ea847d756..73c364b43 100644 --- a/src/com/cyanogenmod/trebuchet/InterruptibleInOutAnimator.java +++ b/src/com/cyanogenmod/trebuchet/InterruptibleInOutAnimator.java @@ -19,6 +19,7 @@ package com.cyanogenmod.trebuchet; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.animation.ValueAnimator; +import android.view.View; /** * A convenience class for two-way animations, e.g. a fadeIn/fadeOut animation. @@ -44,8 +45,8 @@ public class InterruptibleInOutAnimator { // TODO: This isn't really necessary, but is here to help diagnose a bug in the drag viz private int mDirection = STOPPED; - public InterruptibleInOutAnimator(long duration, float fromValue, float toValue) { - mAnimator = LauncherAnimUtils.ofFloat(fromValue, toValue).setDuration(duration); + public InterruptibleInOutAnimator(View view, long duration, float fromValue, float toValue) { + mAnimator = LauncherAnimUtils.ofFloat(view, fromValue, toValue).setDuration(duration); mOriginalDuration = duration; mOriginalFromValue = fromValue; mOriginalToValue = toValue; |