diff options
| author | George Mount <mount@google.com> | 2014-10-31 21:43:21 +0000 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2014-10-31 21:43:21 +0000 |
| commit | 486384ef46ead8e05fbf4cdb1c1b48e3a559d281 (patch) | |
| tree | bd9fd2f5c0d278f457bf4389a384778df7219c9a /core/java/android | |
| parent | 3bfcae769faa523390c28adc149afd9d070ff12d (diff) | |
| parent | 0d6624d35af7c7623cf97084753255079b01fbdf (diff) | |
| download | frameworks_base-486384ef46ead8e05fbf4cdb1c1b48e3a559d281.zip frameworks_base-486384ef46ead8e05fbf4cdb1c1b48e3a559d281.tar.gz frameworks_base-486384ef46ead8e05fbf4cdb1c1b48e3a559d281.tar.bz2 | |
am 0d6624d3: am fa21e757: Merge "Ensure views are attached prior to starting enter transition." into lmp-mr1-dev automerge: 7bce500
* commit '0d6624d35af7c7623cf97084753255079b01fbdf':
Ensure views are attached prior to starting enter transition.
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/app/EnterTransitionCoordinator.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/core/java/android/app/EnterTransitionCoordinator.java b/core/java/android/app/EnterTransitionCoordinator.java index 7894887..ecf19c7 100644 --- a/core/java/android/app/EnterTransitionCoordinator.java +++ b/core/java/android/app/EnterTransitionCoordinator.java @@ -133,16 +133,17 @@ class EnterTransitionCoordinator extends ActivityTransitionCoordinator { return; } mAreViewsReady = true; + final ViewGroup decor = getDecor(); // Ensure the views have been laid out before capturing the views -- we need the epicenter. - if (sharedElements.isEmpty() || !sharedElements.valueAt(0).isLayoutRequested()) { + if (decor == null || (decor.isAttachedToWindow() && + (sharedElements.isEmpty() || !sharedElements.valueAt(0).isLayoutRequested()))) { viewsReady(sharedElements); } else { - final View sharedElement = sharedElements.valueAt(0); - sharedElement.getViewTreeObserver() + decor.getViewTreeObserver() .addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() { @Override public boolean onPreDraw() { - sharedElement.getViewTreeObserver().removeOnPreDrawListener(this); + decor.getViewTreeObserver().removeOnPreDrawListener(this); viewsReady(sharedElements); return true; } |
