Converting widget panel into a floating view

> The widget panel is only inflated when needed
> Using the swipe up/down interaction for widgets tray
> Removing additional view wrappers from all-apps
> Widget tray is preserved across activity recreation
> Launcher no longer has WIDGET state, the actual code around
  the states will be removed in a follow-up cl

Bug: 67678570
Bug: 67585158
Change-Id: Ia29a7c33ec81e6c53cc24e2906b7022b6f41755b
This commit is contained in:
Sunny Goyal
2017-10-10 15:21:15 -07:00
parent 10a1bd0e65
commit f1fbc3fbe7
33 changed files with 1026 additions and 1611 deletions

View File

@@ -285,7 +285,7 @@ public class RecyclerViewFastScroller extends View {
return;
}
int saveCount = canvas.save(Canvas.MATRIX_SAVE_FLAG);
canvas.translate(getWidth() / 2, mRv.getPaddingTop());
canvas.translate(getWidth() / 2, mRv.getScrollBarTop());
// Draw the track
float halfW = mWidth / 2;
canvas.drawRoundRect(-halfW, 0, halfW, mRv.getScrollbarTrackHeight(),
@@ -317,7 +317,7 @@ public class RecyclerViewFastScroller extends View {
* Returns whether the specified point is inside the thumb bounds.
*/
private boolean isNearThumb(int x, int y) {
int offset = y - mRv.getPaddingTop() - mThumbOffsetY;
int offset = y - mRv.getScrollBarTop() - mThumbOffsetY;
return x >= 0 && x < getWidth() && offset >= 0 && offset <= mThumbHeight;
}
@@ -348,7 +348,7 @@ public class RecyclerViewFastScroller extends View {
private void updatePopupY(int lastTouchY) {
int height = mPopupView.getHeight();
float top = lastTouchY - (FAST_SCROLL_OVERLAY_Y_OFFSET_FACTOR * height)
+ mRv.getPaddingTop();
+ mRv.getScrollBarTop();
top = Utilities.boundToRange(top,
mMaxWidth, mRv.getScrollbarTrackHeight() - mMaxWidth - height);
mPopupView.setTranslationY(top);