diff options
author | Android Build Merger (Role) <noreply-android-build-merger@google.com> | 2018-06-27 22:57:17 +0000 |
---|---|---|
committer | Android Build Merger (Role) <noreply-android-build-merger@google.com> | 2018-06-27 22:57:17 +0000 |
commit | acbda3fe52d640a47dce30048446809446ba9df4 (patch) | |
tree | 6f7894d2a74d26d7f432ccbc0ec1f2d2d610cb7f | |
parent | ebb20bfdaa5175827dbc92c8f308e3f8a4bd404d (diff) | |
parent | d63e6dff2888686b075547ded2c3ad7b236a45e3 (diff) | |
download | android_packages_apps_Trebuchet-acbda3fe52d640a47dce30048446809446ba9df4.tar.gz android_packages_apps_Trebuchet-acbda3fe52d640a47dce30048446809446ba9df4.tar.bz2 android_packages_apps_Trebuchet-acbda3fe52d640a47dce30048446809446ba9df4.zip |
[automerger] Last minute swipe up overshoot tweaks am: d63e6dff28
Change-Id: I75d08b42fd6a62f6ab58ce51d1309f13392cd58b
-rw-r--r-- | quickstep/src/com/android/quickstep/LongSwipeHelper.java | 3 | ||||
-rw-r--r-- | src/com/android/launcher3/anim/Interpolators.java | 12 |
2 files changed, 10 insertions, 5 deletions
diff --git a/quickstep/src/com/android/quickstep/LongSwipeHelper.java b/quickstep/src/com/android/quickstep/LongSwipeHelper.java index 491cbb3d2..6b66ec8db 100644 --- a/quickstep/src/com/android/quickstep/LongSwipeHelper.java +++ b/quickstep/src/com/android/quickstep/LongSwipeHelper.java @@ -118,8 +118,7 @@ public class LongSwipeHelper { if (blockedFling && !toAllApps) { Interpolators.OvershootParams overshoot = new OvershootParams(currentFraction, currentFraction, endProgress, velocityPxPerMs, (int) mMaxSwipeDistance); - duration = (overshoot.duration + duration) - * LauncherAnimUtils.blockedFlingDurationFactor(0); + duration = (overshoot.duration + duration); duration = Utilities.boundToRange(duration, MIN_OVERSHOOT_DURATION, MAX_SWIPE_DURATION); interpolator = overshoot.interpolator; diff --git a/src/com/android/launcher3/anim/Interpolators.java b/src/com/android/launcher3/anim/Interpolators.java index 3e01f7262..675e26de0 100644 --- a/src/com/android/launcher3/anim/Interpolators.java +++ b/src/com/android/launcher3/anim/Interpolators.java @@ -57,6 +57,9 @@ public class Interpolators { public static final Interpolator EXAGGERATED_EASE; + private static final int MIN_SETTLE_DURATION = 200; + private static final float OVERSHOOT_FACTOR = 0.9f; + static { Path exaggeratedEase = new Path(); exaggeratedEase.moveTo(0, 0); @@ -186,7 +189,8 @@ public class Interpolators { start = startProgress; int startPx = (int) (start * totalDistancePx); // Overshoot by about half a frame. - float overshootBy = velocityPxPerMs * SINGLE_FRAME_MS / totalDistancePx / 2; + float overshootBy = OVERSHOOT_FACTOR * velocityPxPerMs * + SINGLE_FRAME_MS / totalDistancePx / 2; overshootBy = Utilities.boundToRange(overshootBy, 0.02f, 0.15f); end = overshootPastProgress + overshootBy; int endPx = (int) (end * totalDistancePx); @@ -211,7 +215,9 @@ public class Interpolators { // Above formula assumes constant acceleration. Since we use ACCEL_DEACCEL, we actually // have acceleration to halfway then deceleration the rest. So the formula becomes: // t = sqrt(d/a) * 2 (half the distance for accel, half for deaccel) - long settleDuration = (long) Math.sqrt(settleDistancePx / decelerationPxPerMs) * 2; + long settleDuration = (long) Math.sqrt(settleDistancePx / decelerationPxPerMs) * 4; + + settleDuration = Math.max(MIN_SETTLE_DURATION, settleDuration); // How much of the animation to devote to playing the overshoot (the rest is for settle). float overshootFraction = (float) duration / (duration + settleDuration); duration += settleDuration; @@ -228,4 +234,4 @@ public class Interpolators { : settle.getInterpolation(t); } } -}
\ No newline at end of file +} |