am 561261d4: Merge "Keep snapshot order matching the shared elements." into lmp-mr1-dev
* commit '561261d4442fb78b314c00f6b836fe7b1c387977': Keep snapshot order matching the shared elements.
This commit is contained in:
@@ -641,17 +641,18 @@ abstract class ActivityTransitionCoordinator extends ResultReceiver {
|
|||||||
Matrix tempMatrix = new Matrix();
|
Matrix tempMatrix = new Matrix();
|
||||||
for (String name: names) {
|
for (String name: names) {
|
||||||
Bundle sharedElementBundle = state.getBundle(name);
|
Bundle sharedElementBundle = state.getBundle(name);
|
||||||
|
View snapshot = null;
|
||||||
if (sharedElementBundle != null) {
|
if (sharedElementBundle != null) {
|
||||||
Parcelable parcelable = sharedElementBundle.getParcelable(KEY_SNAPSHOT);
|
Parcelable parcelable = sharedElementBundle.getParcelable(KEY_SNAPSHOT);
|
||||||
View snapshot = null;
|
|
||||||
if (parcelable != null && mListener != null) {
|
if (parcelable != null && mListener != null) {
|
||||||
snapshot = mListener.onCreateSnapshotView(context, parcelable);
|
snapshot = mListener.onCreateSnapshotView(context, parcelable);
|
||||||
}
|
}
|
||||||
if (snapshot != null) {
|
if (snapshot != null) {
|
||||||
setSharedElementState(snapshot, name, state, tempMatrix, null, decorLoc);
|
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;
|
return snapshots;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user