diff options
Diffstat (limited to 'core/java/android/view/ViewGroup.java')
-rw-r--r-- | core/java/android/view/ViewGroup.java | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java index 9e5b23c..d4efdb6 100644 --- a/core/java/android/view/ViewGroup.java +++ b/core/java/android/view/ViewGroup.java @@ -17,6 +17,7 @@ package android.view; import android.animation.LayoutTransition; +import android.view.animation.AlphaAnimation; import com.android.internal.R; import com.android.internal.util.Predicate; @@ -2364,6 +2365,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager DisplayList displayList = null; Bitmap cache = null; + boolean hasDisplayList = false; if (caching) { if (!canvas.isHardwareAccelerated()) { if (layerType != LAYER_TYPE_NONE) { @@ -2376,12 +2378,13 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager child.buildDrawingCache(true); cache = child.getDrawingCache(true); } else if (layerType == LAYER_TYPE_NONE) { - displayList = child.getDisplayList(); + // Delay getting the display list until animation-driven alpha values are + // set up and possibly passed on to the view + hasDisplayList = true; } } } - final boolean hasDisplayList = displayList != null && displayList.isReady(); final boolean hasNoCache = cache == null || hasDisplayList; final int restoreTo = canvas.save(); @@ -2472,6 +2475,10 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager } } + if (hasDisplayList) { + displayList = child.getDisplayList(); + } + if (hasNoCache) { boolean layerRendered = false; if (layerType == LAYER_TYPE_HARDWARE) { @@ -2529,7 +2536,9 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager canvas.restoreToCount(restoreTo); if (a != null && !more) { - child.onSetAlpha(255); + if (!canvas.isHardwareAccelerated() && !a.getFillAfter()) { + child.onSetAlpha(255); + } finishAnimatingView(child, a); } @@ -2538,6 +2547,10 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager // display lists to render, force an invalidate to allow the animation to // continue drawing another frame invalidate(); + if (a instanceof AlphaAnimation) { + // alpha animations should cause the child to recreate its display list + child.invalidate(); + } } child.mRecreateDisplayList = false; |