diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2017-06-29 16:07:38 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2017-06-29 16:07:38 +0000 |
commit | fca68a383e9952e21256382de70ae6e144b3cc9f (patch) | |
tree | 9a0b9c68bfd5cfa322b42436a469c863f8870f55 /src/com/android/launcher3/allapps | |
parent | 985cfe9ee4db4828945b21c399bb2617a6e38d90 (diff) | |
parent | 35cb8aefea8b66875fc8a5d98a44a289420c4d3c (diff) | |
download | android_packages_apps_Trebuchet-fca68a383e9952e21256382de70ae6e144b3cc9f.tar.gz android_packages_apps_Trebuchet-fca68a383e9952e21256382de70ae6e144b3cc9f.tar.bz2 android_packages_apps_Trebuchet-fca68a383e9952e21256382de70ae6e144b3cc9f.zip |
Merge "Polish for all apps physics." into ub-launcher3-dorval-polish
Diffstat (limited to 'src/com/android/launcher3/allapps')
3 files changed, 8 insertions, 4 deletions
diff --git a/src/com/android/launcher3/allapps/AllAppsContainerView.java b/src/com/android/launcher3/allapps/AllAppsContainerView.java index 189b9358f..499eb4588 100644 --- a/src/com/android/launcher3/allapps/AllAppsContainerView.java +++ b/src/com/android/launcher3/allapps/AllAppsContainerView.java @@ -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); } } diff --git a/src/com/android/launcher3/allapps/AllAppsRecyclerView.java b/src/com/android/launcher3/allapps/AllAppsRecyclerView.java index a2bd43d84..34421bdac 100644 --- a/src/com/android/launcher3/allapps/AllAppsRecyclerView.java +++ b/src/com/android/launcher3/allapps/AllAppsRecyclerView.java @@ -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, diff --git a/src/com/android/launcher3/allapps/AllAppsTransitionController.java b/src/com/android/launcher3/allapps/AllAppsTransitionController.java index 4d112c632..0859e0658 100644 --- a/src/com/android/launcher3/allapps/AllAppsTransitionController.java +++ b/src/com/android/launcher3/allapps/AllAppsTransitionController.java @@ -228,7 +228,8 @@ public class AllAppsTransitionController implements TouchController, VerticalPul } mLauncher.showAppsView(true /* animated */, false /* updatePredictedApps */); if (hasSpringAnimationHandler()) { - mSpringAnimationHandler.animateToFinalPosition(0); + // The icons are moving upwards, so we go to 0 from 1. (y-axis 1 is below 0.) + mSpringAnimationHandler.animateToFinalPosition(0 /* pos */, 1 /* startValue */); } } else { calculateDuration(velocity, Math.abs(mShiftRange - mAppsView.getTranslationY())); |