diff options
Diffstat (limited to 'src/com/android/launcher3/allapps')
-rw-r--r-- | src/com/android/launcher3/allapps/AllAppsContainerView.java | 2 | ||||
-rw-r--r-- | src/com/android/launcher3/allapps/AllAppsRecyclerView.java | 13 |
2 files changed, 7 insertions, 8 deletions
diff --git a/src/com/android/launcher3/allapps/AllAppsContainerView.java b/src/com/android/launcher3/allapps/AllAppsContainerView.java index 689ee3816..5c9e3f74e 100644 --- a/src/com/android/launcher3/allapps/AllAppsContainerView.java +++ b/src/com/android/launcher3/allapps/AllAppsContainerView.java @@ -272,7 +272,7 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc // IF scroller is at the very top OR there is no scroll bar because there is probably not // enough items to scroll, THEN it's okay for the container to be pulled down. - if (mAppsRecyclerView.getScrollBar().getThumbOffset().y <= 0) { + if (mAppsRecyclerView.getScrollBar().getThumbOffsetY() <= 0) { return true; } return false; diff --git a/src/com/android/launcher3/allapps/AllAppsRecyclerView.java b/src/com/android/launcher3/allapps/AllAppsRecyclerView.java index 0173847e0..5a9ea6bb3 100644 --- a/src/com/android/launcher3/allapps/AllAppsRecyclerView.java +++ b/src/com/android/launcher3/allapps/AllAppsRecyclerView.java @@ -299,14 +299,14 @@ public class AllAppsRecyclerView extends BaseRecyclerView { // Skip early if there are no items or we haven't been measured if (items.isEmpty() || mNumAppsPerRow == 0) { - mScrollbar.setThumbOffset(-1, -1); + mScrollbar.setThumbOffsetY(-1); return; } // Skip early if, there no child laid out in the container. int scrollY = getCurrentScrollY(); if (scrollY < 0) { - mScrollbar.setThumbOffset(-1, -1); + mScrollbar.setThumbOffsetY(-1); return; } @@ -314,7 +314,7 @@ public class AllAppsRecyclerView extends BaseRecyclerView { int availableScrollBarHeight = getAvailableScrollBarHeight(); int availableScrollHeight = getAvailableScrollHeight(); if (availableScrollHeight <= 0) { - mScrollbar.setThumbOffset(-1, -1); + mScrollbar.setThumbOffsetY(-1); return; } @@ -323,11 +323,10 @@ public class AllAppsRecyclerView extends BaseRecyclerView { // Calculate the current scroll position, the scrollY of the recycler view accounts // for the view padding, while the scrollBarY is drawn right up to the background // padding (ignoring padding) - int scrollBarX = getScrollBarX(); int scrollBarY = mBackgroundPadding.top + (int) (((float) scrollY / availableScrollHeight) * availableScrollBarHeight); - int thumbScrollY = mScrollbar.getThumbOffset().y; + int thumbScrollY = mScrollbar.getThumbOffsetY(); int diffScrollY = scrollBarY - thumbScrollY; if (diffScrollY * dy > 0f) { // User is scrolling in the same direction the thumb needs to catch up to the @@ -344,7 +343,7 @@ public class AllAppsRecyclerView extends BaseRecyclerView { thumbScrollY += Math.min(offset, diffScrollY); } thumbScrollY = Math.max(0, Math.min(availableScrollBarHeight, thumbScrollY)); - mScrollbar.setThumbOffset(scrollBarX, thumbScrollY); + mScrollbar.setThumbOffsetY(thumbScrollY); if (scrollBarY == thumbScrollY) { mScrollbar.reattachThumbToScroll(); } @@ -352,7 +351,7 @@ public class AllAppsRecyclerView extends BaseRecyclerView { // User is scrolling in an opposite direction to the direction that the thumb // needs to catch up to the scroll position. Do nothing except for updating // the scroll bar x to match the thumb width. - mScrollbar.setThumbOffset(scrollBarX, thumbScrollY); + mScrollbar.setThumbOffsetY(thumbScrollY); } } } else { |