summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKamaljeet Maini <kmaini@cyngn.com>2016-03-18 00:25:48 (GMT)
committerGerrit Code Review <gerrit@cyanogenmod.org>2016-03-25 17:35:14 (GMT)
commitc8e0058a59463c334282df592207e38183ae4243 (patch)
treee613bc1f586b6cfd024f88518af30a069a6afbf1
parente812052ff07a96e5008fdfea671357c74baf21e3 (diff)
downloadandroid_packages_apps_Trebuchet-c8e0058a59463c334282df592207e38183ae4243.zip
android_packages_apps_Trebuchet-c8e0058a59463c334282df592207e38183ae4243.tar.gz
android_packages_apps_Trebuchet-c8e0058a59463c334282df592207e38183ae4243.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 8e44911..989148f 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")