summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKamaljeet Maini <kmaini@cyngn.com>2016-03-17 17:25:48 -0700
committerTom Powell <zifnab@zifnab06.net>2017-03-26 16:21:09 -0700
commitf770d76f0d2b443c949b61974a5012f04cc9f24d (patch)
tree33e70b0105eb1db862118e084f2960102b63e433
parentdfe008e91dfc3a9b35f7f375161746e21b5091e5 (diff)
downloadandroid_packages_apps_Trebuchet-f770d76f0d2b443c949b61974a5012f04cc9f24d.zip
android_packages_apps_Trebuchet-f770d76f0d2b443c949b61974a5012f04cc9f24d.tar.gz
android_packages_apps_Trebuchet-f770d76f0d2b443c949b61974a5012f04cc9f24d.tar.bz2
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
-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 298ede0..cc1c778 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")