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/touch | |
parent | 367a53ec13407231513521416392d2cd8144b9dd (diff) | |
download | android_packages_apps_Trebuchet-29aef52be370b7235a4d9442d4b023e42a732c5b.tar.gz android_packages_apps_Trebuchet-29aef52be370b7235a4d9442d4b023e42a732c5b.tar.bz2 android_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/touch')
-rw-r--r-- | src/com/android/launcher3/touch/AbstractStateChangeTouchController.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java b/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java index ff3b42590..b1fef0240 100644 --- a/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java +++ b/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java @@ -354,6 +354,8 @@ public abstract class AbstractStateChangeTouchController final LauncherState targetState; final float progress = mCurrentAnimation.getProgressFraction(); + final float interpolatedProgress = mCurrentAnimation.getInterpolator() + .getInterpolation(progress); if (fling) { targetState = Float.compare(Math.signum(velocity), Math.signum(mProgressMultiplier)) == 0 @@ -362,7 +364,7 @@ public abstract class AbstractStateChangeTouchController } else { float successProgress = mToState == ALL_APPS ? MIN_PROGRESS_TO_ALL_APPS : SUCCESS_TRANSITION_PROGRESS; - targetState = (progress > successProgress) ? mToState : mFromState; + targetState = (interpolatedProgress > successProgress) ? mToState : mFromState; } final float endProgress; |