diff options
author | Jon Miranda <jonmiranda@google.com> | 2017-06-07 13:17:19 -0700 |
---|---|---|
committer | Jon Miranda <jonmiranda@google.com> | 2017-06-07 13:17:19 -0700 |
commit | 75de76f917370e814f53500e0e4f2b4c640e69e1 (patch) | |
tree | 50dcc031827b8494a627e4abc5dcd0318d478cb2 /src/com/android/launcher3/allapps | |
parent | f6add46e5eb7e63f6cbf625df2e3c14642ef90b4 (diff) | |
download | android_packages_apps_Trebuchet-75de76f917370e814f53500e0e4f2b4c640e69e1.tar.gz android_packages_apps_Trebuchet-75de76f917370e814f53500e0e4f2b4c640e69e1.tar.bz2 android_packages_apps_Trebuchet-75de76f917370e814f53500e0e4f2b4c640e69e1.zip |
Fix bug where physics appears not to run in all apps.
ie. When scrolling up from the bottom, the animation will immediately
start since the last visible item condition is true — and by the time
it reaches the top the spring is done moving.
Bug: 38349031
Change-Id: I344deef47c50b33405345dd3a137ccdb12aeae02
Diffstat (limited to 'src/com/android/launcher3/allapps')
-rw-r--r-- | src/com/android/launcher3/allapps/AllAppsContainerView.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/com/android/launcher3/allapps/AllAppsContainerView.java b/src/com/android/launcher3/allapps/AllAppsContainerView.java index a399d748a..f1616fc09 100644 --- a/src/com/android/launcher3/allapps/AllAppsContainerView.java +++ b/src/com/android/launcher3/allapps/AllAppsContainerView.java @@ -20,7 +20,6 @@ import android.graphics.Color; import android.graphics.Rect; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.InsetDrawable; -import android.support.v7.widget.GridLayoutManager; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.text.Selection; @@ -426,8 +425,11 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc @Override public void onScrolled(RecyclerView recyclerView, int dx, int dy) { - if (mScrollState == RecyclerView.SCROLL_STATE_DRAGGING) { - mSpringAnimationHandler.skipToEnd(); + if (mScrollState == RecyclerView.SCROLL_STATE_DRAGGING + || (dx == 0 && dy == 0)) { + if (mSpringAnimationHandler.isRunning()){ + mSpringAnimationHandler.skipToEnd(); + } return; } @@ -436,7 +438,7 @@ 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 || last >= mAdapter.getItemCount() - mAdapter.getNumAppsPerRow()) { + if ((first == 0 && dy < 0) || (last == mAdapter.getItemCount() - 1 && dy > 0)) { mSpringAnimationHandler.animateToFinalPosition(0); } } |