Offset accessibility focus rect for view root's scrollY

Previously we were only partially transforming the focus rect into
window coordinates, so it was offset when the window was panned (for
example, when the IME was showing).

Bug: 20113389
Change-Id: I41f5ed20cb1404232b7042d37ca2fc725f9ee476
This commit is contained in:
Alan Viverette
2015-05-26 15:24:18 -07:00
parent 9b232f56ff
commit 2232adddc5

View File

@@ -2787,7 +2787,9 @@ public final class ViewRootImpl implements ViewParent,
return false;
}
// Transform the rect into window-relative coordinates.
final AttachInfo attachInfo = mAttachInfo;
bounds.offset(0, attachInfo.mViewRootImpl.mScrollY);
bounds.offset(-attachInfo.mWindowLeft, -attachInfo.mWindowTop);
bounds.intersect(0, 0, attachInfo.mViewRootImpl.mWidth, attachInfo.mViewRootImpl.mHeight);
return !bounds.isEmpty();