From 62572c04e20a27627c71da9e9d44e3196f52053e Mon Sep 17 00:00:00 2001 From: Alex Chau Date: Mon, 25 Jul 2022 18:36:37 +0000 Subject: [PATCH] Revert "Move BaseActivityInterface task size methods to DevicePr..." Revert "Move BaseActivityInterface task size methods to DevicePr..." Revert submission 19279487-baseactivityinterface Reason for revert: As per discussion in ag/19341332, make sure DeviceProfile can properly react to inset changes before moving task size calculations there Reverted Changes: I30324d34c:Move BaseActivityInterface task size methods to De... Ia9c1d0387:Move BaseActivityInterface task size methods to De... Bug: 238593212 Change-Id: I0d40fdd4a5d4468494e30cef32a284479ddd2feb --- .../launcher3/BaseQuickstepLauncher.java | 2 +- .../taskbar/TaskbarActivityContext.java | 2 +- .../states/BackgroundAppState.java | 3 +- .../states/OverviewModalTaskState.java | 11 +- .../uioverrides/states/OverviewState.java | 7 +- .../NoButtonQuickSwitchTouchController.java | 4 +- .../PortraitStatesTouchController.java | 4 +- .../android/quickstep/AbsSwipeUpHandler.java | 4 +- .../quickstep/BaseActivityInterface.java | 131 +++++++++++- .../quickstep/FallbackActivityInterface.java | 8 +- .../quickstep/LauncherActivityInterface.java | 8 +- .../QuickstepTestInformationHandler.java | 18 +- .../quickstep/SwipeUpAnimationLogic.java | 3 +- .../quickstep/TouchInteractionService.java | 2 +- .../AnimatorControllerWithResistance.java | 4 +- .../android/quickstep/util/LayoutUtils.java | 12 +- .../quickstep/util/RecentsOrientedState.java | 5 +- .../quickstep/util/TaskViewSimulator.java | 8 +- .../quickstep/views/OverviewActionsView.java | 8 +- .../android/quickstep/views/RecentsView.java | 119 +++++++---- .../com/android/quickstep/views/TaskView.java | 12 +- .../DeviceProfilePhone3ButtonTest.kt | 110 ---------- .../quickstep/DeviceProfilePhoneTest.kt | 110 ---------- ...DeviceProfileTabletLandscape3ButtonTest.kt | 110 ---------- .../DeviceProfileTabletLandscapeTest.kt | 110 ---------- .../DeviceProfileTabletPortrait3ButtonTest.kt | 110 ---------- .../DeviceProfileTabletPortraitTest.kt | 110 ---------- ...viceProfileTwoPanelLandscape3ButtonTest.kt | 110 ---------- .../DeviceProfileTwoPanelLandscapeTest.kt | 110 ---------- ...eviceProfileTwoPanelPortrait3ButtonTest.kt | 110 ---------- .../DeviceProfileTwoPanelPortraitTest.kt | 110 ---------- .../DeviceProfileVerticalBar3ButtonTest.kt | 110 ---------- .../quickstep/DeviceProfileVerticalBarTest.kt | 110 ---------- res/values/dimens.xml | 3 - src/com/android/launcher3/DeviceProfile.java | 202 ++---------------- src/com/android/launcher3/Launcher.java | 2 +- .../launcher3/DeviceProfileBaseTest.kt | 3 +- 37 files changed, 307 insertions(+), 1598 deletions(-) diff --git a/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java b/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java index ec497ef1f9..e21dcbadf2 100644 --- a/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java +++ b/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java @@ -337,7 +337,7 @@ public abstract class BaseQuickstepLauncher extends Launcher { new SplitSelectStateController(this, mHandler, getStateManager(), getDepthController()); overviewPanel.init(mActionsView, controller); - mActionsView.updateDimension(getDeviceProfile()); + mActionsView.updateDimension(getDeviceProfile(), overviewPanel.getLastComputedTaskSize()); mActionsView.updateVerticalMargin(DisplayController.getNavigationMode(this)); mAppTransitionManager = new QuickstepTransitionManager(this); diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java index 6b12e9c164..439490e00c 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java @@ -839,6 +839,6 @@ public class TaskbarActivityContext extends BaseTaskbarContext { pw.println(String.format( "%s\tmBindInProgress=%b", prefix, mBindingItems)); mControllers.dumpLogs(prefix + "\t", pw); - mDeviceProfile.dump(this, prefix, pw); + mDeviceProfile.dump(prefix, pw); } } diff --git a/quickstep/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java b/quickstep/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java index 297a61a38d..b7330072d4 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java +++ b/quickstep/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java @@ -50,7 +50,8 @@ public class BackgroundAppState extends OverviewState { return super.getVerticalProgress(launcher); } RecentsView recentsView = launcher.getOverviewPanel(); - int transitionLength = LayoutUtils.getShelfTrackingDistance(launcher.getDeviceProfile(), + int transitionLength = LayoutUtils.getShelfTrackingDistance(launcher, + launcher.getDeviceProfile(), recentsView.getPagedOrientationHandler()); AllAppsTransitionController controller = launcher.getAllAppsController(); float scrollRange = Math.max(controller.getShiftRange(), 1); diff --git a/quickstep/src/com/android/launcher3/uioverrides/states/OverviewModalTaskState.java b/quickstep/src/com/android/launcher3/uioverrides/states/OverviewModalTaskState.java index 0f02e2663e..0c49e5fc69 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/states/OverviewModalTaskState.java +++ b/quickstep/src/com/android/launcher3/uioverrides/states/OverviewModalTaskState.java @@ -18,6 +18,8 @@ package com.android.launcher3.uioverrides.states; import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_OVERVIEW; import android.content.Context; +import android.graphics.Point; +import android.graphics.Rect; import com.android.launcher3.BaseDraggingActivity; import com.android.launcher3.Launcher; @@ -69,6 +71,13 @@ public class OverviewModalTaskState extends OverviewState { } public static float[] getOverviewScaleAndOffsetForModalState(BaseDraggingActivity activity) { - return new float[] {activity.getDeviceProfile().overviewModalTaskScale, NO_OFFSET}; + Point taskSize = activity.getOverviewPanel().getSelectedTaskSize(); + Rect modalTaskSize = new Rect(); + activity.getOverviewPanel().getModalTaskSize(modalTaskSize); + + float scale = Math.min((float) modalTaskSize.height() / taskSize.y, + (float) modalTaskSize.width() / taskSize.x); + + return new float[] {scale, NO_OFFSET}; } } diff --git a/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java b/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java index c0810b929e..6427e0981a 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java +++ b/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java @@ -65,9 +65,12 @@ public class OverviewState extends LauncherState { @Override public ScaleAndTranslation getWorkspaceScaleAndTranslation(Launcher launcher) { + RecentsView recentsView = launcher.getOverviewPanel(); + float workspacePageHeight = launcher.getDeviceProfile().getCellLayoutHeight(); + recentsView.getTaskSize(sTempRect); + float scale = (float) sTempRect.height() / workspacePageHeight; float parallaxFactor = 0.5f; - return new ScaleAndTranslation(launcher.getDeviceProfile().overviewTaskWorkspaceScale, 0, - -getDefaultSwipeHeight(launcher) * parallaxFactor); + return new ScaleAndTranslation(scale, 0, -getDefaultSwipeHeight(launcher) * parallaxFactor); } @Override diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java index d06f64a1be..53dc9dd873 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java +++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java @@ -120,8 +120,8 @@ public class NoButtonQuickSwitchTouchController implements TouchController, mSwipeDetector = new BothAxesSwipeDetector(mLauncher, this); mRecentsView = mLauncher.getOverviewPanel(); mXRange = mLauncher.getDeviceProfile().widthPx / 2f; - mYRange = LayoutUtils.getShelfTrackingDistance(mLauncher.getDeviceProfile(), - mRecentsView.getPagedOrientationHandler()); + mYRange = LayoutUtils.getShelfTrackingDistance( + mLauncher, mLauncher.getDeviceProfile(), mRecentsView.getPagedOrientationHandler()); mMaxYProgress = mLauncher.getDeviceProfile().heightPx / mYRange; mMotionPauseDetector = new MotionPauseDetector(mLauncher); mMotionPauseMinDisplacement = mLauncher.getResources().getDimension( diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/PortraitStatesTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/PortraitStatesTouchController.java index 73949457b6..9efbc34a17 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/PortraitStatesTouchController.java +++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/PortraitStatesTouchController.java @@ -144,8 +144,8 @@ public class PortraitStatesTouchController extends AbstractStateChangeTouchContr .createPlaybackController(); mLauncher.getStateManager().setCurrentUserControlledAnimation(mCurrentAnimation); RecentsView recentsView = mLauncher.getOverviewPanel(); - totalShift = LayoutUtils.getShelfTrackingDistance(mLauncher.getDeviceProfile(), - recentsView.getPagedOrientationHandler()); + totalShift = LayoutUtils.getShelfTrackingDistance(mLauncher, + mLauncher.getDeviceProfile(), recentsView.getPagedOrientationHandler()); } else { mCurrentAnimation = mLauncher.getStateManager() .createAnimationToNewWorkspace(mToState, config); diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java index 1ec00a0ca9..d7fea371f3 100644 --- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java +++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java @@ -2048,8 +2048,8 @@ public abstract class AbsSwipeUpHandler, float scrollOffset = Math.abs(mRecentsView.getScrollOffset(mRecentsView.getCurrentPage())); int maxScrollOffset = mRecentsView.getPagedOrientationHandler().getPrimaryValue( - mActivity.getDeviceProfile().overviewTaskRect.width(), - mActivity.getDeviceProfile().overviewTaskRect.height()); + mRecentsView.getLastComputedTaskSize().width(), + mRecentsView.getLastComputedTaskSize().height()); maxScrollOffset += mRecentsView.getPageSpacing(); float maxScaleProgress = diff --git a/quickstep/src/com/android/quickstep/BaseActivityInterface.java b/quickstep/src/com/android/quickstep/BaseActivityInterface.java index a922f58993..6354282d47 100644 --- a/quickstep/src/com/android/quickstep/BaseActivityInterface.java +++ b/quickstep/src/com/android/quickstep/BaseActivityInterface.java @@ -33,9 +33,12 @@ import android.animation.AnimatorListenerAdapter; import android.animation.ObjectAnimator; import android.annotation.TargetApi; import android.content.Context; +import android.content.res.Resources; import android.graphics.Color; +import android.graphics.PointF; import android.graphics.Rect; import android.os.Build; +import android.view.Gravity; import android.view.MotionEvent; import android.view.View; @@ -43,6 +46,7 @@ import androidx.annotation.Nullable; import androidx.annotation.UiThread; import com.android.launcher3.DeviceProfile; +import com.android.launcher3.R; import com.android.launcher3.anim.AnimatorPlaybackController; import com.android.launcher3.anim.PendingAnimation; import com.android.launcher3.statehandlers.DepthController; @@ -105,8 +109,8 @@ public abstract class BaseActivityInterface PendingAnimation createRecentsResistanceAnim( RecentsParams params) { - Rect startRect = new Rect(params.dp.overviewTaskRect); + Rect startRect = new Rect(); PagedOrientationHandler orientationHandler = params.recentsOrientedState .getOrientationHandler(); + LauncherActivityInterface.INSTANCE.calculateTaskSize(params.context, params.dp, startRect); long distanceToCover = startRect.bottom; PendingAnimation resistAnim = params.resistAnim != null ? params.resistAnim diff --git a/quickstep/src/com/android/quickstep/util/LayoutUtils.java b/quickstep/src/com/android/quickstep/util/LayoutUtils.java index d4eb880c61..d0856bed20 100644 --- a/quickstep/src/com/android/quickstep/util/LayoutUtils.java +++ b/quickstep/src/com/android/quickstep/util/LayoutUtils.java @@ -16,6 +16,7 @@ package com.android.quickstep.util; import android.content.Context; +import android.graphics.Rect; import android.view.View; import android.view.ViewGroup; @@ -23,6 +24,7 @@ import com.android.launcher3.DeviceProfile; import com.android.launcher3.touch.PagedOrientationHandler; import com.android.launcher3.util.DisplayController; import com.android.launcher3.util.DisplayController.NavigationMode; +import com.android.quickstep.LauncherActivityInterface; public class LayoutUtils { @@ -37,12 +39,12 @@ public class LayoutUtils { return swipeHeight; } - /** - * Returns the shelf tracking distance. - */ - public static int getShelfTrackingDistance(DeviceProfile dp, + public static int getShelfTrackingDistance(Context context, DeviceProfile dp, PagedOrientationHandler orientationHandler) { - return orientationHandler.getDistanceToBottomOfRect(dp, dp.overviewTaskRect); + // Track the bottom of the window. + Rect taskSize = new Rect(); + LauncherActivityInterface.INSTANCE.calculateTaskSize(context, dp, taskSize); + return orientationHandler.getDistanceToBottomOfRect(dp, taskSize); } /** diff --git a/quickstep/src/com/android/quickstep/util/RecentsOrientedState.java b/quickstep/src/com/android/quickstep/util/RecentsOrientedState.java index 39e379771a..dec934a87b 100644 --- a/quickstep/src/com/android/quickstep/util/RecentsOrientedState.java +++ b/quickstep/src/com/android/quickstep/util/RecentsOrientedState.java @@ -25,6 +25,7 @@ import static android.view.Surface.ROTATION_90; import static com.android.launcher3.states.RotationHelper.ALLOW_ROTATION_PREFERENCE_KEY; import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR; import static com.android.launcher3.util.SettingsCache.ROTATION_SETTING_URI; +import static com.android.quickstep.BaseActivityInterface.getTaskDimension; import static java.lang.annotation.RetentionPolicy.SOURCE; @@ -397,8 +398,8 @@ public class RecentsOrientedState implements * Returns the scale and pivot so that the provided taskRect can fit the provided full size */ public float getFullScreenScaleAndPivot(Rect taskView, DeviceProfile dp, PointF outPivot) { - float scale = Math.min(dp.taskDimension.x / taskView.width(), - dp.taskDimension.y / taskView.height()); + getTaskDimension(dp, outPivot); + float scale = Math.min(outPivot.x / taskView.width(), outPivot.y / taskView.height()); if (scale == 1) { outPivot.set(taskView.centerX(), taskView.centerY()); } else { diff --git a/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java b/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java index c626b0ac81..8c48443ef3 100644 --- a/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java +++ b/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java @@ -144,8 +144,12 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy { if (mDp == null) { return 1; } - mTaskRect.set( - mIsGridTask ? mDp.getOverviewGridTaskRect(mIsRecentsRtl) : mDp.overviewTaskRect); + if (mIsGridTask) { + mSizeStrategy.calculateGridTaskSize(mContext, mDp, mTaskRect, + mOrientationState.getOrientationHandler()); + } else { + mSizeStrategy.calculateTaskSize(mContext, mDp, mTaskRect); + } Rect fullTaskSize; if (mSplitBounds != null) { diff --git a/quickstep/src/com/android/quickstep/views/OverviewActionsView.java b/quickstep/src/com/android/quickstep/views/OverviewActionsView.java index c9d6394fc8..9b585fcf8b 100644 --- a/quickstep/src/com/android/quickstep/views/OverviewActionsView.java +++ b/quickstep/src/com/android/quickstep/views/OverviewActionsView.java @@ -93,6 +93,7 @@ public class OverviewActionsView extends FrameLayo @Nullable protected DeviceProfile mDp; + private final Rect mTaskSize = new Rect(); public OverviewActionsView(Context context) { this(context, null); @@ -239,15 +240,16 @@ public class OverviewActionsView extends FrameLayo } // Align to bottom of task Rect. - return mDp.heightPx - mDp.overviewTaskRect.bottom - mDp.overviewActionsTopMarginPx + return mDp.heightPx - mTaskSize.bottom - mDp.overviewActionsTopMarginPx - mDp.overviewActionsHeight; } /** - * Updates device profile for this view to draw with. + * Updates device profile and task size for this view to draw with. */ - public void updateDimension(DeviceProfile dp) { + public void updateDimension(DeviceProfile dp, Rect taskSize) { mDp = dp; + mTaskSize.set(taskSize); updateVerticalMargin(DisplayController.getNavigationMode(getContext())); requestLayout(); diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index c657957ce9..583d0970a7 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -428,6 +428,9 @@ public abstract class RecentsView= 0) { taskView = getTaskViewAt(--targetPage); } - DeviceProfile dp = mActivity.getDeviceProfile(); - Rect gridTaskRect = dp.getOverviewGridTaskRect(mIsRtl); // Target a scroll where targetPage is on left of screen but still fully visible. - int lastTaskEnd = (mIsRtl ? dp.overviewGridRect.left : dp.overviewGridRect.right) + int lastTaskEnd = (mIsRtl + ? mLastComputedGridSize.left + : mLastComputedGridSize.right) + (mIsRtl ? mPageSpacing : -mPageSpacing); - int normalTaskEnd = mIsRtl ? gridTaskRect.left : gridTaskRect.right; + int normalTaskEnd = mIsRtl + ? mLastComputedGridTaskSize.left + : mLastComputedGridTaskSize.right; int targetScroll = getScrollForPage(targetPage) + normalTaskEnd - lastTaskEnd; // Find a page that is close to targetScroll while not over it. while (targetPage - 1 >= 0 diff --git a/quickstep/src/com/android/quickstep/views/TaskView.java b/quickstep/src/com/android/quickstep/views/TaskView.java index d2b85f65c6..ded0ea620b 100644 --- a/quickstep/src/com/android/quickstep/views/TaskView.java +++ b/quickstep/src/com/android/quickstep/views/TaskView.java @@ -1431,8 +1431,9 @@ public class TaskView extends FrameLayout implements Reusable { DeviceProfile deviceProfile = mActivity.getDeviceProfile(); if (deviceProfile.isTablet) { final int thumbnailPadding = deviceProfile.overviewTaskThumbnailTopMarginPx; - final int taskWidth = deviceProfile.overviewTaskRect.width(); - final int taskHeight = deviceProfile.overviewTaskRect.height(); + final Rect lastComputedTaskSize = getRecentsView().getLastComputedTaskSize(); + final int taskWidth = lastComputedTaskSize.width(); + final int taskHeight = lastComputedTaskSize.height(); int boxWidth; int boxHeight; @@ -1443,9 +1444,10 @@ public class TaskView extends FrameLayout implements Reusable { boxWidth = taskWidth; boxHeight = taskHeight; } else { - // Otherwise task is in grid. - boxWidth = deviceProfile.overviewGridTaskDimension.x; - boxHeight = deviceProfile.overviewGridTaskDimension.y; + // Otherwise task is in grid, and should use lastComputedGridTaskSize. + Rect lastComputedGridTaskSize = getRecentsView().getLastComputedGridTaskSize(); + boxWidth = lastComputedGridTaskSize.width(); + boxHeight = lastComputedGridTaskSize.height(); } // Bound width/height to the box size. diff --git a/quickstep/tests/src/com/android/quickstep/DeviceProfilePhone3ButtonTest.kt b/quickstep/tests/src/com/android/quickstep/DeviceProfilePhone3ButtonTest.kt index 588e346a79..3daf81d8a6 100644 --- a/quickstep/tests/src/com/android/quickstep/DeviceProfilePhone3ButtonTest.kt +++ b/quickstep/tests/src/com/android/quickstep/DeviceProfilePhone3ButtonTest.kt @@ -483,114 +483,4 @@ class DeviceProfilePhone3ButtonTest : DeviceProfileBaseTest() { fun hotseatBarEndOffset() { assertThat(dp.hotseatBarEndOffset).isEqualTo(0) } - - @Test - fun overviewGridRectLeft() { - assertThat(dp.overviewGridRect.left).isEqualTo(0) - } - - @Test - fun overviewGridRectTop() { - assertThat(dp.overviewGridRect.top).isEqualTo(280) - } - - @Test - fun overviewGridRectRight() { - assertThat(dp.overviewGridRect.right).isEqualTo(1440) - } - - @Test - fun overviewGridRectBottom() { - assertThat(dp.overviewGridRect.bottom).isEqualTo(2768) - } - - @Test - fun taskDimensionX() { - assertThat(dp.taskDimension.x).isEqualTo(1440) - } - - @Test - fun taskDimensionY() { - assertThat(dp.taskDimension.y).isEqualTo(3120) - } - - @Test - fun overviewTaskRectLeft() { - assertThat(dp.overviewTaskRect.left).isEqualTo(231) - } - - @Test - fun overviewTaskRectTop() { - assertThat(dp.overviewTaskRect.top).isEqualTo(414) - } - - @Test - fun overviewTaskRectRight() { - assertThat(dp.overviewTaskRect.right).isEqualTo(1209) - } - - @Test - fun overviewTaskRectBottom() { - assertThat(dp.overviewTaskRect.bottom).isEqualTo(2533) - } - - @Test - fun overviewGridTaskDimensionX() { - assertThat(dp.overviewGridTaskDimension.x).isEqualTo(450) - } - - @Test - fun overviewGridTaskDimensionY() { - assertThat(dp.overviewGridTaskDimension.y).isEqualTo(976) - } - - @Test - fun overviewModalTaskRectLeft() { - assertThat(dp.overviewModalTaskRect.left).isEqualTo(182) - } - - @Test - fun overviewModalTaskRectTop() { - assertThat(dp.overviewModalTaskRect.top).isEqualTo(202) - } - - @Test - fun overviewModalTaskRectRight() { - assertThat(dp.overviewModalTaskRect.right).isEqualTo(1258) - } - - @Test - fun overviewModalTaskRectBottom() { - assertThat(dp.overviewModalTaskRect.bottom).isEqualTo(2533) - } - - @Test - fun getGridTaskRectLeft() { - assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).left).isEqualTo(759) - } - - @Test - fun getGridTaskRectTop() { - assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).top).isEqualTo(414) - } - - @Test - fun getGridTaskRectRight() { - assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).right).isEqualTo(1209) - } - - @Test - fun getGridTaskRectBottom() { - assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).bottom).isEqualTo(1390) - } - - @Test - fun overviewTaskScale() { - assertThat(dp.overviewTaskWorkspaceScale).isEqualTo(0.86595833f) - } - - @Test - fun overviewModalTaskScale() { - assertThat(dp.overviewModalTaskScale).isEqualTo(1.1000472f) - } } \ No newline at end of file diff --git a/quickstep/tests/src/com/android/quickstep/DeviceProfilePhoneTest.kt b/quickstep/tests/src/com/android/quickstep/DeviceProfilePhoneTest.kt index f91d03d50c..e588c71277 100644 --- a/quickstep/tests/src/com/android/quickstep/DeviceProfilePhoneTest.kt +++ b/quickstep/tests/src/com/android/quickstep/DeviceProfilePhoneTest.kt @@ -483,114 +483,4 @@ class DeviceProfilePhoneTest : DeviceProfileBaseTest() { fun hotseatBarEndOffset() { assertThat(dp.hotseatBarEndOffset).isEqualTo(0) } - - @Test - fun overviewGridRectLeft() { - assertThat(dp.overviewGridRect.left).isEqualTo(0) - } - - @Test - fun overviewGridRectTop() { - assertThat(dp.overviewGridRect.top).isEqualTo(280) - } - - @Test - fun overviewGridRectRight() { - assertThat(dp.overviewGridRect.right).isEqualTo(1440) - } - - @Test - fun overviewGridRectBottom() { - assertThat(dp.overviewGridRect.bottom).isEqualTo(2768) - } - - @Test - fun taskDimensionX() { - assertThat(dp.taskDimension.x).isEqualTo(1440) - } - - @Test - fun taskDimensionY() { - assertThat(dp.taskDimension.y).isEqualTo(3120) - } - - @Test - fun overviewTaskRectLeft() { - assertThat(dp.overviewTaskRect.left).isEqualTo(231) - } - - @Test - fun overviewTaskRectTop() { - assertThat(dp.overviewTaskRect.top).isEqualTo(414) - } - - @Test - fun overviewTaskRectRight() { - assertThat(dp.overviewTaskRect.right).isEqualTo(1209) - } - - @Test - fun overviewTaskRectBottom() { - assertThat(dp.overviewTaskRect.bottom).isEqualTo(2533) - } - - @Test - fun overviewGridTaskDimensionX() { - assertThat(dp.overviewGridTaskDimension.x).isEqualTo(450) - } - - @Test - fun overviewGridTaskDimensionY() { - assertThat(dp.overviewGridTaskDimension.y).isEqualTo(976) - } - - @Test - fun overviewModalTaskRectLeft() { - assertThat(dp.overviewModalTaskRect.left).isEqualTo(182) - } - - @Test - fun overviewModalTaskRectTop() { - assertThat(dp.overviewModalTaskRect.top).isEqualTo(202) - } - - @Test - fun overviewModalTaskRectRight() { - assertThat(dp.overviewModalTaskRect.right).isEqualTo(1258) - } - - @Test - fun overviewModalTaskRectBottom() { - assertThat(dp.overviewModalTaskRect.bottom).isEqualTo(2533) - } - - @Test - fun getGridTaskRectLeft() { - assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).left).isEqualTo(759) - } - - @Test - fun getGridTaskRectTop() { - assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).top).isEqualTo(414) - } - - @Test - fun getGridTaskRectRight() { - assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).right).isEqualTo(1209) - } - - @Test - fun getGridTaskRectBottom() { - assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).bottom).isEqualTo(1390) - } - - @Test - fun overviewTaskScale() { - assertThat(dp.overviewTaskWorkspaceScale).isEqualTo(0.86595833f) - } - - @Test - fun overviewModalTaskScale() { - assertThat(dp.overviewModalTaskScale).isEqualTo(1.1000472f) - } } \ No newline at end of file diff --git a/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletLandscape3ButtonTest.kt b/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletLandscape3ButtonTest.kt index 2d9e263a93..3f8d2fb13f 100644 --- a/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletLandscape3ButtonTest.kt +++ b/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletLandscape3ButtonTest.kt @@ -483,114 +483,4 @@ class DeviceProfileTabletLandscape3ButtonTest : DeviceProfileBaseTest() { fun hotseatBarEndOffset() { assertThat(dp.hotseatBarEndOffset).isEqualTo(428) } - - @Test - fun overviewGridRectLeft() { - assertThat(dp.overviewGridRect.left).isEqualTo(128) - } - - @Test - fun overviewGridRectTop() { - assertThat(dp.overviewGridRect.top).isEqualTo(160) - } - - @Test - fun overviewGridRectRight() { - assertThat(dp.overviewGridRect.right).isEqualTo(2432) - } - - @Test - fun overviewGridRectBottom() { - assertThat(dp.overviewGridRect.bottom).isEqualTo(1340) - } - - @Test - fun taskDimensionX() { - assertThat(dp.taskDimension.x).isEqualTo(2560) - } - - @Test - fun taskDimensionY() { - assertThat(dp.taskDimension.y).isEqualTo(1480) - } - - @Test - fun overviewTaskRectLeft() { - assertThat(dp.overviewTaskRect.left).isEqualTo(384) - } - - @Test - fun overviewTaskRectTop() { - assertThat(dp.overviewTaskRect.top).isEqualTo(232) - } - - @Test - fun overviewTaskRectRight() { - assertThat(dp.overviewTaskRect.right).isEqualTo(2176) - } - - @Test - fun overviewTaskRectBottom() { - assertThat(dp.overviewTaskRect.bottom).isEqualTo(1268) - } - - @Test - fun overviewGridTaskDimensionX() { - assertThat(dp.overviewGridTaskDimension.x).isEqualTo(723) - } - - @Test - fun overviewGridTaskDimensionY() { - assertThat(dp.overviewGridTaskDimension.y).isEqualTo(418) - } - - @Test - fun overviewModalTaskRectLeft() { - assertThat(dp.overviewModalTaskRect.left).isEqualTo(294) - } - - @Test - fun overviewModalTaskRectTop() { - assertThat(dp.overviewModalTaskRect.top).isEqualTo(128) - } - - @Test - fun overviewModalTaskRectRight() { - assertThat(dp.overviewModalTaskRect.right).isEqualTo(2266) - } - - @Test - fun overviewModalTaskRectBottom() { - assertThat(dp.overviewModalTaskRect.bottom).isEqualTo(1268) - } - - @Test - fun getGridTaskRectLeft() { - assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).left).isEqualTo(1453) - } - - @Test - fun getGridTaskRectTop() { - assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).top).isEqualTo(232) - } - - @Test - fun getGridTaskRectRight() { - assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).right).isEqualTo(2176) - } - - @Test - fun getGridTaskRectBottom() { - assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).bottom).isEqualTo(650) - } - - @Test - fun overviewTaskScale() { - assertThat(dp.overviewTaskWorkspaceScale).isEqualTo(0.7363184f) - } - - @Test - fun overviewModalTaskScale() { - assertThat(dp.overviewModalTaskScale).isEqualTo(1.1003861f) - } } \ No newline at end of file diff --git a/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletLandscapeTest.kt b/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletLandscapeTest.kt index 3add2c7269..456ed2cfc0 100644 --- a/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletLandscapeTest.kt +++ b/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletLandscapeTest.kt @@ -483,114 +483,4 @@ class DeviceProfileTabletLandscapeTest : DeviceProfileBaseTest() { fun hotseatBarEndOffset() { assertThat(dp.hotseatBarEndOffset).isEqualTo(0) } - - @Test - fun overviewGridRectLeft() { - assertThat(dp.overviewGridRect.left).isEqualTo(128) - } - - @Test - fun overviewGridRectTop() { - assertThat(dp.overviewGridRect.top).isEqualTo(160) - } - - @Test - fun overviewGridRectRight() { - assertThat(dp.overviewGridRect.right).isEqualTo(2432) - } - - @Test - fun overviewGridRectBottom() { - assertThat(dp.overviewGridRect.bottom).isEqualTo(1416) - } - - @Test - fun taskDimensionX() { - assertThat(dp.taskDimension.x).isEqualTo(2560) - } - - @Test - fun taskDimensionY() { - assertThat(dp.taskDimension.y).isEqualTo(1480) - } - - @Test - fun overviewTaskRectLeft() { - assertThat(dp.overviewTaskRect.left).isEqualTo(384) - } - - @Test - fun overviewTaskRectTop() { - assertThat(dp.overviewTaskRect.top).isEqualTo(270) - } - - @Test - fun overviewTaskRectRight() { - assertThat(dp.overviewTaskRect.right).isEqualTo(2176) - } - - @Test - fun overviewTaskRectBottom() { - assertThat(dp.overviewTaskRect.bottom).isEqualTo(1306) - } - - @Test - fun overviewGridTaskDimensionX() { - assertThat(dp.overviewGridTaskDimension.x).isEqualTo(723) - } - - @Test - fun overviewGridTaskDimensionY() { - assertThat(dp.overviewGridTaskDimension.y).isEqualTo(418) - } - - @Test - fun overviewModalTaskRectLeft() { - assertThat(dp.overviewModalTaskRect.left).isEqualTo(294) - } - - @Test - fun overviewModalTaskRectTop() { - assertThat(dp.overviewModalTaskRect.top).isEqualTo(166) - } - - @Test - fun overviewModalTaskRectRight() { - assertThat(dp.overviewModalTaskRect.right).isEqualTo(2266) - } - - @Test - fun overviewModalTaskRectBottom() { - assertThat(dp.overviewModalTaskRect.bottom).isEqualTo(1306) - } - - @Test - fun getGridTaskRectLeft() { - assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).left).isEqualTo(1453) - } - - @Test - fun getGridTaskRectTop() { - assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).top).isEqualTo(270) - } - - @Test - fun getGridTaskRectRight() { - assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).right).isEqualTo(2176) - } - - @Test - fun getGridTaskRectBottom() { - assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).bottom).isEqualTo(688) - } - - @Test - fun overviewTaskScale() { - assertThat(dp.overviewTaskWorkspaceScale).isEqualTo(0.7363184f) - } - - @Test - fun overviewModalTaskScale() { - assertThat(dp.overviewModalTaskScale).isEqualTo(1.1003861f) - } } \ No newline at end of file diff --git a/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletPortrait3ButtonTest.kt b/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletPortrait3ButtonTest.kt index 7f0d6ca022..b53b36a9d9 100644 --- a/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletPortrait3ButtonTest.kt +++ b/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletPortrait3ButtonTest.kt @@ -483,114 +483,4 @@ class DeviceProfileTabletPortrait3ButtonTest : DeviceProfileBaseTest() { fun hotseatBarEndOffset() { assertThat(dp.hotseatBarEndOffset).isEqualTo(428) } - - @Test - fun overviewGridRectLeft() { - assertThat(dp.overviewGridRect.left).isEqualTo(128) - } - - @Test - fun overviewGridRectTop() { - assertThat(dp.overviewGridRect.top).isEqualTo(160) - } - - @Test - fun overviewGridRectRight() { - assertThat(dp.overviewGridRect.right).isEqualTo(1472) - } - - @Test - fun overviewGridRectBottom() { - assertThat(dp.overviewGridRect.bottom).isEqualTo(2292) - } - - @Test - fun taskDimensionX() { - assertThat(dp.taskDimension.x).isEqualTo(1600) - } - - @Test - fun taskDimensionY() { - assertThat(dp.taskDimension.y).isEqualTo(2440) - } - - @Test - fun overviewTaskRectLeft() { - assertThat(dp.overviewTaskRect.left).isEqualTo(240) - } - - @Test - fun overviewTaskRectTop() { - assertThat(dp.overviewTaskRect.top).isEqualTo(372) - } - - @Test - fun overviewTaskRectRight() { - assertThat(dp.overviewTaskRect.right).isEqualTo(1360) - } - - @Test - fun overviewTaskRectBottom() { - assertThat(dp.overviewTaskRect.bottom).isEqualTo(2080) - } - - @Test - fun overviewGridTaskDimensionX() { - assertThat(dp.overviewGridTaskDimension.x).isEqualTo(494) - } - - @Test - fun overviewGridTaskDimensionY() { - assertThat(dp.overviewGridTaskDimension.y).isEqualTo(754) - } - - @Test - fun overviewModalTaskRectLeft() { - assertThat(dp.overviewModalTaskRect.left).isEqualTo(184) - } - - @Test - fun overviewModalTaskRectTop() { - assertThat(dp.overviewModalTaskRect.top).isEqualTo(201) - } - - @Test - fun overviewModalTaskRectRight() { - assertThat(dp.overviewModalTaskRect.right).isEqualTo(1416) - } - - @Test - fun overviewModalTaskRectBottom() { - assertThat(dp.overviewModalTaskRect.bottom).isEqualTo(2080) - } - - @Test - fun getGridTaskRectLeft() { - assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).left).isEqualTo(866) - } - - @Test - fun getGridTaskRectTop() { - assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).top).isEqualTo(372) - } - - @Test - fun getGridTaskRectRight() { - assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).right).isEqualTo(1360) - } - - @Test - fun getGridTaskRectBottom() { - assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).bottom).isEqualTo(1126) - } - - @Test - fun overviewTaskScale() { - assertThat(dp.overviewTaskWorkspaceScale).isEqualTo(0.7686769f) - } - - @Test - fun overviewModalTaskScale() { - assertThat(dp.overviewModalTaskScale).isEqualTo(1.1f) - } } \ No newline at end of file diff --git a/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletPortraitTest.kt b/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletPortraitTest.kt index 1a709e6f7a..4be3e45dce 100644 --- a/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletPortraitTest.kt +++ b/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletPortraitTest.kt @@ -483,114 +483,4 @@ class DeviceProfileTabletPortraitTest : DeviceProfileBaseTest() { fun hotseatBarEndOffset() { assertThat(dp.hotseatBarEndOffset).isEqualTo(0) } - - @Test - fun overviewGridRectLeft() { - assertThat(dp.overviewGridRect.left).isEqualTo(128) - } - - @Test - fun overviewGridRectTop() { - assertThat(dp.overviewGridRect.top).isEqualTo(160) - } - - @Test - fun overviewGridRectRight() { - assertThat(dp.overviewGridRect.right).isEqualTo(1472) - } - - @Test - fun overviewGridRectBottom() { - assertThat(dp.overviewGridRect.bottom).isEqualTo(2368) - } - - @Test - fun taskDimensionX() { - assertThat(dp.taskDimension.x).isEqualTo(1600) - } - - @Test - fun taskDimensionY() { - assertThat(dp.taskDimension.y).isEqualTo(2440) - } - - @Test - fun overviewTaskRectLeft() { - assertThat(dp.overviewTaskRect.left).isEqualTo(240) - } - - @Test - fun overviewTaskRectTop() { - assertThat(dp.overviewTaskRect.top).isEqualTo(410) - } - - @Test - fun overviewTaskRectRight() { - assertThat(dp.overviewTaskRect.right).isEqualTo(1360) - } - - @Test - fun overviewTaskRectBottom() { - assertThat(dp.overviewTaskRect.bottom).isEqualTo(2118) - } - - @Test - fun overviewGridTaskDimensionX() { - assertThat(dp.overviewGridTaskDimension.x).isEqualTo(494) - } - - @Test - fun overviewGridTaskDimensionY() { - assertThat(dp.overviewGridTaskDimension.y).isEqualTo(754) - } - - @Test - fun overviewModalTaskRectLeft() { - assertThat(dp.overviewModalTaskRect.left).isEqualTo(184) - } - - @Test - fun overviewModalTaskRectTop() { - assertThat(dp.overviewModalTaskRect.top).isEqualTo(239) - } - - @Test - fun overviewModalTaskRectRight() { - assertThat(dp.overviewModalTaskRect.right).isEqualTo(1416) - } - - @Test - fun overviewModalTaskRectBottom() { - assertThat(dp.overviewModalTaskRect.bottom).isEqualTo(2118) - } - - @Test - fun getGridTaskRectLeft() { - assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).left).isEqualTo(866) - } - - @Test - fun getGridTaskRectTop() { - assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).top).isEqualTo(410) - } - - @Test - fun getGridTaskRectRight() { - assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).right).isEqualTo(1360) - } - - @Test - fun getGridTaskRectBottom() { - assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).bottom).isEqualTo(1164) - } - - @Test - fun overviewTaskScale() { - assertThat(dp.overviewTaskWorkspaceScale).isEqualTo(0.7686769f) - } - - @Test - fun overviewModalTaskScale() { - assertThat(dp.overviewModalTaskScale).isEqualTo(1.1f) - } } \ No newline at end of file diff --git a/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelLandscape3ButtonTest.kt b/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelLandscape3ButtonTest.kt index 0eeb23dede..274ca95405 100644 --- a/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelLandscape3ButtonTest.kt +++ b/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelLandscape3ButtonTest.kt @@ -483,114 +483,4 @@ class DeviceProfileTwoPanelLandscape3ButtonTest : DeviceProfileBaseTest() { fun hotseatBarEndOffset() { assertThat(dp.hotseatBarEndOffset).isEqualTo(428) } - - @Test - fun overviewGridRectLeft() { - assertThat(dp.overviewGridRect.left).isEqualTo(128) - } - - @Test - fun overviewGridRectTop() { - assertThat(dp.overviewGridRect.top).isEqualTo(160) - } - - @Test - fun overviewGridRectRight() { - assertThat(dp.overviewGridRect.right).isEqualTo(2432) - } - - @Test - fun overviewGridRectBottom() { - assertThat(dp.overviewGridRect.bottom).isEqualTo(1340) - } - - @Test - fun taskDimensionX() { - assertThat(dp.taskDimension.x).isEqualTo(2560) - } - - @Test - fun taskDimensionY() { - assertThat(dp.taskDimension.y).isEqualTo(1480) - } - - @Test - fun overviewTaskRectLeft() { - assertThat(dp.overviewTaskRect.left).isEqualTo(384) - } - - @Test - fun overviewTaskRectTop() { - assertThat(dp.overviewTaskRect.top).isEqualTo(232) - } - - @Test - fun overviewTaskRectRight() { - assertThat(dp.overviewTaskRect.right).isEqualTo(2176) - } - - @Test - fun overviewTaskRectBottom() { - assertThat(dp.overviewTaskRect.bottom).isEqualTo(1268) - } - - @Test - fun overviewGridTaskDimensionX() { - assertThat(dp.overviewGridTaskDimension.x).isEqualTo(723) - } - - @Test - fun overviewGridTaskDimensionY() { - assertThat(dp.overviewGridTaskDimension.y).isEqualTo(418) - } - - @Test - fun overviewModalTaskRectLeft() { - assertThat(dp.overviewModalTaskRect.left).isEqualTo(294) - } - - @Test - fun overviewModalTaskRectTop() { - assertThat(dp.overviewModalTaskRect.top).isEqualTo(128) - } - - @Test - fun overviewModalTaskRectRight() { - assertThat(dp.overviewModalTaskRect.right).isEqualTo(2266) - } - - @Test - fun overviewModalTaskRectBottom() { - assertThat(dp.overviewModalTaskRect.bottom).isEqualTo(1268) - } - - @Test - fun getGridTaskRectLeft() { - assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).left).isEqualTo(1453) - } - - @Test - fun getGridTaskRectTop() { - assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).top).isEqualTo(232) - } - - @Test - fun getGridTaskRectRight() { - assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).right).isEqualTo(2176) - } - - @Test - fun getGridTaskRectBottom() { - assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).bottom).isEqualTo(650) - } - - @Test - fun overviewTaskScale() { - assertThat(dp.overviewTaskWorkspaceScale).isEqualTo(0.8526749f) - } - - @Test - fun overviewModalTaskScale() { - assertThat(dp.overviewModalTaskScale).isEqualTo(1.1003861f) - } } \ No newline at end of file diff --git a/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelLandscapeTest.kt b/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelLandscapeTest.kt index 7bf53d7453..ba3ef55e3c 100644 --- a/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelLandscapeTest.kt +++ b/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelLandscapeTest.kt @@ -483,114 +483,4 @@ class DeviceProfileTwoPanelLandscapeTest : DeviceProfileBaseTest() { fun hotseatBarEndOffset() { assertThat(dp.hotseatBarEndOffset).isEqualTo(0) } - - @Test - fun overviewGridRectLeft() { - assertThat(dp.overviewGridRect.left).isEqualTo(128) - } - - @Test - fun overviewGridRectTop() { - assertThat(dp.overviewGridRect.top).isEqualTo(160) - } - - @Test - fun overviewGridRectRight() { - assertThat(dp.overviewGridRect.right).isEqualTo(2432) - } - - @Test - fun overviewGridRectBottom() { - assertThat(dp.overviewGridRect.bottom).isEqualTo(1416) - } - - @Test - fun taskDimensionX() { - assertThat(dp.taskDimension.x).isEqualTo(2560) - } - - @Test - fun taskDimensionY() { - assertThat(dp.taskDimension.y).isEqualTo(1480) - } - - @Test - fun overviewTaskRectLeft() { - assertThat(dp.overviewTaskRect.left).isEqualTo(384) - } - - @Test - fun overviewTaskRectTop() { - assertThat(dp.overviewTaskRect.top).isEqualTo(270) - } - - @Test - fun overviewTaskRectRight() { - assertThat(dp.overviewTaskRect.right).isEqualTo(2176) - } - - @Test - fun overviewTaskRectBottom() { - assertThat(dp.overviewTaskRect.bottom).isEqualTo(1306) - } - - @Test - fun overviewGridTaskDimensionX() { - assertThat(dp.overviewGridTaskDimension.x).isEqualTo(723) - } - - @Test - fun overviewGridTaskDimensionY() { - assertThat(dp.overviewGridTaskDimension.y).isEqualTo(418) - } - - @Test - fun overviewModalTaskRectLeft() { - assertThat(dp.overviewModalTaskRect.left).isEqualTo(294) - } - - @Test - fun overviewModalTaskRectTop() { - assertThat(dp.overviewModalTaskRect.top).isEqualTo(166) - } - - @Test - fun overviewModalTaskRectRight() { - assertThat(dp.overviewModalTaskRect.right).isEqualTo(2266) - } - - @Test - fun overviewModalTaskRectBottom() { - assertThat(dp.overviewModalTaskRect.bottom).isEqualTo(1306) - } - - @Test - fun getGridTaskRectLeft() { - assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).left).isEqualTo(1453) - } - - @Test - fun getGridTaskRectTop() { - assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).top).isEqualTo(270) - } - - @Test - fun getGridTaskRectRight() { - assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).right).isEqualTo(2176) - } - - @Test - fun getGridTaskRectBottom() { - assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).bottom).isEqualTo(688) - } - - @Test - fun overviewTaskScale() { - assertThat(dp.overviewTaskWorkspaceScale).isEqualTo(0.8526749f) - } - - @Test - fun overviewModalTaskScale() { - assertThat(dp.overviewModalTaskScale).isEqualTo(1.1003861f) - } } \ No newline at end of file diff --git a/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelPortrait3ButtonTest.kt b/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelPortrait3ButtonTest.kt index 9b6d7d55f2..7dd95f99f6 100644 --- a/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelPortrait3ButtonTest.kt +++ b/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelPortrait3ButtonTest.kt @@ -483,114 +483,4 @@ class DeviceProfileTwoPanelPortrait3ButtonTest : DeviceProfileBaseTest() { fun hotseatBarEndOffset() { assertThat(dp.hotseatBarEndOffset).isEqualTo(428) } - - @Test - fun overviewGridRectLeft() { - assertThat(dp.overviewGridRect.left).isEqualTo(128) - } - - @Test - fun overviewGridRectTop() { - assertThat(dp.overviewGridRect.top).isEqualTo(160) - } - - @Test - fun overviewGridRectRight() { - assertThat(dp.overviewGridRect.right).isEqualTo(1472) - } - - @Test - fun overviewGridRectBottom() { - assertThat(dp.overviewGridRect.bottom).isEqualTo(2292) - } - - @Test - fun taskDimensionX() { - assertThat(dp.taskDimension.x).isEqualTo(1600) - } - - @Test - fun taskDimensionY() { - assertThat(dp.taskDimension.y).isEqualTo(2440) - } - - @Test - fun overviewTaskRectLeft() { - assertThat(dp.overviewTaskRect.left).isEqualTo(240) - } - - @Test - fun overviewTaskRectTop() { - assertThat(dp.overviewTaskRect.top).isEqualTo(372) - } - - @Test - fun overviewTaskRectRight() { - assertThat(dp.overviewTaskRect.right).isEqualTo(1360) - } - - @Test - fun overviewTaskRectBottom() { - assertThat(dp.overviewTaskRect.bottom).isEqualTo(2080) - } - - @Test - fun overviewGridTaskDimensionX() { - assertThat(dp.overviewGridTaskDimension.x).isEqualTo(494) - } - - @Test - fun overviewGridTaskDimensionY() { - assertThat(dp.overviewGridTaskDimension.y).isEqualTo(754) - } - - @Test - fun overviewModalTaskRectLeft() { - assertThat(dp.overviewModalTaskRect.left).isEqualTo(184) - } - - @Test - fun overviewModalTaskRectTop() { - assertThat(dp.overviewModalTaskRect.top).isEqualTo(201) - } - - @Test - fun overviewModalTaskRectRight() { - assertThat(dp.overviewModalTaskRect.right).isEqualTo(1416) - } - - @Test - fun overviewModalTaskRectBottom() { - assertThat(dp.overviewModalTaskRect.bottom).isEqualTo(2080) - } - - @Test - fun getGridTaskRectLeft() { - assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).left).isEqualTo(866) - } - - @Test - fun getGridTaskRectTop() { - assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).top).isEqualTo(372) - } - - @Test - fun getGridTaskRectRight() { - assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).right).isEqualTo(1360) - } - - @Test - fun getGridTaskRectBottom() { - assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).bottom).isEqualTo(1126) - } - - @Test - fun overviewTaskScale() { - assertThat(dp.overviewTaskWorkspaceScale).isEqualTo(0.7874597f) - } - - @Test - fun overviewModalTaskScale() { - assertThat(dp.overviewModalTaskScale).isEqualTo(1.1f) - } } \ No newline at end of file diff --git a/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelPortraitTest.kt b/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelPortraitTest.kt index 6702eb5d46..0c5968e1ef 100644 --- a/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelPortraitTest.kt +++ b/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelPortraitTest.kt @@ -483,114 +483,4 @@ class DeviceProfileTwoPanelPortraitTest : DeviceProfileBaseTest() { fun hotseatBarEndOffset() { assertThat(dp.hotseatBarEndOffset).isEqualTo(0) } - - @Test - fun overviewGridRectLeft() { - assertThat(dp.overviewGridRect.left).isEqualTo(128) - } - - @Test - fun overviewGridRectTop() { - assertThat(dp.overviewGridRect.top).isEqualTo(160) - } - - @Test - fun overviewGridRectRight() { - assertThat(dp.overviewGridRect.right).isEqualTo(1472) - } - - @Test - fun overviewGridRectBottom() { - assertThat(dp.overviewGridRect.bottom).isEqualTo(2368) - } - - @Test - fun taskDimensionX() { - assertThat(dp.taskDimension.x).isEqualTo(1600) - } - - @Test - fun taskDimensionY() { - assertThat(dp.taskDimension.y).isEqualTo(2440) - } - - @Test - fun overviewTaskRectLeft() { - assertThat(dp.overviewTaskRect.left).isEqualTo(240) - } - - @Test - fun overviewTaskRectTop() { - assertThat(dp.overviewTaskRect.top).isEqualTo(410) - } - - @Test - fun overviewTaskRectRight() { - assertThat(dp.overviewTaskRect.right).isEqualTo(1360) - } - - @Test - fun overviewTaskRectBottom() { - assertThat(dp.overviewTaskRect.bottom).isEqualTo(2118) - } - - @Test - fun overviewGridTaskDimensionX() { - assertThat(dp.overviewGridTaskDimension.x).isEqualTo(494) - } - - @Test - fun overviewGridTaskDimensionY() { - assertThat(dp.overviewGridTaskDimension.y).isEqualTo(754) - } - - @Test - fun overviewModalTaskRectLeft() { - assertThat(dp.overviewModalTaskRect.left).isEqualTo(184) - } - - @Test - fun overviewModalTaskRectTop() { - assertThat(dp.overviewModalTaskRect.top).isEqualTo(239) - } - - @Test - fun overviewModalTaskRectRight() { - assertThat(dp.overviewModalTaskRect.right).isEqualTo(1416) - } - - @Test - fun overviewModalTaskRectBottom() { - assertThat(dp.overviewModalTaskRect.bottom).isEqualTo(2118) - } - - @Test - fun getGridTaskRectLeft() { - assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).left).isEqualTo(866) - } - - @Test - fun getGridTaskRectTop() { - assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).top).isEqualTo(410) - } - - @Test - fun getGridTaskRectRight() { - assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).right).isEqualTo(1360) - } - - @Test - fun getGridTaskRectBottom() { - assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).bottom).isEqualTo(1164) - } - - @Test - fun overviewTaskScale() { - assertThat(dp.overviewTaskWorkspaceScale).isEqualTo(0.7874597f) - } - - @Test - fun overviewModalTaskScale() { - assertThat(dp.overviewModalTaskScale).isEqualTo(1.1f) - } } \ No newline at end of file diff --git a/quickstep/tests/src/com/android/quickstep/DeviceProfileVerticalBar3ButtonTest.kt b/quickstep/tests/src/com/android/quickstep/DeviceProfileVerticalBar3ButtonTest.kt index 7e0c5f3b9b..2bad6bb20b 100644 --- a/quickstep/tests/src/com/android/quickstep/DeviceProfileVerticalBar3ButtonTest.kt +++ b/quickstep/tests/src/com/android/quickstep/DeviceProfileVerticalBar3ButtonTest.kt @@ -483,114 +483,4 @@ class DeviceProfileVerticalBar3ButtonTest : DeviceProfileBaseTest() { fun hotseatBarEndOffset() { assertThat(dp.hotseatBarEndOffset).isEqualTo(0) } - - @Test - fun overviewGridRectLeft() { - assertThat(dp.overviewGridRect.left).isEqualTo(0) - } - - @Test - fun overviewGridRectTop() { - assertThat(dp.overviewGridRect.top).isEqualTo(280) - } - - @Test - fun overviewGridRectRight() { - assertThat(dp.overviewGridRect.right).isEqualTo(3120) - } - - @Test - fun overviewGridRectBottom() { - assertThat(dp.overviewGridRect.bottom).isEqualTo(1130) - } - - @Test - fun taskDimensionX() { - assertThat(dp.taskDimension.x).isEqualTo(3120) - } - - @Test - fun taskDimensionY() { - assertThat(dp.taskDimension.y).isEqualTo(1440) - } - - @Test - fun overviewTaskRectLeft() { - assertThat(dp.overviewTaskRect.left).isEqualTo(747) - } - - @Test - fun overviewTaskRectTop() { - assertThat(dp.overviewTaskRect.top).isEqualTo(280) - } - - @Test - fun overviewTaskRectRight() { - assertThat(dp.overviewTaskRect.right).isEqualTo(2372) - } - - @Test - fun overviewTaskRectBottom() { - assertThat(dp.overviewTaskRect.bottom).isEqualTo(1030) - } - - @Test - fun overviewGridTaskDimensionX() { - assertThat(dp.overviewGridTaskDimension.x).isEqualTo(631) - } - - @Test - fun overviewGridTaskDimensionY() { - assertThat(dp.overviewGridTaskDimension.y).isEqualTo(291) - } - - @Test - fun overviewModalTaskRectLeft() { - assertThat(dp.overviewModalTaskRect.left).isEqualTo(666) - } - - @Test - fun overviewModalTaskRectTop() { - assertThat(dp.overviewModalTaskRect.top).isEqualTo(205) - } - - @Test - fun overviewModalTaskRectRight() { - assertThat(dp.overviewModalTaskRect.right).isEqualTo(2454) - } - - @Test - fun overviewModalTaskRectBottom() { - assertThat(dp.overviewModalTaskRect.bottom).isEqualTo(1030) - } - - @Test - fun getGridTaskRectLeft() { - assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).left).isEqualTo(1741) - } - - @Test - fun getGridTaskRectTop() { - assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).top).isEqualTo(280) - } - - @Test - fun getGridTaskRectRight() { - assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).right).isEqualTo(2372) - } - - @Test - fun getGridTaskRectBottom() { - assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).bottom).isEqualTo(571) - } - - @Test - fun overviewTaskScale() { - assertThat(dp.overviewTaskWorkspaceScale).isEqualTo(0.5597015f) - } - - @Test - fun overviewModalTaskScale() { - assertThat(dp.overviewModalTaskScale).isEqualTo(1.1f) - } } \ No newline at end of file diff --git a/quickstep/tests/src/com/android/quickstep/DeviceProfileVerticalBarTest.kt b/quickstep/tests/src/com/android/quickstep/DeviceProfileVerticalBarTest.kt index 9580458a13..6256a43f75 100644 --- a/quickstep/tests/src/com/android/quickstep/DeviceProfileVerticalBarTest.kt +++ b/quickstep/tests/src/com/android/quickstep/DeviceProfileVerticalBarTest.kt @@ -483,114 +483,4 @@ class DeviceProfileVerticalBarTest : DeviceProfileBaseTest() { fun hotseatBarEndOffset() { assertThat(dp.hotseatBarEndOffset).isEqualTo(0) } - - @Test - fun overviewGridRectLeft() { - assertThat(dp.overviewGridRect.left).isEqualTo(0) - } - - @Test - fun overviewGridRectTop() { - assertThat(dp.overviewGridRect.top).isEqualTo(280) - } - - @Test - fun overviewGridRectRight() { - assertThat(dp.overviewGridRect.right).isEqualTo(3120) - } - - @Test - fun overviewGridRectBottom() { - assertThat(dp.overviewGridRect.bottom).isEqualTo(1130) - } - - @Test - fun taskDimensionX() { - assertThat(dp.taskDimension.x).isEqualTo(3120) - } - - @Test - fun taskDimensionY() { - assertThat(dp.taskDimension.y).isEqualTo(1440) - } - - @Test - fun overviewTaskRectLeft() { - assertThat(dp.overviewTaskRect.left).isEqualTo(747) - } - - @Test - fun overviewTaskRectTop() { - assertThat(dp.overviewTaskRect.top).isEqualTo(280) - } - - @Test - fun overviewTaskRectRight() { - assertThat(dp.overviewTaskRect.right).isEqualTo(2372) - } - - @Test - fun overviewTaskRectBottom() { - assertThat(dp.overviewTaskRect.bottom).isEqualTo(1030) - } - - @Test - fun overviewGridTaskDimensionX() { - assertThat(dp.overviewGridTaskDimension.x).isEqualTo(631) - } - - @Test - fun overviewGridTaskDimensionY() { - assertThat(dp.overviewGridTaskDimension.y).isEqualTo(291) - } - - @Test - fun overviewModalTaskRectLeft() { - assertThat(dp.overviewModalTaskRect.left).isEqualTo(666) - } - - @Test - fun overviewModalTaskRectTop() { - assertThat(dp.overviewModalTaskRect.top).isEqualTo(205) - } - - @Test - fun overviewModalTaskRectRight() { - assertThat(dp.overviewModalTaskRect.right).isEqualTo(2454) - } - - @Test - fun overviewModalTaskRectBottom() { - assertThat(dp.overviewModalTaskRect.bottom).isEqualTo(1030) - } - - @Test - fun getGridTaskRectLeft() { - assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).left).isEqualTo(1741) - } - - @Test - fun getGridTaskRectTop() { - assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).top).isEqualTo(280) - } - - @Test - fun getGridTaskRectRight() { - assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).right).isEqualTo(2372) - } - - @Test - fun getGridTaskRectBottom() { - assertThat(dp.getOverviewGridTaskRect(isRecentsRtl).bottom).isEqualTo(571) - } - - @Test - fun overviewTaskScale() { - assertThat(dp.overviewTaskWorkspaceScale).isEqualTo(0.5597015f) - } - - @Test - fun overviewModalTaskScale() { - assertThat(dp.overviewModalTaskScale).isEqualTo(1.1f) - } } \ No newline at end of file diff --git a/res/values/dimens.xml b/res/values/dimens.xml index caa7da0da3..d095ae3b4a 100644 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -383,9 +383,6 @@ 0dp 0dp 0dp - 0dp - 0.0 - 0.0 72dp 16dp 44dp diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java index d09642a225..adf621653f 100644 --- a/src/com/android/launcher3/DeviceProfile.java +++ b/src/com/android/launcher3/DeviceProfile.java @@ -34,7 +34,6 @@ import android.graphics.Point; import android.graphics.PointF; import android.graphics.Rect; import android.util.DisplayMetrics; -import android.view.Gravity; import android.view.Surface; import com.android.launcher3.CellLayout.ContainerType; @@ -42,7 +41,6 @@ import com.android.launcher3.DevicePaddings.DevicePadding; import com.android.launcher3.icons.DotRenderer; import com.android.launcher3.icons.GraphicsUtils; import com.android.launcher3.icons.IconNormalizer; -import com.android.launcher3.touch.PortraitPagedViewHandler; import com.android.launcher3.uioverrides.ApiWrapper; import com.android.launcher3.util.DisplayController; import com.android.launcher3.util.DisplayController.Info; @@ -204,12 +202,6 @@ public class DeviceProfile { public int overviewPageSpacing; public int overviewRowSpacing; public int overviewGridSideMargin; - public final Rect overviewGridRect = new Rect(); - public final Rect overviewTaskRect = new Rect(); - public final float overviewTaskWorkspaceScale; - public final Point overviewGridTaskDimension = new Point(); - public final Rect overviewModalTaskRect = new Rect(); - public final float overviewModalTaskScale; // Widgets public final PointF appWidgetScale = new PointF(1.0f, 1.0f); @@ -236,9 +228,6 @@ public class DeviceProfile { public DotRenderer mDotRendererWorkSpace; public DotRenderer mDotRendererAllApps; - // Tasks - public final PointF taskDimension = new PointF(); - // Taskbar public boolean isTaskbarPresent; // Whether Taskbar will inset the bottom of apps by taskbarSize. @@ -492,104 +481,6 @@ public class DeviceProfile { mDotRendererWorkSpace = new DotRenderer(iconSizePx, dotPath, DEFAULT_DOT_SIZE); mDotRendererAllApps = iconSizePx == allAppsIconSizePx ? mDotRendererWorkSpace : new DotRenderer(allAppsIconSizePx, dotPath, DEFAULT_DOT_SIZE); - - // Grid and Task size calculations - calculateGridSize(); - getTaskDimension(); - calculateTaskSize(res); - calculateGridTaskSize(); - calculateModalTaskSize(res); - overviewModalTaskScale = - Math.min(overviewModalTaskRect.height() / (float) overviewTaskRect.height(), - overviewModalTaskRect.width() / (float) overviewTaskRect.width()); - overviewTaskWorkspaceScale = (float) overviewTaskRect.height() / getCellLayoutHeight(); - } - - private void calculateGridSize() { - int topMargin = overviewTaskThumbnailTopMarginPx; - int bottomMargin = getOverviewActionsClaimedSpace(); - int sideMargin = overviewGridSideMargin; - - overviewGridRect.set(0, 0, widthPx, heightPx); - overviewGridRect.inset(Math.max(mInsets.left, sideMargin), mInsets.top + topMargin, - Math.max(mInsets.right, sideMargin), Math.max(mInsets.bottom, bottomMargin)); - } - - private void calculateTaskSize(Resources res) { - int overviewMinNextPrevSize = - res.getDimensionPixelSize(R.dimen.overview_minimum_next_prev_size); - float overviewMaxScale = res.getFloat(R.dimen.overview_max_scale); - Rect containerRect = new Rect(); - if (isTablet) { - containerRect.set(overviewGridRect); - } else { - int taskMargin = overviewTaskMarginPx; - containerRect.set(0, 0, widthPx, heightPx); - containerRect.inset(mInsets.left, mInsets.top, mInsets.right, mInsets.bottom); - int minimumHorizontalPadding = overviewMinNextPrevSize + taskMargin; - containerRect.inset(minimumHorizontalPadding, overviewTaskThumbnailTopMarginPx, - minimumHorizontalPadding, getOverviewActionsClaimedSpace()); - } - float scale = Math.min( - containerRect.width() / taskDimension.x, - containerRect.height() / taskDimension.y); - scale = Math.min(scale, overviewMaxScale); - int outWidth = Math.round(scale * taskDimension.x); - int outHeight = Math.round(scale * taskDimension.y); - Gravity.apply(Gravity.CENTER, outWidth, outHeight, containerRect, overviewTaskRect); - } - - private void calculateGridTaskSize() { - float rowHeight = - (overviewTaskRect.height() + overviewTaskThumbnailTopMarginPx - overviewRowSpacing) - / 2f; - - float scale = (rowHeight - overviewTaskThumbnailTopMarginPx) / taskDimension.y; - overviewGridTaskDimension.set( - Math.round(scale * taskDimension.x), Math.round(scale * taskDimension.y)); - } - - /** - * Returns a Rect the size of a grid task with the correct positioning within the screen. - * - * @param isRecentsRtl is true when device is in LTR, false when in RTL, as grid tasks are only - * supported on tablets, which use PortraitPagedViewHandler. - */ - public Rect getOverviewGridTaskRect(boolean isRecentsRtl) { - Rect outRect = new Rect(); - int gravity = Gravity.TOP; - gravity |= isRecentsRtl ? Gravity.RIGHT : Gravity.LEFT; - Gravity.apply(gravity, overviewGridTaskDimension.x, overviewGridTaskDimension.y, - overviewTaskRect, outRect); - return outRect; - } - - private void calculateModalTaskSize(Resources res) { - float overviewModalMaxScale = res.getFloat(R.dimen.overview_modal_max_scale); - Rect potentialTaskRect = new Rect(0, 0, widthPx, heightPx); - potentialTaskRect.inset(mInsets.left, mInsets.top, mInsets.right, mInsets.bottom); - int minimumHorizontalPadding = Math.round( - (availableWidthPx - overviewTaskRect.width() * overviewModalMaxScale) / 2); - potentialTaskRect.inset( - minimumHorizontalPadding, - overviewTaskMarginPx, - minimumHorizontalPadding, - heightPx - overviewTaskRect.bottom - mInsets.bottom); - float scale = Math.min( - potentialTaskRect.width() / taskDimension.x, - potentialTaskRect.height() / taskDimension.y); - int outWidth = Math.round(scale * taskDimension.x); - int outHeight = Math.round(scale * taskDimension.y); - Gravity.apply(Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM, outWidth, outHeight, - potentialTaskRect, overviewModalTaskRect); - } - - private void getTaskDimension() { - float taskHeight = heightPx; - if (isTablet) { - taskHeight -= taskbarSize; - } - taskDimension.set(widthPx, taskHeight); } /** @@ -1354,8 +1245,7 @@ public class DeviceProfile { } // LINT.IfChange - /** Dumps various DeviceProfile variables to the specified writer. */ - public void dump(Context context, String prefix, PrintWriter writer) { + public void dump(String prefix, PrintWriter writer) { writer.println(prefix + "DeviceProfile:"); writer.println(prefix + "\t1 dp = " + mMetrics.density + " px"); @@ -1401,12 +1291,9 @@ public class DeviceProfile { cellLayoutBorderSpacePx.x)); writer.println(prefix + pxToDpStr("cellLayoutBorderSpacePx Vertical", cellLayoutBorderSpacePx.y)); - writer.println( - prefix + pxToDpStr("cellLayoutPaddingPx.left", cellLayoutPaddingPx.left)); - writer.println( - prefix + pxToDpStr("cellLayoutPaddingPx.top", cellLayoutPaddingPx.top)); - writer.println( - prefix + pxToDpStr("cellLayoutPaddingPx.right", cellLayoutPaddingPx.right)); + writer.println(prefix + pxToDpStr("cellLayoutPaddingPx.left", cellLayoutPaddingPx.left)); + writer.println(prefix + pxToDpStr("cellLayoutPaddingPx.top", cellLayoutPaddingPx.top)); + writer.println(prefix + pxToDpStr("cellLayoutPaddingPx.right", cellLayoutPaddingPx.right)); writer.println( prefix + pxToDpStr("cellLayoutPaddingPx.bottom", cellLayoutPaddingPx.bottom)); @@ -1440,15 +1327,13 @@ public class DeviceProfile { writer.println(prefix + pxToDpStr("allAppsBorderSpacePxX", allAppsBorderSpacePx.x)); writer.println(prefix + pxToDpStr("allAppsBorderSpacePxY", allAppsBorderSpacePx.y)); writer.println(prefix + "\tnumShownAllAppsColumns: " + numShownAllAppsColumns); - writer.println( - prefix + pxToDpStr("allAppsLeftRightPadding", allAppsLeftRightPadding)); + writer.println(prefix + pxToDpStr("allAppsLeftRightPadding", allAppsLeftRightPadding)); writer.println(prefix + pxToDpStr("allAppsLeftRightMargin", allAppsLeftRightMargin)); writer.println(prefix + pxToDpStr("hotseatBarSizePx", hotseatBarSizePx)); writer.println(prefix + "\tinv.hotseatColumnSpan: " + inv.hotseatColumnSpan[mTypeIndex]); writer.println(prefix + pxToDpStr("hotseatCellHeightPx", hotseatCellHeightPx)); - writer.println( - prefix + pxToDpStr("hotseatBarBottomSpacePx", hotseatBarBottomSpacePx)); + writer.println(prefix + pxToDpStr("hotseatBarBottomSpacePx", hotseatBarBottomSpacePx)); writer.println(prefix + pxToDpStr("hotseatBarSidePaddingStartPx", hotseatBarSidePaddingStartPx)); writer.println(prefix + pxToDpStr("hotseatBarSidePaddingEndPx", @@ -1459,12 +1344,9 @@ public class DeviceProfile { writer.println(prefix + pxToDpStr("springLoadedHotseatBarTopMarginPx", springLoadedHotseatBarTopMarginPx)); writer.println(prefix + pxToDpStr("mHotseatBarPadding.top", mHotseatBarPadding.top)); - writer.println( - prefix + pxToDpStr("mHotseatBarPadding.bottom", mHotseatBarPadding.bottom)); - writer.println( - prefix + pxToDpStr("mHotseatBarPadding.left", mHotseatBarPadding.left)); - writer.println( - prefix + pxToDpStr("mHotseatBarPadding.right", mHotseatBarPadding.right)); + writer.println(prefix + pxToDpStr("mHotseatBarPadding.bottom", mHotseatBarPadding.bottom)); + writer.println(prefix + pxToDpStr("mHotseatBarPadding.left", mHotseatBarPadding.left)); + writer.println(prefix + pxToDpStr("mHotseatBarPadding.right", mHotseatBarPadding.right)); writer.println(prefix + "\tnumShownHotseatIcons: " + numShownHotseatIcons); writer.println(prefix + pxToDpStr("hotseatBorderSpace", hotseatBorderSpace)); writer.println(prefix + "\tisQsbInline: " + isQsbInline); @@ -1479,14 +1361,12 @@ public class DeviceProfile { writer.println(prefix + pxToDpStr("workspacePadding.left", workspacePadding.left)); writer.println(prefix + pxToDpStr("workspacePadding.top", workspacePadding.top)); writer.println(prefix + pxToDpStr("workspacePadding.right", workspacePadding.right)); - writer.println( - prefix + pxToDpStr("workspacePadding.bottom", workspacePadding.bottom)); + writer.println(prefix + pxToDpStr("workspacePadding.bottom", workspacePadding.bottom)); writer.println(prefix + pxToDpStr("iconScale", iconScale)); writer.println(prefix + pxToDpStr("cellScaleToFit ", cellScaleToFit)); writer.println(prefix + pxToDpStr("extraSpace", extraSpace)); - writer.println( - prefix + pxToDpStr("unscaled extraSpace", extraSpace / iconScale)); + writer.println(prefix + pxToDpStr("unscaled extraSpace", extraSpace / iconScale)); if (inv.devicePaddings != null) { int unscaledExtraSpace = (int) (extraSpace / iconScale); @@ -1497,8 +1377,7 @@ public class DeviceProfile { writer.println(prefix + pxToDpStr("workspaceBottomPadding", workspaceBottomPadding)); writer.println(prefix + pxToDpStr("overviewTaskMarginPx", overviewTaskMarginPx)); - writer.println( - prefix + pxToDpStr("overviewTaskMarginGridPx", overviewTaskMarginGridPx)); + writer.println(prefix + pxToDpStr("overviewTaskMarginGridPx", overviewTaskMarginGridPx)); writer.println(prefix + pxToDpStr("overviewTaskIconSizePx", overviewTaskIconSizePx)); writer.println(prefix + pxToDpStr("overviewTaskIconDrawableSizePx", overviewTaskIconDrawableSizePx)); @@ -1516,64 +1395,21 @@ public class DeviceProfile { writer.println(prefix + pxToDpStr("overviewRowSpacing", overviewRowSpacing)); writer.println(prefix + pxToDpStr("overviewGridSideMargin", overviewGridSideMargin)); - writer.println( - prefix + pxToDpStr("dropTargetBarTopMarginPx", dropTargetBarTopMarginPx)); + writer.println(prefix + pxToDpStr("dropTargetBarTopMarginPx", dropTargetBarTopMarginPx)); writer.println(prefix + pxToDpStr("dropTargetBarSizePx", dropTargetBarSizePx)); - writer.println(prefix - + pxToDpStr("dropTargetBarBottomMarginPx", dropTargetBarBottomMarginPx)); + writer.println( + prefix + pxToDpStr("dropTargetBarBottomMarginPx", dropTargetBarBottomMarginPx)); - writer.println(prefix - + pxToDpStr("workspaceSpringLoadShrunkTop", mWorkspaceSpringLoadShrunkTop)); + writer.println( + prefix + pxToDpStr("workspaceSpringLoadShrunkTop", mWorkspaceSpringLoadShrunkTop)); writer.println(prefix + pxToDpStr("workspaceSpringLoadShrunkBottom", mWorkspaceSpringLoadShrunkBottom)); writer.println(prefix + pxToDpStr("workspaceSpringLoadedMinNextPageVisiblePx", workspaceSpringLoadedMinNextPageVisiblePx)); - writer.println(prefix - + pxToDpStr("getWorkspaceSpringLoadScale()", getWorkspaceSpringLoadScale())); + writer.println( + prefix + pxToDpStr("getWorkspaceSpringLoadScale()", getWorkspaceSpringLoadScale())); writer.println(prefix + pxToDpStr("getCellLayoutHeight()", getCellLayoutHeight())); writer.println(prefix + pxToDpStr("getCellLayoutWidth()", getCellLayoutWidth())); - - writer.println(prefix + pxToDpStr("overviewGridRect.left", overviewGridRect.left)); - writer.println(prefix + pxToDpStr("overviewGridRect.top", overviewGridRect.top)); - writer.println(prefix + pxToDpStr("overviewGridRect.right", overviewGridRect.right)); - writer.println(prefix - + pxToDpStr("overviewGridRect.bottom", overviewGridRect.bottom)); - writer.println(prefix + pxToDpStr("taskDimension.x", taskDimension.x)); - writer.println(prefix + pxToDpStr("taskDimension.y", taskDimension.y)); - writer.println(prefix + pxToDpStr("overviewTaskRect.left", overviewTaskRect.left)); - writer.println(prefix + pxToDpStr("overviewTaskRect.top", overviewTaskRect.top)); - writer.println(prefix + pxToDpStr("overviewTaskRect.right", overviewTaskRect.right)); - writer.println(prefix - + pxToDpStr("overviewTaskRect.bottom", overviewTaskRect.bottom)); - writer.println(prefix - + pxToDpStr("overviewGridTaskDimension.x", overviewGridTaskDimension.x)); - writer.println(prefix - + pxToDpStr("overviewGridTaskDimension.y", overviewGridTaskDimension.y)); - writer.println(prefix - + pxToDpStr("overviewModalTaskRect.left", overviewModalTaskRect.left)); - writer.println(prefix - + pxToDpStr("overviewModalTaskRect.top", overviewModalTaskRect.top)); - writer.println(prefix - + pxToDpStr("overviewModalTaskRect.right", overviewModalTaskRect.right)); - writer.println(prefix - + pxToDpStr("overviewModalTaskRect.bottom", overviewModalTaskRect.bottom)); - boolean isRecentsRtl = - PortraitPagedViewHandler.PORTRAIT.getRecentsRtlSetting(context.getResources()); - writer.println(prefix - + pxToDpStr("getOverviewGridTaskRect(" + isRecentsRtl + ").left", - getOverviewGridTaskRect(isRecentsRtl).left)); - writer.println(prefix - + pxToDpStr("getOverviewGridTaskRect(" + isRecentsRtl + ").top", - getOverviewGridTaskRect(isRecentsRtl).top)); - writer.println(prefix - + pxToDpStr("getOverviewGridTaskRect(" + isRecentsRtl + ").right", - getOverviewGridTaskRect(isRecentsRtl).right)); - writer.println(prefix - + pxToDpStr("getOverviewGridTaskRect(" + isRecentsRtl + ").bottom", - getOverviewGridTaskRect(isRecentsRtl).bottom)); - writer.println( - prefix + pxToDpStr("overviewTaskWorkspaceScale", overviewTaskWorkspaceScale)); - writer.println(prefix + pxToDpStr("overviewModalTaskScale", overviewModalTaskScale)); } // LINT.ThenChange( // packages/apps/Launcher3/quickstep/tests/src/com/android/quickstep/DeviceProfilePhoneTest.kt, diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 528613c032..9c622512a4 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -3024,7 +3024,7 @@ public class Launcher extends StatefulActivity mDragLayer.dump(prefix, writer); mStateManager.dump(prefix, writer); mPopupDataProvider.dump(prefix, writer); - mDeviceProfile.dump(this, prefix, writer); + mDeviceProfile.dump(prefix, writer); try { FileLog.flushAll(writer); diff --git a/tests/src/com/android/launcher3/DeviceProfileBaseTest.kt b/tests/src/com/android/launcher3/DeviceProfileBaseTest.kt index ba813c0d4a..9a76336cd0 100644 --- a/tests/src/com/android/launcher3/DeviceProfileBaseTest.kt +++ b/tests/src/com/android/launcher3/DeviceProfileBaseTest.kt @@ -37,7 +37,6 @@ abstract class DeviceProfileBaseTest { protected var transposeLayoutWithOrientation: Boolean = false protected var useTwoPanels: Boolean = false protected var isGestureMode: Boolean = true - protected var isRecentsRtl: Boolean = true @Before fun setUp() { @@ -164,7 +163,7 @@ abstract class DeviceProfileBaseTest { fun dump(dp: DeviceProfile): StringWriter { val stringWriter = StringWriter() val printWriter = PrintWriter(stringWriter) - dp.dump(context, "", printWriter) + dp.dump("", printWriter) printWriter.flush() return stringWriter }