diff options
author | Tony Wickham <twickham@google.com> | 2018-06-11 16:05:31 -0700 |
---|---|---|
committer | Tony Wickham <twickham@google.com> | 2018-06-11 23:23:49 +0000 |
commit | 29aef52be370b7235a4d9442d4b023e42a732c5b (patch) | |
tree | fcd1ca31a915bc3ead866d97bd6e21cec6a53f32 /src/com/android/launcher3/anim | |
parent | 367a53ec13407231513521416392d2cd8144b9dd (diff) | |
download | packages_apps_Trebuchet-29aef52be370b7235a4d9442d4b023e42a732c5b.tar.gz packages_apps_Trebuchet-29aef52be370b7235a4d9442d4b023e42a732c5b.tar.bz2 packages_apps_Trebuchet-29aef52be370b7235a4d9442d4b023e42a732c5b.zip |
Fix some issues with haptic
- Don't have double haptic on quick scrub
- Correctly check interpolated progress to determine final state,
so that it always aligns with the haptic (i.e. passing the haptic
means letting go will go to the new state)
Bug: 109709720
Change-Id: I702bb76a4c15f932f923e81a14cc49f6a9126cb8
Diffstat (limited to 'src/com/android/launcher3/anim')
-rw-r--r-- | src/com/android/launcher3/anim/AnimatorPlaybackController.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/com/android/launcher3/anim/AnimatorPlaybackController.java b/src/com/android/launcher3/anim/AnimatorPlaybackController.java index 50fb0a51a..164728ae6 100644 --- a/src/com/android/launcher3/anim/AnimatorPlaybackController.java +++ b/src/com/android/launcher3/anim/AnimatorPlaybackController.java @@ -15,6 +15,8 @@ */ package com.android.launcher3.anim; +import static com.android.launcher3.anim.Interpolators.LINEAR; + import android.animation.Animator; import android.animation.Animator.AnimatorListener; import android.animation.AnimatorListenerAdapter; @@ -72,7 +74,7 @@ public abstract class AnimatorPlaybackController implements ValueAnimator.Animat mOnCancelRunnable = onCancelRunnable; mAnimationPlayer = ValueAnimator.ofFloat(0, 1); - mAnimationPlayer.setInterpolator(Interpolators.LINEAR); + mAnimationPlayer.setInterpolator(LINEAR); mAnimationPlayer.addListener(new OnAnimationEndDispatcher()); mAnimationPlayer.addUpdateListener(this); @@ -107,6 +109,10 @@ public abstract class AnimatorPlaybackController implements ValueAnimator.Animat return mDuration; } + public TimeInterpolator getInterpolator() { + return mAnim.getInterpolator() != null ? mAnim.getInterpolator() : LINEAR; + } + /** * Starts playing the animation forward from current position. */ |