summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorRomain Guy <romainguy@android.com>2009-12-03 17:13:02 -0800
committerRomain Guy <romainguy@android.com>2009-12-04 10:21:55 -0800
commitecd80ee31c23ac067bb420f44f046682c499e83c (patch)
tree2739af342cc3b8b9fd681f9623e99983f79a0717 /core
parent678c2e35768a5426b4ad8f67c836008e7751a353 (diff)
downloadframeworks_base-ecd80ee31c23ac067bb420f44f046682c499e83c.zip
frameworks_base-ecd80ee31c23ac067bb420f44f046682c499e83c.tar.gz
frameworks_base-ecd80ee31c23ac067bb420f44f046682c499e83c.tar.bz2
Fix invalidate code path (#2273209).
Cached views would, in some situations, not update if they contained an animating child. This was caused by clearing the dirty cache flag too early in View.buildDrawingCache(). Approved by Dr. No mcleron. Change-Id: I8c5f2fc3e6605657e0da625d60d50b55bb133666
Diffstat (limited to 'core')
-rw-r--r--core/java/android/view/View.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 0b87536..1fc3678 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -4324,8 +4324,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility
requestLayout();
invalidate();
- if (((mViewFlags & VISIBILITY_MASK) == GONE) && hasFocus()) {
- clearFocus();
+ if (((mViewFlags & VISIBILITY_MASK) == GONE)) {
+ if (hasFocus()) clearFocus();
+ destroyDrawingCache();
}
if (mAttachInfo != null) {
mAttachInfo.mViewVisibilityChanged = true;
@@ -6283,6 +6284,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility
canvas.translate(-mScrollX, -mScrollY);
mPrivateFlags |= DRAWN;
+ mPrivateFlags |= DRAWING_CACHE_VALID;
// Fast path for layouts with no backgrounds
if ((mPrivateFlags & SKIP_DRAW) == SKIP_DRAW) {
@@ -6301,7 +6303,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility
// Restore the cached Canvas for our siblings
attachInfo.mCanvas = canvas;
}
- mPrivateFlags |= DRAWING_CACHE_VALID;
}
}