summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChet Haase <chet@google.com>2012-06-01 15:09:07 -0700
committerChet Haase <chet@google.com>2012-06-01 15:09:07 -0700
commit66ef1a201ea9df71a8ec9b2d1aaab1eb1180ae40 (patch)
tree2c4109da54c7e77fae0b3d63fbe580c4096e1ca5
parent79f7381f8b4e9a462d012740c2a902ae3de8a6b0 (diff)
downloadframeworks_base-66ef1a201ea9df71a8ec9b2d1aaab1eb1180ae40.zip
frameworks_base-66ef1a201ea9df71a8ec9b2d1aaab1eb1180ae40.tar.gz
frameworks_base-66ef1a201ea9df71a8ec9b2d1aaab1eb1180ae40.tar.bz2
Skip LayoutTransition animations on objects of size (0,0)
LayoutTransition runs changing animations on all objects that change between now and the next layout. This works in most normal situations, but when a container is becoming visible, or being added to its container, or other first-time situations, then some of the views and parent hierarchy may be of size (0,0). The user really shouldn't need to see an animation up from these nonsense values, so we just skip running the animation on these objects and simply place the objects where they need to go. Issue #6597648 view should not animate up from size (0,0) Change-Id: I2c355a68bf1ce3b41fbec01ad95c78d83562ba32
-rw-r--r--core/java/android/animation/LayoutTransition.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/core/java/android/animation/LayoutTransition.java b/core/java/android/animation/LayoutTransition.java
index bdcb2af..4d3a519 100644
--- a/core/java/android/animation/LayoutTransition.java
+++ b/core/java/android/animation/LayoutTransition.java
@@ -831,6 +831,14 @@ public class LayoutTransition {
return;
}
+ // Don't animate items up from size(0,0); this is likely because the objects
+ // were offscreen/invisible or otherwise measured to be infinitely small. We don't
+ // want to see them animate into their real size; just ignore animation requests
+ // on these views
+ if (child.getWidth() == 0 && child.getHeight() == 0) {
+ return;
+ }
+
// Make a copy of the appropriate animation
final Animator anim = baseAnimator.clone();