From f770d76f0d2b443c949b61974a5012f04cc9f24d Mon Sep 17 00:00:00 2001 From: Kamaljeet Maini Date: Thu, 17 Mar 2016 17:25:48 -0700 Subject: Ignore tap below scrubber in the app container padding area When user taps on the padding area of all apps container below the scrubber, the tap should be ignored. Before this patch, the tap was sent back to parent view, which led to scrolling of the background wallpaper. Now the tap is ignored. Change-Id: Ic8840c9eafaf254d2bfbffe556f3dc7ab20fdccc Issue-Id: CyanogenOS/CYNGNOS-1933 --- .../launcher3/allapps/AllAppsContainerView.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/com/android/launcher3/allapps/AllAppsContainerView.java b/src/com/android/launcher3/allapps/AllAppsContainerView.java index 298ede02b..cc1c778ab 100644 --- a/src/com/android/launcher3/allapps/AllAppsContainerView.java +++ b/src/com/android/launcher3/allapps/AllAppsContainerView.java @@ -536,7 +536,23 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc @SuppressLint("ClickableViewAccessibility") @Override public boolean onTouchEvent(MotionEvent ev) { - return handleTouchEvent(ev); + int y = (int) ev.getY(); + int[] location = new int[2]; + int height = 0; + + // Ignore the touch if it is below scrubber (if enabled) or below app recycler view + if (useScroller() && useScrubber()) { + mScrubber.getLocationInWindow(location); + height = mScrubber.getHeight(); + } else { + mAppsRecyclerView.getLocationInWindow(location); + height = mAppsRecyclerView.getHeight(); + } + if (y >= location[1] + height) { + return true; + } else { + return handleTouchEvent(ev); + } } @SuppressLint("ClickableViewAccessibility") -- cgit v1.2.3