summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Chet Haase <chet@google.com> 2011-12-20 15:56:15 -0800
committer Chet Haase <chet@google.com> 2011-12-20 15:56:15 -0800
commit0041861a0433402b789d6530eb0ed52a1c2b4ff1 (patch)
tree850da0596c0e8925c84bda8372c5e97379a44042
parente4f0034226731724b67201d69fb4034ef857e2d3 (diff)
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
-rw-r--r--core/java/android/view/animation/AnimationSet.java13
1 files 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);
+ }
}
}
}