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

Commit 35c5f0d3 authored by Riddle Hsu's avatar Riddle Hsu Committed by Android (Google) Code Review
Browse files

Merge "Delay visible of rotation enter animation" into main

parents a0e73b0d 7a5c0312
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -419,7 +419,6 @@ class ScreenRotationAnimation {

    private void postProcessRotationAnimation(@NonNull AnimationSet enterAnim,
            @NonNull AnimationSet exitAnim, int rotationDelta) {
        int alphaAnimIndex = -1;
        long enterClipDuration = 0;
        long enterClipStartOffset = 0;
        final var enterAnimations = enterAnim.getAnimations();
@@ -429,14 +428,15 @@ class ScreenRotationAnimation {
                // Use half duration to avoid showing blank area too long.
                enterClipDuration = anim.getDuration() / 2;
                enterClipStartOffset = anim.getStartOffset() / 2;
                alphaAnimIndex = i;
                // TODO(b/438615184): Update screen_rotate_*_enter.xml.
                // Use an instant alpha animation to delay the enter surface from being visible
                // when it is almost occluded by the exit surface. That may reduce some cost of
                // layer composition.
                anim.setDuration(10);
                anim.setStartOffset(enterClipStartOffset);
                break;
            }
        }
        // TODO(b/438615184): Remove alpha animation from screen_rotate_*_enter.xml.
        if (alphaAnimIndex >= 0) {
            enterAnimations.remove(alphaAnimIndex);
        }
        if (rotationDelta % 2 == 0) {
            // 180 degree delta doesn't have size change, so no additional effects are needed.
            return;