From c8a9a70c5fe1be7e22f861f40b8cf3a9cf147cb2 Mon Sep 17 00:00:00 2001 From: Chet Haase Date: Fri, 17 Jun 2011 12:13:42 -0700 Subject: Invisible views can't start animations The invalidation logic was broken for invisible views, causing a problem when an animation was set to start on an invisible view (to fade it in), but the view would not propagate the invalidation event that would trigger the start of the animation rendering. Fix: reset the DRAWN flag when a view becomes invisible to allow the invalidation logic to work as intended. Change-Id: Ibf49c6e8b39506a92a6e5f45cb8a12626ae4f931 --- core/java/android/view/View.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index b0e651a..eb0b7d0 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -6089,7 +6089,11 @@ public class View implements Drawable.Callback2, KeyEvent.Callback, Accessibilit /* Check if the VISIBLE bit has changed */ if ((changed & INVISIBLE) != 0) { needGlobalAttributesUpdate(false); - invalidate(true); + /* + * If this view is becoming invisible, set the DRAWN flag so that + * the next invalidate() will not be skipped. + */ + mPrivateFlags |= DRAWN; if (((mViewFlags & VISIBILITY_MASK) == INVISIBLE) && hasFocus()) { // root view becoming invisible shouldn't clear focus -- cgit v1.1