mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-01 00:06:47 +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:
@@ -423,8 +423,9 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc
|
||||
|
||||
// We only show the spring animation when at the top or bottom, so we wait until the
|
||||
// first or last row is visible to ensure that all animations run in sync.
|
||||
if ((first == 0 && dy < 0) || (last == mAdapter.getItemCount() - 1 && dy > 0)) {
|
||||
mSpringAnimationHandler.animateToFinalPosition(0);
|
||||
boolean scrollUp = dy < 0;
|
||||
if ((first == 0 && scrollUp) || (last == mAdapter.getItemCount() - 1 && dy > 0)) {
|
||||
mSpringAnimationHandler.animateToFinalPosition(0, scrollUp ? 1 : -1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user