diff options
author | Winson <winsonc@google.com> | 2015-08-21 11:16:27 -0700 |
---|---|---|
committer | Winson <winsonc@google.com> | 2015-09-28 17:32:19 -0700 |
commit | c088049113c261331b5685e64050d14a31cd72df (patch) | |
tree | 404a01d25361b6df9b754ec29ff3e4d053fe6bb8 /src/com/android/launcher3/BaseRecyclerViewFastScrollPopup.java | |
parent | 5189454083640c81bf3a171422b3ef114f150a77 (diff) | |
download | android_packages_apps_Trebuchet-c088049113c261331b5685e64050d14a31cd72df.tar.gz android_packages_apps_Trebuchet-c088049113c261331b5685e64050d14a31cd72df.tar.bz2 android_packages_apps_Trebuchet-c088049113c261331b5685e64050d14a31cd72df.zip |
Highlighting sectioned apps on fast-scroll.
- This CL fixes an old assumption we had about the height
of rows in AllApps, and ensures that we account for the
difference in height between the predictive icons and the
normal icons.
- In addition, we refactor FastBitmapDrawable to have multiple
states, which it manages in drawing itself, including the
press state and fast scroll focus states. And we also refactor
some of the fast scroll logic in the all apps recycler view
out to its own class.
Change-Id: I1988159b2767df733bbbfc7dc601859cde6c9943
Diffstat (limited to 'src/com/android/launcher3/BaseRecyclerViewFastScrollPopup.java')
-rw-r--r-- | src/com/android/launcher3/BaseRecyclerViewFastScrollPopup.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/com/android/launcher3/BaseRecyclerViewFastScrollPopup.java b/src/com/android/launcher3/BaseRecyclerViewFastScrollPopup.java index aeeb5156d..ebaba1880 100644 --- a/src/com/android/launcher3/BaseRecyclerViewFastScrollPopup.java +++ b/src/com/android/launcher3/BaseRecyclerViewFastScrollPopup.java @@ -77,26 +77,26 @@ public class BaseRecyclerViewFastScrollPopup { * Updates the bounds for the fast scroller. * @return the invalidation rect for this update. */ - public Rect updateFastScrollerBounds(BaseRecyclerView rv, int lastTouchY) { + public Rect updateFastScrollerBounds(int lastTouchY) { mInvalidateRect.set(mBgBounds); if (isVisible()) { // Calculate the dimensions and position of the fast scroller popup - int edgePadding = rv.getMaxScrollbarWidth(); + int edgePadding = mRv.getMaxScrollbarWidth(); int bgPadding = (mBgOriginalSize - mTextBounds.height()) / 2; int bgHeight = mBgOriginalSize; int bgWidth = Math.max(mBgOriginalSize, mTextBounds.width() + (2 * bgPadding)); if (Utilities.isRtl(mRes)) { - mBgBounds.left = rv.getBackgroundPadding().left + (2 * rv.getMaxScrollbarWidth()); + mBgBounds.left = mRv.getBackgroundPadding().left + (2 * mRv.getMaxScrollbarWidth()); mBgBounds.right = mBgBounds.left + bgWidth; } else { - mBgBounds.right = rv.getWidth() - rv.getBackgroundPadding().right - - (2 * rv.getMaxScrollbarWidth()); + mBgBounds.right = mRv.getWidth() - mRv.getBackgroundPadding().right - + (2 * mRv.getMaxScrollbarWidth()); mBgBounds.left = mBgBounds.right - bgWidth; } mBgBounds.top = lastTouchY - (int) (FAST_SCROLL_OVERLAY_Y_OFFSET_FACTOR * bgHeight); mBgBounds.top = Math.max(edgePadding, - Math.min(mBgBounds.top, rv.getHeight() - edgePadding - bgHeight)); + Math.min(mBgBounds.top, mRv.getHeight() - edgePadding - bgHeight)); mBgBounds.bottom = mBgBounds.top + bgHeight; } else { mBgBounds.setEmpty(); |