Fix an edge case in computing click location in accessibility mode.

In accessibility mode to click a view we computed a point where to send
down and up touch events. The logic that computes where to send the
events was not clipping the bounds of the child to these of the parent.
As a result we wrongly computed we can send the events in a location
of the child that is outside of its parent, thus the click having no
effect or clicking the wrong thing.

bug:18672945

Change-Id: If9c452e7e5b196f699db33d37dbc6775d5d1622a
This commit is contained in:
Svet Ganov
2014-12-11 22:33:45 -08:00
parent 8b33cf4d34
commit 9fc96c5371

View File

@@ -825,6 +825,12 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
return false;
}
// Clip the bounds by our bounds.
bounds.left = Math.max(bounds.left, 0);
bounds.top = Math.max(bounds.top, 0);
bounds.right = Math.min(bounds.right, mRight);
bounds.bottom = Math.min(bounds.bottom, mBottom);
Iterator<View> iterator = obtainOrderedChildIterator();
while (iterator.hasNext()) {
View sibling = iterator.next();