mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-03 01:16:49 +00:00
Polish for all apps physics.
By adjusting the start value based on the direction of the scroll, the springs will appear more smooth. This only changes the appearance of the spring when scrolling down, since the start value has always been 1 and thus looked fine when scrolling up. Bug: 38349031 Change-Id: I563e6e7cfdbc74c4a95adb22f90d5efe17dfa453
This commit is contained in:
@@ -511,7 +511,9 @@ public class AllAppsRecyclerView extends BaseRecyclerView {
|
||||
if (FeatureFlags.LAUNCHER3_PHYSICS) {
|
||||
// We calculate our own velocity to give the springs the desired effect.
|
||||
velocity = y / getDampedOverScroll(getHeight()) * MAX_RELEASE_VELOCITY;
|
||||
mSpringAnimationHandler.animateToPositionWithVelocity(0, -velocity);
|
||||
// We want to negate the velocity because we are moving to 0 from -1 due to the
|
||||
// downward motion. (y-axis -1 is above 0).
|
||||
mSpringAnimationHandler.animateToPositionWithVelocity(0, -1, -velocity);
|
||||
}
|
||||
|
||||
ObjectAnimator.ofFloat(AllAppsRecyclerView.this,
|
||||
|
||||
Reference in New Issue
Block a user