diff options
Diffstat (limited to 'src/com/android/launcher3/allapps/AllAppsRecyclerView.java')
-rw-r--r-- | src/com/android/launcher3/allapps/AllAppsRecyclerView.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/com/android/launcher3/allapps/AllAppsRecyclerView.java b/src/com/android/launcher3/allapps/AllAppsRecyclerView.java index 25918ce31..ff327dae3 100644 --- a/src/com/android/launcher3/allapps/AllAppsRecyclerView.java +++ b/src/com/android/launcher3/allapps/AllAppsRecyclerView.java @@ -39,6 +39,7 @@ public class AllAppsRecyclerView extends BaseRecyclerView private int mNumAppsPerRow; private int mNumPredictedAppsPerRow; private int mPredictionBarHeight; + private int mLastFastscrollPosition = -1; private Launcher mLauncher; @@ -131,6 +132,11 @@ public class AllAppsRecyclerView extends BaseRecyclerView } } + @Override + protected void onFastScrollingEnd() { + mLastFastscrollPosition = -1; + } + /** * Maps the touch (from 0..1) to the adapter position that should be visible. */ @@ -174,12 +180,14 @@ public class AllAppsRecyclerView extends BaseRecyclerView // Scroll to the view at the position, anchored at the top of the screen. We call the scroll // method on the LayoutManager directly since it is not exposed by RecyclerView. - layoutManager.scrollToPositionWithOffset(lastScrollSection.appItem.position, 0); + if (mLastFastscrollPosition != lastScrollSection.appItem.position) { + mLastFastscrollPosition = lastScrollSection.appItem.position; + layoutManager.scrollToPositionWithOffset(lastScrollSection.appItem.position, 0); + } return lastScrollSection.sectionName; } - /** * Returns the row index for a app index in the list. */ |