summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKamaljeet Maini <kmaini@cyngn.com>2016-03-17 17:25:48 -0700
committerKamaljeet Maini <kmaini@cyngn.com>2016-03-28 10:21:16 -0700
commit49b48d3226caee4b39289f30173a49da69a00352 (patch)
tree723f0d58b385ae681f9e7093adbfcbe423ff2735
parent681f47db087a5ccc9acef54352fd916d9ce23548 (diff)
downloadandroid_packages_apps_Trebuchet-49b48d3226caee4b39289f30173a49da69a00352.tar.gz
android_packages_apps_Trebuchet-49b48d3226caee4b39289f30173a49da69a00352.tar.bz2
android_packages_apps_Trebuchet-49b48d3226caee4b39289f30173a49da69a00352.zip
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 (cherry picked from commit c8e0058a59463c334282df592207e38183ae4243)
-rw-r--r--src/com/android/launcher3/allapps/AllAppsContainerView.java18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/com/android/launcher3/allapps/AllAppsContainerView.java b/src/com/android/launcher3/allapps/AllAppsContainerView.java
index 8e4491180..989148f89 100644
--- a/src/com/android/launcher3/allapps/AllAppsContainerView.java
+++ b/src/com/android/launcher3/allapps/AllAppsContainerView.java
@@ -485,7 +485,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")