Loading core/java/android/view/ViewGroup.java +1 −1 Original line number Diff line number Diff line Loading @@ -2854,7 +2854,7 @@ 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(true); if (a instanceof AlphaAnimation) { if (a.hasAlpha()) { // alpha animations should cause the child to recreate its display list child.invalidate(true); } Loading core/java/android/view/animation/AlphaAnimation.java +8 −0 Original line number Diff line number Diff line Loading @@ -78,4 +78,12 @@ public class AlphaAnimation extends Animation { public boolean willChangeBounds() { return false; } /** * @hide */ @Override public boolean hasAlpha() { return true; } } core/java/android/view/animation/Animation.java +9 −0 Original line number Diff line number Diff line Loading @@ -1000,6 +1000,15 @@ public abstract class Animation implements Cloneable { } } /** * Return true if this animation changes the view's alpha property. * * @hide */ public boolean hasAlpha() { return false; } /** * Utility class to parse a string description of a size. */ Loading core/java/android/view/animation/AnimationSet.java +23 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,8 @@ public class AnimationSet extends Animation { private static final int PROPERTY_CHANGE_BOUNDS_MASK = 0x80; private int mFlags = 0; private boolean mDirty; private boolean mHasAlpha; private ArrayList<Animation> mAnimations = new ArrayList<Animation>(); Loading Loading @@ -137,6 +139,25 @@ public class AnimationSet extends Animation { super.setStartOffset(startOffset); } @Override public boolean hasAlpha() { if (mDirty) { mDirty = mHasAlpha = false; final int count = mAnimations.size(); final ArrayList<Animation> animations = mAnimations; for (int i = 0; i < count; i++) { if (animations.get(i).hasAlpha()) { mHasAlpha = true; break; } } } return mHasAlpha; } /** * <p>Sets the duration of every child animation.</p> * Loading Loading @@ -175,6 +196,8 @@ public class AnimationSet extends Animation { mLastEnd = Math.max(mLastEnd, a.getStartOffset() + a.getDuration()); mDuration = mLastEnd - mStartOffset; } mDirty = true; } /** Loading Loading
core/java/android/view/ViewGroup.java +1 −1 Original line number Diff line number Diff line Loading @@ -2854,7 +2854,7 @@ 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(true); if (a instanceof AlphaAnimation) { if (a.hasAlpha()) { // alpha animations should cause the child to recreate its display list child.invalidate(true); } Loading
core/java/android/view/animation/AlphaAnimation.java +8 −0 Original line number Diff line number Diff line Loading @@ -78,4 +78,12 @@ public class AlphaAnimation extends Animation { public boolean willChangeBounds() { return false; } /** * @hide */ @Override public boolean hasAlpha() { return true; } }
core/java/android/view/animation/Animation.java +9 −0 Original line number Diff line number Diff line Loading @@ -1000,6 +1000,15 @@ public abstract class Animation implements Cloneable { } } /** * Return true if this animation changes the view's alpha property. * * @hide */ public boolean hasAlpha() { return false; } /** * Utility class to parse a string description of a size. */ Loading
core/java/android/view/animation/AnimationSet.java +23 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,8 @@ public class AnimationSet extends Animation { private static final int PROPERTY_CHANGE_BOUNDS_MASK = 0x80; private int mFlags = 0; private boolean mDirty; private boolean mHasAlpha; private ArrayList<Animation> mAnimations = new ArrayList<Animation>(); Loading Loading @@ -137,6 +139,25 @@ public class AnimationSet extends Animation { super.setStartOffset(startOffset); } @Override public boolean hasAlpha() { if (mDirty) { mDirty = mHasAlpha = false; final int count = mAnimations.size(); final ArrayList<Animation> animations = mAnimations; for (int i = 0; i < count; i++) { if (animations.get(i).hasAlpha()) { mHasAlpha = true; break; } } } return mHasAlpha; } /** * <p>Sets the duration of every child animation.</p> * Loading Loading @@ -175,6 +196,8 @@ public class AnimationSet extends Animation { mLastEnd = Math.max(mLastEnd, a.getStartOffset() + a.getDuration()); mDuration = mLastEnd - mStartOffset; } mDirty = true; } /** Loading