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

Commit 516ef793 authored by chaviw's avatar chaviw
Browse files

Use alpha instead of show/hide when creating animation leashes.

Relative layers inherit visibility flag from the layer they are relative
to. This caused dim layers to disappear when the dim layer was transferred
from one window to another that was starting an animation. The animation
leash was set to hidden so the dim layer was also hidden.

Instead set alpha to 0 and 1 when trying to show and hide the animation
leash. This will not update the dim layer's visibility since only the
show/hide flag is inherited.

Test: Steps from bug
Fixes: 138337187
Change-Id: Id7d82335889a42020ad0adccf9bd5c5d987cc813
parent dc860bdf
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -193,7 +193,9 @@ class SurfaceAnimationRunner {
            public void onAnimationStart(Animator animation) {
                synchronized (mCancelLock) {
                    if (!a.mCancelled) {
                        mFrameTransaction.show(a.mLeash);
                        // TODO: change this back to use show instead of alpha when b/138459974 is
                        // fixed.
                        mFrameTransaction.setAlpha(a.mLeash, 1);
                    }
                }
            }
+3 −3
Original line number Diff line number Diff line
@@ -324,9 +324,9 @@ class SurfaceAnimator {
                .setName(surface + " - animation-leash");
        final SurfaceControl leash = builder.build();
        t.setWindowCrop(leash, width, height);
        if (!hidden) {
        t.show(leash);
        }
        // TODO: change this back to use show instead of alpha when b/138459974 is fixed.
        t.setAlpha(leash, hidden ? 0 : 1);
        t.reparent(surface, leash);
        return leash;
    }