summaryrefslogtreecommitdiffstats
path: root/src/com/android
diff options
context:
space:
mode:
authorHyunyoung Song <hyunyoungs@google.com>2016-08-05 13:57:21 -0700
committerHyunyoung Song <hyunyoungs@google.com>2016-08-05 13:57:21 -0700
commit58a9c4b7d2aa3772f56fea32f82cf29d410dc499 (patch)
tree61e237bf00b52f970aea43205ed8a637e13df1c6 /src/com/android
parent598e1843526e16814eeb4c310c9faec5bc3b7ae9 (diff)
downloadandroid_packages_apps_Trebuchet-58a9c4b7d2aa3772f56fea32f82cf29d410dc499.tar.gz
android_packages_apps_Trebuchet-58a9c4b7d2aa3772f56fea32f82cf29d410dc499.tar.bz2
android_packages_apps_Trebuchet-58a9c4b7d2aa3772f56fea32f82cf29d410dc499.zip
Pull down should work on search box, even if all apps scroll is not at top.
b/30295305 Change-Id: I38bbe47d6e33929c550930c9f157c58fbea203ef
Diffstat (limited to 'src/com/android')
-rw-r--r--src/com/android/launcher3/allapps/AllAppsContainerView.java14
-rw-r--r--src/com/android/launcher3/allapps/AllAppsTransitionController.java2
-rw-r--r--src/com/android/launcher3/dragndrop/DragLayer.java2
3 files changed, 12 insertions, 6 deletions
diff --git a/src/com/android/launcher3/allapps/AllAppsContainerView.java b/src/com/android/launcher3/allapps/AllAppsContainerView.java
index d8601893e..b4ca7eded 100644
--- a/src/com/android/launcher3/allapps/AllAppsContainerView.java
+++ b/src/com/android/launcher3/allapps/AllAppsContainerView.java
@@ -259,13 +259,19 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc
/**
* Returns whether the view itself will handle the touch event or not.
*/
- public boolean shouldContainerScroll(float x, float y) {
+ public boolean shouldContainerScroll(MotionEvent ev) {
int[] point = new int[2];
- point[0] = (int) x;
- point[1] = (int) y;
+ point[0] = (int) ev.getX();
+ point[1] = (int) ev.getY();
Utilities.mapCoordInSelfToDescendent(mAppsRecyclerView, this, point);
- // if the MotionEvent is inside the thumb, container should not be pulled down.
+ // 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;
+ }
+
+ // IF the MotionEvent is inside the thumb, container should not be pulled down.
if (mAppsRecyclerView.getScrollBar().isNearThumb(point[0], point[1])) {
return false;
}
diff --git a/src/com/android/launcher3/allapps/AllAppsTransitionController.java b/src/com/android/launcher3/allapps/AllAppsTransitionController.java
index b0a62e1de..337de46ae 100644
--- a/src/com/android/launcher3/allapps/AllAppsTransitionController.java
+++ b/src/com/android/launcher3/allapps/AllAppsTransitionController.java
@@ -111,7 +111,7 @@ public class AllAppsTransitionController implements TouchController, VerticalPul
if (mLauncher.getWorkspace().isInOverviewMode() || mLauncher.isWidgetsViewVisible()) {
mNoIntercept = true;
} else if (mLauncher.isAllAppsVisible() &&
- !mAppsView.shouldContainerScroll(ev.getX(), ev.getY())) {
+ !mAppsView.shouldContainerScroll(ev)) {
mNoIntercept = true;
} else if (!mLauncher.isAllAppsVisible() && !shouldPossiblyIntercept(ev)) {
mNoIntercept = true;
diff --git a/src/com/android/launcher3/dragndrop/DragLayer.java b/src/com/android/launcher3/dragndrop/DragLayer.java
index 448f70943..e88e77e20 100644
--- a/src/com/android/launcher3/dragndrop/DragLayer.java
+++ b/src/com/android/launcher3/dragndrop/DragLayer.java
@@ -207,7 +207,7 @@ public class DragLayer extends InsettableFrameLayout {
return isEventOverView(mLauncher.getDropTargetBar(), ev);
}
- private boolean isEventOverView(View view, MotionEvent ev) {
+ public boolean isEventOverView(View view, MotionEvent ev) {
getDescendantRectRelativeToSelf(view, mHitRect);
return mHitRect.contains((int) ev.getX(), (int) ev.getY());
}