Updating fast scrollbar UI in Landscape

Creating a separate view for FastScrollBar and moving all the relavant logic in
the view.
For protrait, the touch handling is delegated by the recycler view just like before.
For landscape, the dcrollbar does not overlay with recyclerView and handles the touch
itself

Bug: 37015359
Change-Id: Ie1981326457ba739bdf0ac8063db1065f395f133
This commit is contained in:
Sunny Goyal
2017-06-23 16:12:50 -07:00
parent bbe504d24d
commit 89d5c5a31b
18 changed files with 427 additions and 273 deletions

View File

@@ -171,19 +171,19 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc
* Returns whether the view itself will handle the touch event or not.
*/
public boolean shouldContainerScroll(MotionEvent ev) {
int[] point = new int[2];
point[0] = (int) ev.getX();
point[1] = (int) ev.getY();
Utilities.mapCoordInSelfToDescendant(mAppsRecyclerView, this, point);
// IF the MotionEvent is inside the search box, and the container keeps on receiving
// touch input, container should move down.
if (mLauncher.getDragLayer().isEventOverView(mSearchContainer, ev)) {
return true;
}
int[] point = new int[2];
point[0] = (int) ev.getX();
point[1] = (int) ev.getY();
Utilities.mapCoordInSelfToDescendant(
mAppsRecyclerView.getScrollBar(), mLauncher.getDragLayer(), point);
// IF the MotionEvent is inside the thumb, container should not be pulled down.
if (mAppsRecyclerView.getScrollBar().isNearThumb(point[0], point[1])) {
if (mAppsRecyclerView.getScrollBar().shouldBlockIntercept(point[0], point[1])) {
return false;
}