From 167bc821ddfee3d6d3b1c0ea10636be7c6eb591a Mon Sep 17 00:00:00 2001 From: Adam Powell Date: Mon, 13 Sep 2010 18:11:08 -0700 Subject: [PATCH] Fix bug 2995805 - splitMotionEvents behavior change Changed the new split motion events behavior to match the enshrined behavior. A return value of false from a target's dispatchTouchEvent will not prevent the target from receiving further events in the gesture unless it is the initial ACTION_DOWN event. Change-Id: Ied8d531dfec7009a4124ed670b1700753c3f9caa --- core/java/android/view/ViewGroup.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java index 3db05b60226de..012f3cc1b8eab 100644 --- a/core/java/android/view/ViewGroup.java +++ b/core/java/android/view/ViewGroup.java @@ -877,7 +877,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager mSplitMotionTargets = new SplitMotionTargets(); } return dispatchSplitTouchEvent(ev); - } + } final int action = ev.getAction(); final float xf = ev.getX(); @@ -1222,13 +1222,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager uniqueTargetCount--; } - final boolean childHandled = target.dispatchTouchEvent(targetEvent); - handled |= childHandled; - if (!childHandled) { - // Child doesn't want these events anymore, but we're still dispatching - // other split events to children. - targets.removeView(target); - } + handled |= target.dispatchTouchEvent(targetEvent); } finally { targetEvent.recycle(); }