diff options
| author | Chet Haase <chet@google.com> | 2011-01-26 23:55:50 -0800 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2011-01-26 23:55:50 -0800 |
| commit | 82782446cd0ea26604fcbd22d4b7e3608f32136d (patch) | |
| tree | fec4198011f0f63b93c6cace1dac7fad99091628 /core/java/android | |
| parent | a21e75c97ab7522acf5dea46039cbf7090fa0e4f (diff) | |
| parent | fcf51a67967a402bf2178c3d0e09828e8942cade (diff) | |
| download | frameworks_base-82782446cd0ea26604fcbd22d4b7e3608f32136d.zip frameworks_base-82782446cd0ea26604fcbd22d4b7e3608f32136d.tar.gz frameworks_base-82782446cd0ea26604fcbd22d4b7e3608f32136d.tar.bz2 | |
am fcf51a67: am a45c056e: Merge "Fix display List bugs" into honeycomb
* commit 'fcf51a67967a402bf2178c3d0e09828e8942cade':
Fix display List bugs
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/view/View.java | 13 | ||||
| -rw-r--r-- | core/java/android/view/ViewGroup.java | 19 |
2 files changed, 22 insertions, 10 deletions
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index 196cad0..fc999b0 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -2937,13 +2937,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility } /** - * Gets the current list of listeners for layout changes. - */ - public List<OnLayoutChangeListener> getOnLayoutChangeListeners() { - return mOnLayoutChangeListeners; - } - - /** * Returns the focus-change callback registered for this view. * * @return The callback, or null if one is not registered. @@ -6052,6 +6045,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility invalidate(true); } mBackgroundSizeChanged = true; + invalidateParentIfNeeded(); } } @@ -6118,6 +6112,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility invalidate(true); } mBackgroundSizeChanged = true; + invalidateParentIfNeeded(); } } @@ -6178,6 +6173,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility invalidate(true); } mBackgroundSizeChanged = true; + invalidateParentIfNeeded(); } } @@ -6235,6 +6231,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility invalidate(true); } mBackgroundSizeChanged = true; + invalidateParentIfNeeded(); } } @@ -6479,6 +6476,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility mPrivateFlags |= DRAWN; // force another invalidation with the new orientation invalidate(false); } + invalidateParentIfNeeded(); } } @@ -6517,6 +6515,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility mPrivateFlags |= DRAWN; // force another invalidation with the new orientation invalidate(false); } + invalidateParentIfNeeded(); } } diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java index 8e23ae8..f74c5de 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; @@ -2377,6 +2378,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) { @@ -2389,12 +2391,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(); @@ -2485,6 +2488,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) { @@ -2542,7 +2549,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); } @@ -2551,6 +2560,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; |
