Loading quickstep/src/com/android/quickstep/BaseActivityInterface.java +7 −0 Original line number Diff line number Diff line Loading @@ -349,6 +349,13 @@ public abstract class BaseActivityInterface<STATE_TYPE extends BaseState<STATE_T Gravity.apply(gravity, outWidth, outHeight, potentialTaskRect, outRect); } /** * Calculates the task size for the desktop task */ public final void calculateDesktopTaskSize(Context context, DeviceProfile dp, Rect outRect) { calculateFocusTaskSize(context, dp, outRect); } /** * Calculates the modal taskView size for the provided device configuration */ Loading quickstep/src/com/android/quickstep/views/RecentsView.java +15 −2 Original line number Diff line number Diff line Loading @@ -450,6 +450,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T protected final Rect mLastComputedTaskSize = new Rect(); protected final Rect mLastComputedGridSize = new Rect(); protected final Rect mLastComputedGridTaskSize = new Rect(); protected final Rect mLastComputedDesktopTaskSize = new Rect(); private TaskView mSelectedTask = null; // How much a task that is directly offscreen will be pushed out due to RecentsView scale/pivot. @Nullable Loading Loading @@ -1940,6 +1941,10 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T mLastComputedGridSize); mSizeStrategy.calculateGridTaskSize(mActivity, mActivity.getDeviceProfile(), mLastComputedGridTaskSize, mOrientationHandler); if (DesktopTaskView.DESKTOP_IS_PROTO2_ENABLED) { mSizeStrategy.calculateDesktopTaskSize(mActivity, mActivity.getDeviceProfile(), mLastComputedDesktopTaskSize); } mTaskGridVerticalDiff = mLastComputedGridTaskSize.top - mLastComputedTaskSize.top; mTopBottomRowHeightDiff = Loading Loading @@ -2030,6 +2035,11 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T return mLastComputedGridTaskSize; } /** Gets the last computed desktop task size */ public Rect getLastComputedDesktopTaskSize() { return mLastComputedDesktopTaskSize; } /** Gets the task size for modal state. */ public void getModalTaskSize(Rect outRect) { mSizeStrategy.calculateModalTaskSize(mActivity, mActivity.getDeviceProfile(), outRect, Loading Loading @@ -2764,10 +2774,13 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T } else if (taskView.isDesktopTask()) { // Desktop task was not focused. Pin it to the right of focused desktopTaskIndex = i; if (!ENABLE_GRID_ONLY_OVERVIEW.get()) { // Only apply x-translation when using legacy overview grid gridTranslations[i] += mIsRtl ? taskWidthAndSpacing : -taskWidthAndSpacing; } // Center view vertically in case it's from different orientation. taskView.setGridTranslationY((mLastComputedTaskSize.height() + taskTopMargin taskView.setGridTranslationY((mLastComputedDesktopTaskSize.height() + taskTopMargin - taskView.getLayoutParams().height) / 2f); } else { if (i > focusedTaskIndex) { Loading quickstep/src/com/android/quickstep/views/TaskView.java +6 −1 Original line number Diff line number Diff line Loading @@ -1619,7 +1619,12 @@ public class TaskView extends FrameLayout implements Reusable { int boxWidth; int boxHeight; boolean isFocusedTask = isFocusedTask(); if (isFocusedTask || isDesktopTask()) { if (isDesktopTask()) { Rect lastComputedDesktopTaskSize = getRecentsView().getLastComputedDesktopTaskSize(); boxWidth = lastComputedDesktopTaskSize.width(); boxHeight = lastComputedDesktopTaskSize.height(); } else if (isFocusedTask) { // Task will be focused and should use focused task size. Use focusTaskRatio // that is associated with the original orientation of the focused task. boxWidth = taskWidth; Loading Loading
quickstep/src/com/android/quickstep/BaseActivityInterface.java +7 −0 Original line number Diff line number Diff line Loading @@ -349,6 +349,13 @@ public abstract class BaseActivityInterface<STATE_TYPE extends BaseState<STATE_T Gravity.apply(gravity, outWidth, outHeight, potentialTaskRect, outRect); } /** * Calculates the task size for the desktop task */ public final void calculateDesktopTaskSize(Context context, DeviceProfile dp, Rect outRect) { calculateFocusTaskSize(context, dp, outRect); } /** * Calculates the modal taskView size for the provided device configuration */ Loading
quickstep/src/com/android/quickstep/views/RecentsView.java +15 −2 Original line number Diff line number Diff line Loading @@ -450,6 +450,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T protected final Rect mLastComputedTaskSize = new Rect(); protected final Rect mLastComputedGridSize = new Rect(); protected final Rect mLastComputedGridTaskSize = new Rect(); protected final Rect mLastComputedDesktopTaskSize = new Rect(); private TaskView mSelectedTask = null; // How much a task that is directly offscreen will be pushed out due to RecentsView scale/pivot. @Nullable Loading Loading @@ -1940,6 +1941,10 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T mLastComputedGridSize); mSizeStrategy.calculateGridTaskSize(mActivity, mActivity.getDeviceProfile(), mLastComputedGridTaskSize, mOrientationHandler); if (DesktopTaskView.DESKTOP_IS_PROTO2_ENABLED) { mSizeStrategy.calculateDesktopTaskSize(mActivity, mActivity.getDeviceProfile(), mLastComputedDesktopTaskSize); } mTaskGridVerticalDiff = mLastComputedGridTaskSize.top - mLastComputedTaskSize.top; mTopBottomRowHeightDiff = Loading Loading @@ -2030,6 +2035,11 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T return mLastComputedGridTaskSize; } /** Gets the last computed desktop task size */ public Rect getLastComputedDesktopTaskSize() { return mLastComputedDesktopTaskSize; } /** Gets the task size for modal state. */ public void getModalTaskSize(Rect outRect) { mSizeStrategy.calculateModalTaskSize(mActivity, mActivity.getDeviceProfile(), outRect, Loading Loading @@ -2764,10 +2774,13 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T } else if (taskView.isDesktopTask()) { // Desktop task was not focused. Pin it to the right of focused desktopTaskIndex = i; if (!ENABLE_GRID_ONLY_OVERVIEW.get()) { // Only apply x-translation when using legacy overview grid gridTranslations[i] += mIsRtl ? taskWidthAndSpacing : -taskWidthAndSpacing; } // Center view vertically in case it's from different orientation. taskView.setGridTranslationY((mLastComputedTaskSize.height() + taskTopMargin taskView.setGridTranslationY((mLastComputedDesktopTaskSize.height() + taskTopMargin - taskView.getLayoutParams().height) / 2f); } else { if (i > focusedTaskIndex) { Loading
quickstep/src/com/android/quickstep/views/TaskView.java +6 −1 Original line number Diff line number Diff line Loading @@ -1619,7 +1619,12 @@ public class TaskView extends FrameLayout implements Reusable { int boxWidth; int boxHeight; boolean isFocusedTask = isFocusedTask(); if (isFocusedTask || isDesktopTask()) { if (isDesktopTask()) { Rect lastComputedDesktopTaskSize = getRecentsView().getLastComputedDesktopTaskSize(); boxWidth = lastComputedDesktopTaskSize.width(); boxHeight = lastComputedDesktopTaskSize.height(); } else if (isFocusedTask) { // Task will be focused and should use focused task size. Use focusTaskRatio // that is associated with the original orientation of the focused task. boxWidth = taskWidth; Loading