summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/DragView.java
diff options
context:
space:
mode:
authorMichael Jurka <mikejurka@google.com>2013-03-13 12:55:46 +0100
committerMichael Jurka <mikejurka@google.com>2013-03-28 12:08:18 -0700
commitf1ad608c28c79c8e9b83d83ce9154f1b7284f412 (patch)
tree67600627cdeaec5bedaac83b5d889a61b30f1e9c /src/com/android/launcher2/DragView.java
parentb8f5c401de0a081557d8c014c0ecf00264d5f266 (diff)
downloadandroid_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/DragView.java')
-rw-r--r--src/com/android/launcher2/DragView.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/com/android/launcher2/DragView.java b/src/com/android/launcher2/DragView.java
index e6b15b8ee..b25ae6112 100644
--- a/src/com/android/launcher2/DragView.java
+++ b/src/com/android/launcher2/DragView.java
@@ -80,7 +80,7 @@ public class DragView extends View {
setScaleY(initialScale);
// Animate the view into the correct position
- mAnim = LauncherAnimUtils.ofFloat(0.0f, 1.0f);
+ mAnim = LauncherAnimUtils.ofFloat(this, 0f, 1f);
mAnim.setDuration(150);
mAnim.addUpdateListener(new AnimatorUpdateListener() {
@Override
@@ -203,7 +203,7 @@ public class DragView extends View {
}
public void crossFade(int duration) {
- ValueAnimator va = LauncherAnimUtils.ofFloat(0f, 1f);
+ ValueAnimator va = LauncherAnimUtils.ofFloat(this, 0f, 1f);
va.setDuration(duration);
va.setInterpolator(new DecelerateInterpolator(1.5f));
va.addUpdateListener(new AnimatorUpdateListener() {