Adding support for top padding in BaseRecyclerView. The scrollbar is
drawn below the top padding.
Also adding callback for getting the all-apps vertical pull range
so that it can be controlled by SearchUiManager
Bug: 37616877
Change-Id: Ib4642073f3e92f6676caede3bddd652fda89c86f
diff --git a/src/com/android/launcher3/BaseRecyclerView.java b/src/com/android/launcher3/BaseRecyclerView.java
index c056336..1e6d894 100644
--- a/src/com/android/launcher3/BaseRecyclerView.java
+++ b/src/com/android/launcher3/BaseRecyclerView.java
@@ -113,6 +113,7 @@
* it is already showing).
*/
private boolean handleTouchEvent(MotionEvent ev) {
+ ev.offsetLocation(0, -getPaddingTop());
int action = ev.getAction();
int x = (int) ev.getX();
int y = (int) ev.getY();
@@ -136,6 +137,7 @@
mScrollbar.handleTouchEvent(ev, mDownX, mDownY, mLastY);
break;
}
+ ev.offsetLocation(0, getPaddingTop());
return mScrollbar.isDraggingThumb();
}
@@ -162,7 +164,7 @@
* Returns the height of the fast scroll bar
*/
protected int getScrollbarTrackHeight() {
- return getHeight();
+ return getHeight() - getPaddingTop() - getPaddingBottom();
}
/**