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

Commit 4b02b5ac authored by Android Build Merger (Role)'s avatar Android Build Merger (Role) Committed by Android (Google) Code Review
Browse files

Merge "Merge "Protect shared element transitions from removed views." into...

Merge "Merge "Protect shared element transitions from removed views." into oc-dev am: 70c1e51b am: 817d37c1"
parents 94de333e 0328d83f
Loading
Loading
Loading
Loading
+16 −12
Original line number Diff line number Diff line
@@ -570,8 +570,10 @@ abstract class ActivityTransitionCoordinator extends ResultReceiver {
            // Find the location in the view's parent
            ViewGroup parent = (ViewGroup) view.getParent();
            Matrix matrix = new Matrix();
            if (parent != null) {
                parent.transformMatrixToLocal(matrix);
                matrix.postTranslate(parent.getScrollX(), parent.getScrollY());
            }
            mSharedElementParentMatrices.add(matrix);
        }
    }
@@ -861,6 +863,7 @@ abstract class ActivityTransitionCoordinator extends ResultReceiver {
            Matrix tempMatrix = new Matrix();
            for (int i = 0; i < numSharedElements; i++) {
                View view = mSharedElements.get(i);
                if (view.isAttachedToWindow()) {
                    tempMatrix.reset();
                    mSharedElementParentMatrices.get(i).invert(tempMatrix);
                    GhostView.addGhost(view, decor, tempMatrix);
@@ -874,6 +877,7 @@ abstract class ActivityTransitionCoordinator extends ResultReceiver {
                }
            }
        }
    }

    protected boolean moveSharedElementWithParent() {
        return true;
@@ -1065,7 +1069,7 @@ abstract class ActivityTransitionCoordinator extends ResultReceiver {
        @Override
        public boolean onPreDraw() {
            GhostView ghostView = GhostView.getGhost(mView);
            if (ghostView == null) {
            if (ghostView == null || !mView.isAttachedToWindow()) {
                removeListener();
            } else {
                GhostView.calculateMatrix(mView, mDecor, mMatrix);