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

Commit 306a1d22 authored by Filip Gruszczynski's avatar Filip Gruszczynski Committed by Android (Google) Code Review
Browse files

Merge "Fix multi window thumbnail animation to the top of the screen."

parents 75344663 1a1d8316
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -870,10 +870,10 @@ public class AppTransition implements Dump {
    }

    private Animation createAspectScaledThumbnailEnterNonFullscreenAnimationLocked(
            Rect containingFrame, @Nullable Rect surfaceInsets, int taskId) {
            Rect frame, @Nullable Rect surfaceInsets, int taskId) {
        getNextAppTransitionStartRect(taskId, mTmpStartRect);
        float width = containingFrame.width();
        float height = containingFrame.height();
        float width = frame.width();
        float height = frame.height();
        float scaleWidth = mTmpStartRect.width() / width;
        float scaleHeight = mTmpStartRect.height() / height;
        AnimationSet set = new AnimationSet(true);
@@ -886,9 +886,9 @@ public class AppTransition implements Dump {
        ScaleAnimation scale = new ScaleAnimation(scaleWidth, 1, scaleHeight, 1,
                (width + surfaceInsetsHorizontal) / 2, (height + surfaceInsetsVertical) / 2);
        int fromX = mTmpStartRect.left + mTmpStartRect.width() / 2
                - (containingFrame.left + containingFrame.width() / 2);
                - (frame.left + frame.width() / 2);
        int fromY = mTmpStartRect.top + mTmpStartRect.height() / 2
                - (containingFrame.top + containingFrame.height() / 2);
                - (frame.top + frame.height() / 2);
        TranslateAnimation translation = new TranslateAnimation(fromX, 0, fromY, 0);
        set.addAnimation(scale);
        set.addAnimation(translation);
+11 −8
Original line number Diff line number Diff line
@@ -2806,12 +2806,17 @@ public class WindowManagerService extends IWindowManager.Stub
            Rect appFrame = new Rect(0, 0, width, height);
            Rect surfaceInsets = null;
            final boolean fullscreen = win != null && win.isFullscreen(width, height);
            // Dialog activities have windows with containing frame being very large, but not
            // exactly fullscreen and much smaller mFrame. We use this distinction to identify
            // dialog activities.
            final boolean dialogWindow = win != null && !win.mContainingFrame.equals(win.mFrame);
            final boolean freeform = win != null && win.inFreeformWorkspace();
            if (win != null) {
                // Containing frame will usually cover the whole screen, including dialog windows.
                // For freeform workspace windows it will not cover the whole screen and it also
                // won't exactly match the final freeform window frame (e.g. when overlapping with
                // the status bar). In that case we need to use the final frame.
                if (freeform) {
                    containingFrame.set(win.mFrame);
                } else {
                    containingFrame.set(win.mContainingFrame);
                }
                surfaceInsets = win.getAttrs().surfaceInsets;
                if (fullscreen) {
                    // For fullscreen windows use the window frames and insets to set the thumbnail
@@ -2830,11 +2835,9 @@ public class WindowManagerService extends IWindowManager.Stub
                // screen gets the enter animation. Both appear in the mOpeningApps set.
                enter = false;
            }
            final boolean resizedWindow = !fullscreen && !dialogWindow;
            Animation a = mAppTransition.loadAnimation(lp, transit, enter, containingWidth,
                    containingHeight, mCurConfiguration.orientation, containingFrame, contentInsets,
                    surfaceInsets, appFrame, isVoiceInteraction, resizedWindow,
                    atoken.mTask.mTaskId);
                    surfaceInsets, appFrame, isVoiceInteraction, freeform, atoken.mTask.mTaskId);
            if (a != null) {
                if (DEBUG_ANIM) {
                    RuntimeException e = null;
+1 −1
Original line number Diff line number Diff line
@@ -1629,7 +1629,7 @@ final class WindowState implements WindowManagerPolicy.WindowState {
        }
    }

    private boolean inFreeformWorkspace() {
    boolean inFreeformWorkspace() {
        final Task task = getTask();
        return task != null && task.mStack != null &&
                task.mStack.mStackId == FREEFORM_WORKSPACE_STACK_ID;