From 0041861a0433402b789d6530eb0ed52a1c2b4ff1 Mon Sep 17 00:00:00 2001 From: Chet Haase Date: Tue, 20 Dec 2011 15:56:15 -0800 Subject: Fix behavior of AnimationSet and fillBefore The previous logic in AnimationSet when starting an animation ignored the fillBefore behavior of its child animations. This caused a bug where a delayed AlphaAnimation would automatically cause the target view to become transparent, even though it was supposed to wait until after some delay to do so. The fix checks the fillBefore behavior of each child animation before concatenating its transform with the transform of the AnimationSet. Change-Id: I76a2dafbe6dd338dc5281b17612eae87af168d86 --- core/java/android/view/animation/AnimationSet.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/core/java/android/view/animation/AnimationSet.java b/core/java/android/view/animation/AnimationSet.java index def4d700c7bb..14d3d19851f1 100644 --- a/core/java/android/view/animation/AnimationSet.java +++ b/core/java/android/view/animation/AnimationSet.java @@ -348,12 +348,13 @@ public class AnimationSet extends Animation { for (int i = count - 1; i >= 0; --i) { final Animation a = animations.get(i); - - temp.clear(); - final Interpolator interpolator = a.mInterpolator; - a.applyTransformation(interpolator != null ? interpolator.getInterpolation(0.0f) - : 0.0f, temp); - previousTransformation.compose(temp); + if (!a.isFillEnabled() || a.getFillBefore() || a.getStartOffset() == 0) { + temp.clear(); + final Interpolator interpolator = a.mInterpolator; + a.applyTransformation(interpolator != null ? interpolator.getInterpolation(0.0f) + : 0.0f, temp); + previousTransformation.compose(temp); + } } } } -- cgit v1.2.3-59-g8ed1b