summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSvetoslav Ganov <svetoslavganov@google.com>2012-10-15 19:12:29 -0700
committerSvetoslav Ganov <svetoslavganov@google.com>2012-10-15 19:13:29 -0700
commit78bd9835eb99fd829026a05dc543c6708367ca5b (patch)
treef896d049df5a139df45332f8fa18cd74a5ed6a35
parent7789c9bbfca079655e9285173d6175b94bc774b0 (diff)
downloadframeworks_base-78bd9835eb99fd829026a05dc543c6708367ca5b.zip
frameworks_base-78bd9835eb99fd829026a05dc543c6708367ca5b.tar.gz
frameworks_base-78bd9835eb99fd829026a05dc543c6708367ca5b.tar.bz2
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
-rw-r--r--core/java/android/view/View.java6
-rw-r--r--core/java/android/view/ViewRootImpl.java16
2 files changed, 8 insertions, 14 deletions
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 158e0c0..b4ba871 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -4906,7 +4906,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
*
* @param outRect The output location
*/
- private void getBoundsOnScreen(Rect outRect) {
+ void getBoundsOnScreen(Rect outRect) {
if (mAttachInfo == null) {
return;
}
@@ -8661,7 +8661,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
/**
* Return the visible drawing bounds of your view. Fills in the output
* rectangle with the values from getScrollX(), getScrollY(),
- * getWidth(), and getHeight().
+ * getWidth(), and getHeight(). These bounds do not account for any
+ * transformation properties currently set on the view, such as
+ * {@link #setScaleX(float)} or {@link #setRotation(float)}.
*
* @param outRect The (scrolled) drawing bounds of the view.
*/
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);
}