From 78bd9835eb99fd829026a05dc543c6708367ca5b Mon Sep 17 00:00:00 2001 From: Svetoslav Ganov Date: Mon, 15 Oct 2012 19:12:29 -0700 Subject: Accessibility focus drawing does not take into account view's transformation matrix. 1. We are using the view drawing bounds but did not take into account the transformation matrix. This leads to showing ugly artifacts on the launcher's hotseat which is pretty much the first thing we see. 2. Updated the documentation of View.getDrawingRect to be more explicit that the results does not have the transformation matrix applied. bug:7354033 Change-Id: Ief2e0ea8da05471d71e215ce4497d94ff6e92d1a --- core/java/android/view/ViewRootImpl.java | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (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 0475283..91df4b5 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -29,12 +29,14 @@ import android.content.res.CompatibilityInfo; import android.content.res.Configuration; import android.content.res.Resources; import android.graphics.Canvas; +import android.graphics.Matrix; import android.graphics.Paint; import android.graphics.PixelFormat; import android.graphics.Point; import android.graphics.PointF; import android.graphics.PorterDuff; import android.graphics.Rect; +import android.graphics.RectF; import android.graphics.Region; import android.graphics.drawable.Drawable; import android.media.AudioManager; @@ -2319,24 +2321,14 @@ public final class ViewRootImpl implements ViewParent, mAccessibilityFocusedHost.getAccessibilityNodeProvider(); Rect bounds = mView.mAttachInfo.mTmpInvalRect; if (provider == null) { - mAccessibilityFocusedHost.getDrawingRect(bounds); - if (mView instanceof ViewGroup) { - ViewGroup viewGroup = (ViewGroup) mView; - try { - viewGroup.offsetDescendantRectToMyCoords(mAccessibilityFocusedHost, bounds); - } catch (IllegalArgumentException iae) { - Log.e(TAG, "Temporary detached view that was neither removed not reattached: " - + mAccessibilityFocusedHost); - return; - } - } + mAccessibilityFocusedHost.getBoundsOnScreen(bounds); } else { if (mAccessibilityFocusedVirtualView == null) { return; } mAccessibilityFocusedVirtualView.getBoundsInScreen(bounds); - bounds.offset(-mAttachInfo.mWindowLeft, -mAttachInfo.mWindowTop); } + bounds.offset(-mAttachInfo.mWindowLeft, -mAttachInfo.mWindowTop); drawable.setBounds(bounds); drawable.draw(canvas); } -- cgit v1.1