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

Commit b60f4680 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Avoid improperly removing views during transitions"

parents 6fae5ba6 283897b3
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -163,10 +163,14 @@ public class TransitionUtils {
    public static Bitmap createViewBitmap(View view, Matrix matrix, RectF bounds,
            ViewGroup sceneRoot) {
        final boolean addToOverlay = !view.isAttachedToWindow();
        ViewGroup parent = null;
        int indexInParent = 0;
        if (addToOverlay) {
            if (sceneRoot == null || !sceneRoot.isAttachedToWindow()) {
                return null;
            }
            parent = (ViewGroup) view.getParent();
            indexInParent = parent.indexOfChild(view);
            sceneRoot.getOverlay().add(view);
        }
        Bitmap bitmap = null;
@@ -190,6 +194,7 @@ public class TransitionUtils {
        }
        if (addToOverlay) {
            sceneRoot.getOverlay().remove(view);
            parent.addView(view, indexInParent);
        }
        return bitmap;
    }
+4 −1
Original line number Diff line number Diff line
@@ -402,8 +402,11 @@ public abstract class Visibility extends Transition {
                // Becoming GONE
                if (startView == endView) {
                    viewToKeep = endView;
                } else {
                } else if (mCanRemoveViews) {
                    overlayView = startView;
                } else {
                    overlayView = TransitionUtils.copyViewImage(sceneRoot, startView,
                            (View) startView.getParent());
                }
            }
        }