diff options
| author | 2014-12-03 07:56:00 +0000 | |
|---|---|---|
| committer | 2014-12-03 07:56:00 +0000 | |
| commit | a3a53251f1dfdd3620bfa9b0a8f350a9867826d9 (patch) | |
| tree | 77d5d6f21ea07c08505815a60142d68c0422d1c4 | |
| parent | 3550c6c5d67740b8ea77b2921146780fe340f34e (diff) | |
| parent | 24fac506f0204433aa3d2314d3ac7f909b6eb67a (diff) | |
am 24fac506: am 561261d4: Merge "Keep snapshot order matching the shared elements." into lmp-mr1-dev
* commit '24fac506f0204433aa3d2314d3ac7f909b6eb67a':
Keep snapshot order matching the shared elements.
| -rw-r--r-- | core/java/android/app/ActivityTransitionCoordinator.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/core/java/android/app/ActivityTransitionCoordinator.java b/core/java/android/app/ActivityTransitionCoordinator.java index 9062892efde9..d0d9d7153eaf 100644 --- a/core/java/android/app/ActivityTransitionCoordinator.java +++ b/core/java/android/app/ActivityTransitionCoordinator.java @@ -641,17 +641,18 @@ abstract class ActivityTransitionCoordinator extends ResultReceiver { Matrix tempMatrix = new Matrix(); for (String name: names) { Bundle sharedElementBundle = state.getBundle(name); + View snapshot = null; if (sharedElementBundle != null) { Parcelable parcelable = sharedElementBundle.getParcelable(KEY_SNAPSHOT); - View snapshot = null; if (parcelable != null && mListener != null) { snapshot = mListener.onCreateSnapshotView(context, parcelable); } if (snapshot != null) { setSharedElementState(snapshot, name, state, tempMatrix, null, decorLoc); } - snapshots.add(snapshot); } + // Even null snapshots are added so they remain in the same order as shared elements. + snapshots.add(snapshot); } return snapshots; } |