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

Commit 6ea1072a authored by Ats Jenk's avatar Ats Jenk Committed by Android (Google) Code Review
Browse files

Merge "Update scale logic for desktop tasks in recents animation" into main

parents 1c14e5e8 cb12f244
Loading
Loading
Loading
Loading
+14 −6
Original line number Diff line number Diff line
@@ -146,12 +146,6 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy {
            return 1;
        }

        if (mIsDesktopTask) {
            mTaskRect.set(mThumbnailPosition);
            mPivot.set(mTaskRect.centerX(), mTaskRect.centerY());
            return 1;
        }

        if (mIsGridTask) {
            mSizeStrategy.calculateGridTaskSize(mContext, mDp, mTaskRect,
                    mOrientationState.getOrientationHandler());
@@ -169,6 +163,20 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy {
            mOrientationState.getOrientationHandler()
                    .setSplitTaskSwipeRect(mDp, mTaskRect, mSplitBounds, mStagePosition);
            mTaskRect.offset(mTaskRectTranslationX, mTaskRectTranslationY);
        } else if (mIsDesktopTask) {
            // For desktop, tasks can take up only part of the screen size.
            // Full task size represents the whole screen size, but scaled down to fit in recents.
            // Task rect will represent the scaled down thumbnail position and is placed inside
            // full task size as it is on the home screen.
            fullTaskSize = new Rect(mTaskRect);
            PointF fullscreenTaskDimension = new PointF();
            BaseActivityInterface.getTaskDimension(mContext, mDp, fullscreenTaskDimension);
            // Calculate the scale down factor used in recents
            float scale = fullTaskSize.width() / fullscreenTaskDimension.x;
            mTaskRect.set(mThumbnailPosition);
            mTaskRect.scale(scale);
            // Ensure the task rect is inside the full task rect
            mTaskRect.offset(fullTaskSize.left, fullTaskSize.top);
        } else {
            fullTaskSize = mTaskRect;
        }