Skip to content

Commit faa3233

Browse files
chethaaseAndroid (Google) Code Review
authored andcommitted
Merge "Skip LayoutTransition animations on objects of size (0,0)" into jb-dev
2 parents 1de1990 + 66ef1a2 commit faa3233

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

core/java/android/animation/LayoutTransition.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -831,6 +831,14 @@ private void setupChangeAnimation(final ViewGroup parent, final int changeReason
831831
return;
832832
}
833833

834+
// Don't animate items up from size(0,0); this is likely because the objects
835+
// were offscreen/invisible or otherwise measured to be infinitely small. We don't
836+
// want to see them animate into their real size; just ignore animation requests
837+
// on these views
838+
if (child.getWidth() == 0 && child.getHeight() == 0) {
839+
return;
840+
}
841+
834842
// Make a copy of the appropriate animation
835843
final Animator anim = baseAnimator.clone();
836844

0 commit comments

Comments
 (0)