mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 10:48:19 +00:00
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
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user