From 2232adddc56bb8764a95bbde0c05e0f02f6a1db5 Mon Sep 17 00:00:00 2001 From: Alan Viverette Date: Tue, 26 May 2015 15:24:18 -0700 Subject: 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 --- core/java/android/view/ViewRootImpl.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'core/java/android/view/ViewRootImpl.java') diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index e59560f..89b91f1 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -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(); -- cgit v1.1