diff --git a/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java b/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java index 48dadd1f34..25b9bdc0e6 100644 --- a/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java +++ b/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java @@ -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; }