diff options
| author | 2014-10-06 23:51:05 +0000 | |
|---|---|---|
| committer | 2014-10-06 23:51:05 +0000 | |
| commit | 0aa69ff2ff9e8556f4963b7dfdad56996a604392 (patch) | |
| tree | 005012404b554856bc894d54d0d16e48a8655530 | |
| parent | bb68c263620fe91eefb241efaf099742b3e6069c (diff) | |
| parent | 1a6c41fbad9c1c6725d189fdcf7dae2fe3f00b4d (diff) | |
am 1a6c41fb: am 6c9f0a01: Merge "Avoid changeBounds animations on Views that are not yet laidout" into lmp-dev
* commit '1a6c41fbad9c1c6725d189fdcf7dae2fe3f00b4d':
Avoid changeBounds animations on Views that are not yet laidout
| -rw-r--r-- | core/java/android/transition/ChangeBounds.java | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/core/java/android/transition/ChangeBounds.java b/core/java/android/transition/ChangeBounds.java index eb17429965ca..0a44ba20f44e 100644 --- a/core/java/android/transition/ChangeBounds.java +++ b/core/java/android/transition/ChangeBounds.java @@ -117,13 +117,16 @@ public class ChangeBounds extends Transition { private void captureValues(TransitionValues values) { View view = values.view; - values.values.put(PROPNAME_BOUNDS, new Rect(view.getLeft(), view.getTop(), - view.getRight(), view.getBottom())); - values.values.put(PROPNAME_PARENT, values.view.getParent()); - if (mReparent) { - values.view.getLocationInWindow(tempLocation); - values.values.put(PROPNAME_WINDOW_X, tempLocation[0]); - values.values.put(PROPNAME_WINDOW_Y, tempLocation[1]); + + if (view.isLaidOut()) { + values.values.put(PROPNAME_BOUNDS, new Rect(view.getLeft(), view.getTop(), + view.getRight(), view.getBottom())); + values.values.put(PROPNAME_PARENT, values.view.getParent()); + if (mReparent) { + values.view.getLocationInWindow(tempLocation); + values.values.put(PROPNAME_WINDOW_X, tempLocation[0]); + values.values.put(PROPNAME_WINDOW_Y, tempLocation[1]); + } } } |