Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 92692c02 authored by George Mount's avatar George Mount
Browse files

Keep snapshot order matching the shared elements.

Bug 18578796

When no snapshot was created, we weren't adding anything to
the snapshot list. When a snapshot is not created, we should
add an null snapshot to the snapshot list to keep them in
order.

Change-Id: I522e485163229230037dcdd635b83cff800df28f
parent df84cb90
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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;
    }