diff --git a/quickstep/src/com/android/launcher3/statehandlers/BackButtonAlphaHandler.java b/quickstep/src/com/android/launcher3/statehandlers/BackButtonAlphaHandler.java index 8c11081a62..d33859b95b 100644 --- a/quickstep/src/com/android/launcher3/statehandlers/BackButtonAlphaHandler.java +++ b/quickstep/src/com/android/launcher3/statehandlers/BackButtonAlphaHandler.java @@ -17,7 +17,7 @@ package com.android.launcher3.statehandlers; import static com.android.launcher3.anim.Interpolators.LINEAR; -import static com.android.launcher3.util.DisplayController.NavigationMode.TWO_BUTTONS; +import static com.android.launcher3.util.NavigationMode.TWO_BUTTONS; import static com.android.quickstep.AnimatedFloat.VALUE; import com.android.launcher3.LauncherState; diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java index 3b1e6774b4..19d6af57d1 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java @@ -80,7 +80,7 @@ import com.android.launcher3.testing.TestLogging; import com.android.launcher3.testing.shared.TestProtocol; import com.android.launcher3.touch.ItemClickHandler; import com.android.launcher3.util.DisplayController; -import com.android.launcher3.util.DisplayController.NavigationMode; +import com.android.launcher3.util.NavigationMode; import com.android.launcher3.util.PackageManagerHelper; import com.android.launcher3.util.SettingsCache; import com.android.launcher3.util.TraceHelper; diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java index 80b3c1d095..bc69088416 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java @@ -45,6 +45,7 @@ import com.android.launcher3.statemanager.StatefulActivity; import com.android.launcher3.taskbar.unfold.NonDestroyableScopedUnfoldTransitionProgressProvider; import com.android.launcher3.uioverrides.QuickstepLauncher; import com.android.launcher3.util.DisplayController; +import com.android.launcher3.util.NavigationMode; import com.android.launcher3.util.SettingsCache; import com.android.launcher3.util.SimpleBroadcastReceiver; import com.android.quickstep.RecentsActivity; @@ -83,7 +84,7 @@ public class TaskbarManager { // It's destruction/creation will be managed by the activity. private final ScopedUnfoldTransitionProgressProvider mUnfoldProgressProvider = new NonDestroyableScopedUnfoldTransitionProgressProvider(); - private DisplayController.NavigationMode mNavMode; + private NavigationMode mNavMode; private TaskbarActivityContext mTaskbarActivityContext; private StatefulActivity mActivity; diff --git a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java index c9bc260a21..aafaf6fb4f 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java +++ b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java @@ -45,9 +45,9 @@ import static com.android.launcher3.testing.shared.TestProtocol.OVERVIEW_STATE_O import static com.android.launcher3.testing.shared.TestProtocol.QUICK_SWITCH_STATE_ORDINAL; import static com.android.launcher3.util.DisplayController.CHANGE_ACTIVE_SCREEN; import static com.android.launcher3.util.DisplayController.CHANGE_NAVIGATION_MODE; -import static com.android.launcher3.util.DisplayController.NavigationMode.TWO_BUTTONS; import static com.android.launcher3.util.Executors.THREAD_POOL_EXECUTOR; import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR; +import static com.android.launcher3.util.NavigationMode.TWO_BUTTONS; import static com.android.systemui.shared.system.ActivityManagerWrapper.CLOSE_SYSTEM_WINDOWS_REASON_HOME_KEY; import android.animation.AnimatorSet; @@ -114,8 +114,8 @@ import com.android.launcher3.uioverrides.touchcontrollers.TransposedQuickSwitchT import com.android.launcher3.uioverrides.touchcontrollers.TwoButtonNavbarTouchController; import com.android.launcher3.util.ActivityOptionsWrapper; import com.android.launcher3.util.DisplayController; -import com.android.launcher3.util.DisplayController.NavigationMode; import com.android.launcher3.util.IntSet; +import com.android.launcher3.util.NavigationMode; import com.android.launcher3.util.ObjectWrapper; import com.android.launcher3.util.PendingRequestArgs; import com.android.launcher3.util.PendingSplitSelectInfo; diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/QuickSwitchTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/QuickSwitchTouchController.java index e5cd53abf5..56ac4c5b3a 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/QuickSwitchTouchController.java +++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/QuickSwitchTouchController.java @@ -45,7 +45,7 @@ import com.android.launcher3.states.StateAnimationConfig; import com.android.launcher3.touch.AbstractStateChangeTouchController; import com.android.launcher3.touch.SingleAxisSwipeDetector; import com.android.launcher3.util.DisplayController; -import com.android.launcher3.util.DisplayController.NavigationMode; +import com.android.launcher3.util.NavigationMode; import com.android.quickstep.SystemUiProxy; import com.android.quickstep.TaskUtils; import com.android.quickstep.views.RecentsView; diff --git a/quickstep/src/com/android/quickstep/BaseActivityInterface.java b/quickstep/src/com/android/quickstep/BaseActivityInterface.java index 6354282d47..315a91e0a1 100644 --- a/quickstep/src/com/android/quickstep/BaseActivityInterface.java +++ b/quickstep/src/com/android/quickstep/BaseActivityInterface.java @@ -55,7 +55,7 @@ import com.android.launcher3.statemanager.StatefulActivity; import com.android.launcher3.taskbar.TaskbarUIController; import com.android.launcher3.touch.PagedOrientationHandler; import com.android.launcher3.util.DisplayController; -import com.android.launcher3.util.DisplayController.NavigationMode; +import com.android.launcher3.util.NavigationMode; import com.android.launcher3.views.ScrimView; import com.android.quickstep.util.ActivityInitListener; import com.android.quickstep.util.AnimatorControllerWithResistance; diff --git a/quickstep/src/com/android/quickstep/FallbackActivityInterface.java b/quickstep/src/com/android/quickstep/FallbackActivityInterface.java index ba61574f03..466abbe62f 100644 --- a/quickstep/src/com/android/quickstep/FallbackActivityInterface.java +++ b/quickstep/src/com/android/quickstep/FallbackActivityInterface.java @@ -16,7 +16,7 @@ package com.android.quickstep; import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE; -import static com.android.launcher3.util.DisplayController.NavigationMode.NO_BUTTON; +import static com.android.launcher3.util.NavigationMode.NO_BUTTON; import static com.android.quickstep.fallback.RecentsState.BACKGROUND_APP; import static com.android.quickstep.fallback.RecentsState.DEFAULT; import static com.android.quickstep.fallback.RecentsState.HOME; diff --git a/quickstep/src/com/android/quickstep/LauncherActivityInterface.java b/quickstep/src/com/android/quickstep/LauncherActivityInterface.java index 4ceafeb79a..1127e2c8e7 100644 --- a/quickstep/src/com/android/quickstep/LauncherActivityInterface.java +++ b/quickstep/src/com/android/quickstep/LauncherActivityInterface.java @@ -45,7 +45,7 @@ import com.android.launcher3.taskbar.LauncherTaskbarUIController; import com.android.launcher3.touch.PagedOrientationHandler; import com.android.launcher3.uioverrides.QuickstepLauncher; import com.android.launcher3.util.DisplayController; -import com.android.launcher3.util.DisplayController.NavigationMode; +import com.android.launcher3.util.NavigationMode; import com.android.quickstep.GestureState.GestureEndTarget; import com.android.quickstep.util.ActivityInitListener; import com.android.quickstep.util.AnimatorControllerWithResistance; diff --git a/quickstep/src/com/android/quickstep/OrientationTouchTransformer.java b/quickstep/src/com/android/quickstep/OrientationTouchTransformer.java index 47c5dd0a63..1b05fd272d 100644 --- a/quickstep/src/com/android/quickstep/OrientationTouchTransformer.java +++ b/quickstep/src/com/android/quickstep/OrientationTouchTransformer.java @@ -34,7 +34,7 @@ import android.view.Surface; import com.android.launcher3.R; import com.android.launcher3.testing.shared.ResourceUtils; import com.android.launcher3.util.DisplayController.Info; -import com.android.launcher3.util.DisplayController.NavigationMode; +import com.android.launcher3.util.NavigationMode; import com.android.launcher3.util.window.CachedDisplayInfo; import java.io.PrintWriter; diff --git a/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java b/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java index b6cfbb0bc8..e87fdad933 100644 --- a/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java +++ b/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java @@ -23,9 +23,9 @@ import static android.view.Display.DEFAULT_DISPLAY; import static com.android.launcher3.util.DisplayController.CHANGE_ALL; import static com.android.launcher3.util.DisplayController.CHANGE_NAVIGATION_MODE; import static com.android.launcher3.util.DisplayController.CHANGE_ROTATION; -import static com.android.launcher3.util.DisplayController.NavigationMode.NO_BUTTON; -import static com.android.launcher3.util.DisplayController.NavigationMode.THREE_BUTTONS; -import static com.android.launcher3.util.DisplayController.NavigationMode.TWO_BUTTONS; +import static com.android.launcher3.util.NavigationMode.NO_BUTTON; +import static com.android.launcher3.util.NavigationMode.THREE_BUTTONS; +import static com.android.launcher3.util.NavigationMode.TWO_BUTTONS; import static com.android.launcher3.util.SettingsCache.ONE_HANDED_ENABLED; import static com.android.launcher3.util.SettingsCache.ONE_HANDED_SWIPE_BOTTOM_TO_NOTIFICATION_ENABLED; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_A11Y_BUTTON_CLICKABLE; @@ -67,7 +67,7 @@ import com.android.launcher3.Utilities; import com.android.launcher3.util.DisplayController; import com.android.launcher3.util.DisplayController.DisplayInfoChangeListener; import com.android.launcher3.util.DisplayController.Info; -import com.android.launcher3.util.DisplayController.NavigationMode; +import com.android.launcher3.util.NavigationMode; import com.android.launcher3.util.SettingsCache; import com.android.quickstep.TopTaskTracker.CachedTaskInfo; import com.android.quickstep.util.NavBarPosition; diff --git a/quickstep/src/com/android/quickstep/RotationTouchHelper.java b/quickstep/src/com/android/quickstep/RotationTouchHelper.java index 2186a3bde9..f8b69666fe 100644 --- a/quickstep/src/com/android/quickstep/RotationTouchHelper.java +++ b/quickstep/src/com/android/quickstep/RotationTouchHelper.java @@ -23,8 +23,8 @@ import static com.android.launcher3.util.DisplayController.CHANGE_ALL; import static com.android.launcher3.util.DisplayController.CHANGE_NAVIGATION_MODE; import static com.android.launcher3.util.DisplayController.CHANGE_ROTATION; import static com.android.launcher3.util.DisplayController.CHANGE_SUPPORTED_BOUNDS; -import static com.android.launcher3.util.DisplayController.NavigationMode.THREE_BUTTONS; import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR; +import static com.android.launcher3.util.NavigationMode.THREE_BUTTONS; import android.content.Context; import android.content.res.Resources; @@ -35,8 +35,8 @@ import com.android.launcher3.testing.shared.TestProtocol; import com.android.launcher3.util.DisplayController; import com.android.launcher3.util.DisplayController.DisplayInfoChangeListener; import com.android.launcher3.util.DisplayController.Info; -import com.android.launcher3.util.DisplayController.NavigationMode; import com.android.launcher3.util.MainThreadInitializedObject; +import com.android.launcher3.util.NavigationMode; import com.android.quickstep.util.RecentsOrientedState; import com.android.systemui.shared.system.QuickStepContract; import com.android.systemui.shared.system.TaskStackChangeListener; diff --git a/quickstep/src/com/android/quickstep/fallback/FallbackNavBarTouchController.java b/quickstep/src/com/android/quickstep/fallback/FallbackNavBarTouchController.java index 3e01ed0b77..8a87f63aaf 100644 --- a/quickstep/src/com/android/quickstep/fallback/FallbackNavBarTouchController.java +++ b/quickstep/src/com/android/quickstep/fallback/FallbackNavBarTouchController.java @@ -22,7 +22,7 @@ import androidx.annotation.Nullable; import com.android.launcher3.Utilities; import com.android.launcher3.util.DisplayController; -import com.android.launcher3.util.DisplayController.NavigationMode; +import com.android.launcher3.util.NavigationMode; import com.android.launcher3.util.TouchController; import com.android.quickstep.RecentsActivity; import com.android.quickstep.util.NavBarPosition; diff --git a/quickstep/src/com/android/quickstep/interaction/NavBarGestureHandler.java b/quickstep/src/com/android/quickstep/interaction/NavBarGestureHandler.java index 4badf304a8..e7bf7e2d08 100644 --- a/quickstep/src/com/android/quickstep/interaction/NavBarGestureHandler.java +++ b/quickstep/src/com/android/quickstep/interaction/NavBarGestureHandler.java @@ -44,10 +44,10 @@ import android.view.ViewConfiguration; import androidx.annotation.Nullable; import com.android.launcher3.R; -import com.android.launcher3.testing.shared.ResourceUtils; import com.android.launcher3.anim.Interpolators; +import com.android.launcher3.testing.shared.ResourceUtils; import com.android.launcher3.util.DisplayController; -import com.android.launcher3.util.DisplayController.NavigationMode; +import com.android.launcher3.util.NavigationMode; import com.android.quickstep.util.MotionPauseDetector; import com.android.quickstep.util.NavBarPosition; import com.android.quickstep.util.TriggerSwipeUpTouchTracker; diff --git a/quickstep/src/com/android/quickstep/logging/SettingsChangeLogger.java b/quickstep/src/com/android/quickstep/logging/SettingsChangeLogger.java index 99553e819e..2ccdfa3b36 100644 --- a/quickstep/src/com/android/quickstep/logging/SettingsChangeLogger.java +++ b/quickstep/src/com/android/quickstep/logging/SettingsChangeLogger.java @@ -46,8 +46,8 @@ import com.android.launcher3.logging.StatsLogManager.StatsLogger; import com.android.launcher3.model.DeviceGridState; import com.android.launcher3.util.DisplayController; import com.android.launcher3.util.DisplayController.Info; -import com.android.launcher3.util.DisplayController.NavigationMode; import com.android.launcher3.util.MainThreadInitializedObject; +import com.android.launcher3.util.NavigationMode; import com.android.launcher3.util.SettingsCache; import org.xmlpull.v1.XmlPullParser; diff --git a/quickstep/src/com/android/quickstep/util/LayoutUtils.java b/quickstep/src/com/android/quickstep/util/LayoutUtils.java index d0856bed20..f7136a5b68 100644 --- a/quickstep/src/com/android/quickstep/util/LayoutUtils.java +++ b/quickstep/src/com/android/quickstep/util/LayoutUtils.java @@ -23,7 +23,7 @@ import android.view.ViewGroup; 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.launcher3.util.NavigationMode; import com.android.quickstep.LauncherActivityInterface; public class LayoutUtils { diff --git a/quickstep/src/com/android/quickstep/util/NavBarPosition.java b/quickstep/src/com/android/quickstep/util/NavBarPosition.java index 527a6d2d9a..59c82633d2 100644 --- a/quickstep/src/com/android/quickstep/util/NavBarPosition.java +++ b/quickstep/src/com/android/quickstep/util/NavBarPosition.java @@ -15,12 +15,12 @@ */ package com.android.quickstep.util; -import static com.android.launcher3.util.DisplayController.NavigationMode.NO_BUTTON; +import static com.android.launcher3.util.NavigationMode.NO_BUTTON; import android.view.Surface; import com.android.launcher3.util.DisplayController.Info; -import com.android.launcher3.util.DisplayController.NavigationMode; +import com.android.launcher3.util.NavigationMode; /** * Utility class to check nav bar position. diff --git a/quickstep/src/com/android/quickstep/util/QuickstepOnboardingPrefs.java b/quickstep/src/com/android/quickstep/util/QuickstepOnboardingPrefs.java index fc44b99a4d..e928b27751 100644 --- a/quickstep/src/com/android/quickstep/util/QuickstepOnboardingPrefs.java +++ b/quickstep/src/com/android/quickstep/util/QuickstepOnboardingPrefs.java @@ -21,7 +21,7 @@ import static com.android.launcher3.LauncherState.ALL_APPS; import static com.android.launcher3.LauncherState.HINT_STATE; import static com.android.launcher3.LauncherState.NORMAL; import static com.android.launcher3.LauncherState.OVERVIEW; -import static com.android.launcher3.util.DisplayController.NavigationMode.NO_BUTTON; +import static com.android.launcher3.util.NavigationMode.NO_BUTTON; import android.content.SharedPreferences; diff --git a/quickstep/src/com/android/quickstep/views/OverviewActionsView.java b/quickstep/src/com/android/quickstep/views/OverviewActionsView.java index 62ec0ef1df..083756ad85 100644 --- a/quickstep/src/com/android/quickstep/views/OverviewActionsView.java +++ b/quickstep/src/com/android/quickstep/views/OverviewActionsView.java @@ -32,9 +32,9 @@ import com.android.launcher3.DeviceProfile; import com.android.launcher3.Insettable; import com.android.launcher3.R; import com.android.launcher3.util.DisplayController; -import com.android.launcher3.util.DisplayController.NavigationMode; import com.android.launcher3.util.MultiValueAlpha; import com.android.launcher3.util.MultiValueAlpha.AlphaProperty; +import com.android.launcher3.util.NavigationMode; import com.android.quickstep.TaskOverlayFactory.OverlayUICallbacks; import com.android.quickstep.util.LayoutUtils; diff --git a/quickstep/src/com/android/quickstep/views/SplitInstructionsView.java b/quickstep/src/com/android/quickstep/views/SplitInstructionsView.java index 7d94505bbb..bcaa462f3e 100644 --- a/quickstep/src/com/android/quickstep/views/SplitInstructionsView.java +++ b/quickstep/src/com/android/quickstep/views/SplitInstructionsView.java @@ -16,7 +16,7 @@ package com.android.quickstep.views; -import static com.android.launcher3.util.DisplayController.NavigationMode.THREE_BUTTONS; +import static com.android.launcher3.util.NavigationMode.THREE_BUTTONS; import android.content.Context; import android.util.AttributeSet; diff --git a/quickstep/tests/src/com/android/quickstep/DeviceProfileTest.kt b/quickstep/tests/src/com/android/quickstep/DeviceProfileTest.kt deleted file mode 100644 index 9977207e86..0000000000 --- a/quickstep/tests/src/com/android/quickstep/DeviceProfileTest.kt +++ /dev/null @@ -1,1479 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.android.quickstep - -import androidx.test.ext.junit.runners.AndroidJUnit4 -import androidx.test.filters.SmallTest -import com.android.launcher3.DeviceProfileBaseTest -import com.google.common.truth.Truth.assertThat -import org.junit.Test -import org.junit.runner.RunWith - -/** - * Tests for DeviceProfile. - */ -@SmallTest -@RunWith(AndroidJUnit4::class) -class DeviceProfileTest : DeviceProfileBaseTest() { - - @Test - fun phonePortrait3Button() { - initializeVarsForPhone(isGestureMode = false) - val dp = newDP() - - assertThat(dump(dp)).isEqualTo("DeviceProfile:\n" + - "\t1 dp = 2.625 px\n" + - "\tisTablet:false\n" + - "\tisPhone:true\n" + - "\ttransposeLayoutWithOrientation:true\n" + - "\tisGestureMode:false\n" + - "\tisLandscape:false\n" + - "\tisMultiWindowMode:false\n" + - "\tisTwoPanels:false\n" + - "\twindowX: 0.0px (0.0dp)\n" + - "\twindowY: 0.0px (0.0dp)\n" + - "\twidthPx: 1080.0px (411.42856dp)\n" + - "\theightPx: 2400.0px (914.2857dp)\n" + - "\tavailableWidthPx: 1080.0px (411.42856dp)\n" + - "\tavailableHeightPx: 2156.0px (821.3333dp)\n" + - "\tmInsets.left: 0.0px (0.0dp)\n" + - "\tmInsets.top: 118.0px (44.95238dp)\n" + - "\tmInsets.right: 0.0px (0.0dp)\n" + - "\tmInsets.bottom: 126.0px (48.0dp)\n" + - "\taspectRatio:2.2222223\n" + - "\tisScalableGrid:true\n" + - "\tinv.numRows: 5\n" + - "\tinv.numColumns: 4\n" + - "\tinv.numSearchContainerColumns: 4\n" + - "\tminCellSize: PointF(80.0, 104.0)dp\n" + - "\tcellWidthPx: 210.0px (80.0dp)\n" + - "\tcellHeightPx: 272.0px (103.61905dp)\n" + - "\tgetCellSize().x: 210.0px (80.0dp)\n" + - "\tgetCellSize().y: 272.0px (103.61905dp)\n" + - "\tcellLayoutBorderSpacePx Horizontal: 42.0px (16.0dp)\n" + - "\tcellLayoutBorderSpacePx Vertical: 42.0px (16.0dp)\n" + - "\tcellLayoutPaddingPx.left: 28.0px (10.666667dp)\n" + - "\tcellLayoutPaddingPx.top: 28.0px (10.666667dp)\n" + - "\tcellLayoutPaddingPx.right: 28.0px (10.666667dp)\n" + - "\tcellLayoutPaddingPx.bottom: 28.0px (10.666667dp)\n" + - "\ticonSizePx: 157.0px (59.809525dp)\n" + - "\ticonTextSizePx: 36.0px (13.714286dp)\n" + - "\ticonDrawablePaddingPx: 17.0px (6.4761906dp)\n" + - "\tfolderCellWidthPx: 210.0px (80.0dp)\n" + - "\tfolderCellHeightPx: 247.0px (94.09524dp)\n" + - "\tfolderChildIconSizePx: 158.0px (60.190475dp)\n" + - "\tfolderChildTextSizePx: 37.0px (14.095238dp)\n" + - "\tfolderChildDrawablePaddingPx: 13.0px (4.952381dp)\n" + - "\tfolderCellLayoutBorderSpacePx Horizontal: 42.0px (16.0dp)\n" + - "\tfolderCellLayoutBorderSpacePx Vertical: 42.0px (16.0dp)\n" + - "\tfolderContentPaddingLeftRight: 42.0px (16.0dp)\n" + - "\tfolderTopPadding: 63.0px (24.0dp)\n" + - "\tbottomSheetTopPadding: 146.0px (55.61905dp)\n" + - "\tallAppsShiftRange: 788.0px (300.1905dp)\n" + - "\tallAppsTopPadding: 0.0px (0.0dp)\n" + - "\tallAppsIconSizePx: 157.0px (59.809525dp)\n" + - "\tallAppsIconTextSizePx: 37.0px (14.095238dp)\n" + - "\tallAppsIconDrawablePaddingPx: 18.0px (6.857143dp)\n" + - "\tallAppsCellHeightPx: 314.0px (119.61905dp)\n" + - "\tallAppsCellWidthPx: 210.0px (80.0dp)\n" + - "\tallAppsBorderSpacePxX: 42.0px (16.0dp)\n" + - "\tallAppsBorderSpacePxY: 42.0px (16.0dp)\n" + - "\tnumShownAllAppsColumns: 4\n" + - "\tallAppsLeftRightPadding: 57.0px (21.714285dp)\n" + - "\tallAppsLeftRightMargin: 0.0px (0.0dp)\n" + - "\thotseatBarSizePx: 511.0px (194.66667dp)\n" + - "\tinv.hotseatColumnSpan: 4\n" + - "\thotseatCellHeightPx: 177.0px (67.42857dp)\n" + - "\thotseatBarBottomSpacePx: 147.0px (56.0dp)\n" + - "\thotseatBarSidePaddingStartPx: 0.0px (0.0dp)\n" + - "\thotseatBarSidePaddingEndPx: 0.0px (0.0dp)\n" + - "\thotseatBarEndOffset: 0.0px (0.0dp)\n" + - "\thotseatQsbSpace: 74.0px (28.190475dp)\n" + - "\thotseatQsbHeight: 165.0px (62.857143dp)\n" + - "\tspringLoadedHotseatBarTopMarginPx: 200.0px (76.190475dp)\n" + - "\tgetHotseatLayoutPadding(context).top: 0.0px (0.0dp)\n" + - "\tgetHotseatLayoutPadding(context).bottom: 334.0px (127.2381dp)\n" + - "\tgetHotseatLayoutPadding(context).left: 83.0px (31.619047dp)\n" + - "\tgetHotseatLayoutPadding(context).right: 83.0px (31.619047dp)\n" + - "\tnumShownHotseatIcons: 4\n" + - "\thotseatBorderSpace: 95.0px (36.190475dp)\n" + - "\tisQsbInline: false\n" + - "\thotseatQsbWidth: 913.0px (347.8095dp)\n" + - "\tisTaskbarPresent:false\n" + - "\tisTaskbarPresentInApps:false\n" + - "\ttaskbarSize: 0.0px (0.0dp)\n" + - "\tdesiredWorkspaceHorizontalMarginPx: 57.0px (21.714285dp)\n" + - "\tworkspacePadding.left: 29.0px (11.047619dp)\n" + - "\tworkspacePadding.top: 67.0px (25.52381dp)\n" + - "\tworkspacePadding.right: 29.0px (11.047619dp)\n" + - "\tworkspacePadding.bottom: 504.0px (192.0dp)\n" + - "\ticonScale: 0.9981516px (0.38024822dp)\n" + - "\tcellScaleToFit : 0.9981516px (0.38024822dp)\n" + - "\textraSpace: 211.0px (80.38095dp)\n" + - "\tunscaled extraSpace: 211.39073px (80.5298dp)\n" + - "\tmaxEmptySpace: 315.0px (120.0dp)\n" + - "\tworkspaceTopPadding: 95.0px (36.190475dp)\n" + - "\tworkspaceBottomPadding: 116.0px (44.190475dp)\n" + - "\toverviewTaskMarginPx: 42.0px (16.0dp)\n" + - "\toverviewTaskIconSizePx: 126.0px (48.0dp)\n" + - "\toverviewTaskIconDrawableSizePx: 116.0px (44.190475dp)\n" + - "\toverviewTaskIconDrawableSizeGridPx: 0.0px (0.0dp)\n" + - "\toverviewTaskThumbnailTopMarginPx: 168.0px (64.0dp)\n" + - "\toverviewActionsTopMarginPx: 63.0px (24.0dp)\n" + - "\toverviewActionsHeight: 126.0px (48.0dp)\n" + - "\toverviewActionsButtonSpacing: 95.0px (36.190475dp)\n" + - "\toverviewPageSpacing: 42.0px (16.0dp)\n" + - "\toverviewRowSpacing: 0.0px (0.0dp)\n" + - "\toverviewGridSideMargin: 0.0px (0.0dp)\n" + - "\tdropTargetBarTopMarginPx: 84.0px (32.0dp)\n" + - "\tdropTargetBarSizePx: 147.0px (56.0dp)\n" + - "\tdropTargetBarBottomMarginPx: 42.0px (16.0dp)\n" + - "\tgetCellLayoutSpringLoadShrunkTop(): 391.0px (148.95238dp)\n" + - "\tgetCellLayoutSpringLoadShrunkBottom(): 1689.0px (643.4286dp)\n" + - "\tworkspaceSpringLoadedMinNextPageVisiblePx: 63.0px (24.0dp)\n" + - "\tgetWorkspaceSpringLoadScale(): 0.81892747px (0.31197238dp)\n" + - "\tgetCellLayoutHeight(): 1585.0px (603.8095dp)\n" + - "\tgetCellLayoutWidth(): 1022.0px (389.33334dp)\n") - } - - @Test - fun phonePortrait() { - initializeVarsForPhone() - val dp = newDP() - - assertThat(dump(dp)).isEqualTo("DeviceProfile:\n" + - "\t1 dp = 2.625 px\n" + - "\tisTablet:false\n" + - "\tisPhone:true\n" + - "\ttransposeLayoutWithOrientation:true\n" + - "\tisGestureMode:true\n" + - "\tisLandscape:false\n" + - "\tisMultiWindowMode:false\n" + - "\tisTwoPanels:false\n" + - "\twindowX: 0.0px (0.0dp)\n" + - "\twindowY: 0.0px (0.0dp)\n" + - "\twidthPx: 1080.0px (411.42856dp)\n" + - "\theightPx: 2400.0px (914.2857dp)\n" + - "\tavailableWidthPx: 1080.0px (411.42856dp)\n" + - "\tavailableHeightPx: 2219.0px (845.3333dp)\n" + - "\tmInsets.left: 0.0px (0.0dp)\n" + - "\tmInsets.top: 118.0px (44.95238dp)\n" + - "\tmInsets.right: 0.0px (0.0dp)\n" + - "\tmInsets.bottom: 63.0px (24.0dp)\n" + - "\taspectRatio:2.2222223\n" + - "\tisScalableGrid:true\n" + - "\tinv.numRows: 5\n" + - "\tinv.numColumns: 4\n" + - "\tinv.numSearchContainerColumns: 4\n" + - "\tminCellSize: PointF(80.0, 104.0)dp\n" + - "\tcellWidthPx: 210.0px (80.0dp)\n" + - "\tcellHeightPx: 272.0px (103.61905dp)\n" + - "\tgetCellSize().x: 210.0px (80.0dp)\n" + - "\tgetCellSize().y: 272.0px (103.61905dp)\n" + - "\tcellLayoutBorderSpacePx Horizontal: 42.0px (16.0dp)\n" + - "\tcellLayoutBorderSpacePx Vertical: 42.0px (16.0dp)\n" + - "\tcellLayoutPaddingPx.left: 28.0px (10.666667dp)\n" + - "\tcellLayoutPaddingPx.top: 28.0px (10.666667dp)\n" + - "\tcellLayoutPaddingPx.right: 28.0px (10.666667dp)\n" + - "\tcellLayoutPaddingPx.bottom: 28.0px (10.666667dp)\n" + - "\ticonSizePx: 157.0px (59.809525dp)\n" + - "\ticonTextSizePx: 36.0px (13.714286dp)\n" + - "\ticonDrawablePaddingPx: 17.0px (6.4761906dp)\n" + - "\tfolderCellWidthPx: 210.0px (80.0dp)\n" + - "\tfolderCellHeightPx: 247.0px (94.09524dp)\n" + - "\tfolderChildIconSizePx: 158.0px (60.190475dp)\n" + - "\tfolderChildTextSizePx: 37.0px (14.095238dp)\n" + - "\tfolderChildDrawablePaddingPx: 13.0px (4.952381dp)\n" + - "\tfolderCellLayoutBorderSpacePx Horizontal: 42.0px (16.0dp)\n" + - "\tfolderCellLayoutBorderSpacePx Vertical: 42.0px (16.0dp)\n" + - "\tfolderContentPaddingLeftRight: 42.0px (16.0dp)\n" + - "\tfolderTopPadding: 63.0px (24.0dp)\n" + - "\tbottomSheetTopPadding: 146.0px (55.61905dp)\n" + - "\tallAppsShiftRange: 788.0px (300.1905dp)\n" + - "\tallAppsTopPadding: 0.0px (0.0dp)\n" + - "\tallAppsIconSizePx: 157.0px (59.809525dp)\n" + - "\tallAppsIconTextSizePx: 37.0px (14.095238dp)\n" + - "\tallAppsIconDrawablePaddingPx: 18.0px (6.857143dp)\n" + - "\tallAppsCellHeightPx: 314.0px (119.61905dp)\n" + - "\tallAppsCellWidthPx: 210.0px (80.0dp)\n" + - "\tallAppsBorderSpacePxX: 42.0px (16.0dp)\n" + - "\tallAppsBorderSpacePxY: 42.0px (16.0dp)\n" + - "\tnumShownAllAppsColumns: 4\n" + - "\tallAppsLeftRightPadding: 57.0px (21.714285dp)\n" + - "\tallAppsLeftRightMargin: 0.0px (0.0dp)\n" + - "\thotseatBarSizePx: 511.0px (194.66667dp)\n" + - "\tinv.hotseatColumnSpan: 4\n" + - "\thotseatCellHeightPx: 177.0px (67.42857dp)\n" + - "\thotseatBarBottomSpacePx: 126.0px (48.0dp)\n" + - "\thotseatBarSidePaddingStartPx: 0.0px (0.0dp)\n" + - "\thotseatBarSidePaddingEndPx: 0.0px (0.0dp)\n" + - "\thotseatBarEndOffset: 0.0px (0.0dp)\n" + - "\thotseatQsbSpace: 95.0px (36.190475dp)\n" + - "\thotseatQsbHeight: 165.0px (62.857143dp)\n" + - "\tspringLoadedHotseatBarTopMarginPx: 200.0px (76.190475dp)\n" + - "\tgetHotseatLayoutPadding(context).top: 0.0px (0.0dp)\n" + - "\tgetHotseatLayoutPadding(context).bottom: 334.0px (127.2381dp)\n" + - "\tgetHotseatLayoutPadding(context).left: 83.0px (31.619047dp)\n" + - "\tgetHotseatLayoutPadding(context).right: 83.0px (31.619047dp)\n" + - "\tnumShownHotseatIcons: 4\n" + - "\thotseatBorderSpace: 95.0px (36.190475dp)\n" + - "\tisQsbInline: false\n" + - "\thotseatQsbWidth: 913.0px (347.8095dp)\n" + - "\tisTaskbarPresent:false\n" + - "\tisTaskbarPresentInApps:false\n" + - "\ttaskbarSize: 0.0px (0.0dp)\n" + - "\tdesiredWorkspaceHorizontalMarginPx: 57.0px (21.714285dp)\n" + - "\tworkspacePadding.left: 29.0px (11.047619dp)\n" + - "\tworkspacePadding.top: 67.0px (25.52381dp)\n" + - "\tworkspacePadding.right: 29.0px (11.047619dp)\n" + - "\tworkspacePadding.bottom: 567.0px (216.0dp)\n" + - "\ticonScale: 0.9981516px (0.38024822dp)\n" + - "\tcellScaleToFit : 0.9981516px (0.38024822dp)\n" + - "\textraSpace: 211.0px (80.38095dp)\n" + - "\tunscaled extraSpace: 211.39073px (80.5298dp)\n" + - "\tmaxEmptySpace: 315.0px (120.0dp)\n" + - "\tworkspaceTopPadding: 95.0px (36.190475dp)\n" + - "\tworkspaceBottomPadding: 116.0px (44.190475dp)\n" + - "\toverviewTaskMarginPx: 42.0px (16.0dp)\n" + - "\toverviewTaskIconSizePx: 126.0px (48.0dp)\n" + - "\toverviewTaskIconDrawableSizePx: 116.0px (44.190475dp)\n" + - "\toverviewTaskIconDrawableSizeGridPx: 0.0px (0.0dp)\n" + - "\toverviewTaskThumbnailTopMarginPx: 168.0px (64.0dp)\n" + - "\toverviewActionsTopMarginPx: 63.0px (24.0dp)\n" + - "\toverviewActionsHeight: 126.0px (48.0dp)\n" + - "\toverviewActionsButtonSpacing: 95.0px (36.190475dp)\n" + - "\toverviewPageSpacing: 42.0px (16.0dp)\n" + - "\toverviewRowSpacing: 0.0px (0.0dp)\n" + - "\toverviewGridSideMargin: 0.0px (0.0dp)\n" + - "\tdropTargetBarTopMarginPx: 84.0px (32.0dp)\n" + - "\tdropTargetBarSizePx: 147.0px (56.0dp)\n" + - "\tdropTargetBarBottomMarginPx: 42.0px (16.0dp)\n" + - "\tgetCellLayoutSpringLoadShrunkTop(): 391.0px (148.95238dp)\n" + - "\tgetCellLayoutSpringLoadShrunkBottom(): 1689.0px (643.4286dp)\n" + - "\tworkspaceSpringLoadedMinNextPageVisiblePx: 63.0px (24.0dp)\n" + - "\tgetWorkspaceSpringLoadScale(): 0.81892747px (0.31197238dp)\n" + - "\tgetCellLayoutHeight(): 1585.0px (603.8095dp)\n" + - "\tgetCellLayoutWidth(): 1022.0px (389.33334dp)\n") - } - - @Test - fun tabletLandscape3Button() { - initializeVarsForTablet(isLandscape = true, isGestureMode = false) - val dp = newDP() - dp.isTaskbarPresentInApps = true - - assertThat(dump(dp)).isEqualTo("DeviceProfile:\n" + - "\t1 dp = 2.0 px\n" + - "\tisTablet:true\n" + - "\tisPhone:false\n" + - "\ttransposeLayoutWithOrientation:false\n" + - "\tisGestureMode:false\n" + - "\tisLandscape:true\n" + - "\tisMultiWindowMode:false\n" + - "\tisTwoPanels:false\n" + - "\twindowX: 0.0px (0.0dp)\n" + - "\twindowY: 0.0px (0.0dp)\n" + - "\twidthPx: 2560.0px (1280.0dp)\n" + - "\theightPx: 1600.0px (800.0dp)\n" + - "\tavailableWidthPx: 2560.0px (1280.0dp)\n" + - "\tavailableHeightPx: 1496.0px (748.0dp)\n" + - "\tmInsets.left: 0.0px (0.0dp)\n" + - "\tmInsets.top: 104.0px (52.0dp)\n" + - "\tmInsets.right: 0.0px (0.0dp)\n" + - "\tmInsets.bottom: 0.0px (0.0dp)\n" + - "\taspectRatio:1.6\n" + - "\tisScalableGrid:true\n" + - "\tinv.numRows: 5\n" + - "\tinv.numColumns: 6\n" + - "\tinv.numSearchContainerColumns: 3\n" + - "\tminCellSize: PointF(120.0, 104.0)dp\n" + - "\tcellWidthPx: 240.0px (120.0dp)\n" + - "\tcellHeightPx: 208.0px (104.0dp)\n" + - "\tgetCellSize().x: 240.0px (120.0dp)\n" + - "\tgetCellSize().y: 208.0px (104.0dp)\n" + - "\tcellLayoutBorderSpacePx Horizontal: 128.0px (64.0dp)\n" + - "\tcellLayoutBorderSpacePx Vertical: 32.0px (16.0dp)\n" + - "\tcellLayoutPaddingPx.left: 59.0px (29.5dp)\n" + - "\tcellLayoutPaddingPx.top: 32.0px (16.0dp)\n" + - "\tcellLayoutPaddingPx.right: 59.0px (29.5dp)\n" + - "\tcellLayoutPaddingPx.bottom: 59.0px (29.5dp)\n" + - "\ticonSizePx: 120.0px (60.0dp)\n" + - "\ticonTextSizePx: 28.0px (14.0dp)\n" + - "\ticonDrawablePaddingPx: 14.0px (7.0dp)\n" + - "\tfolderCellWidthPx: 240.0px (120.0dp)\n" + - "\tfolderCellHeightPx: 208.0px (104.0dp)\n" + - "\tfolderChildIconSizePx: 120.0px (60.0dp)\n" + - "\tfolderChildTextSizePx: 28.0px (14.0dp)\n" + - "\tfolderChildDrawablePaddingPx: 16.0px (8.0dp)\n" + - "\tfolderCellLayoutBorderSpacePx Horizontal: 32.0px (16.0dp)\n" + - "\tfolderCellLayoutBorderSpacePx Vertical: 32.0px (16.0dp)\n" + - "\tfolderContentPaddingLeftRight: 32.0px (16.0dp)\n" + - "\tfolderTopPadding: 48.0px (24.0dp)\n" + - "\tbottomSheetTopPadding: 104.0px (52.0dp)\n" + - "\tallAppsShiftRange: 1496.0px (748.0dp)\n" + - "\tallAppsTopPadding: 104.0px (52.0dp)\n" + - "\tallAppsIconSizePx: 120.0px (60.0dp)\n" + - "\tallAppsIconTextSizePx: 28.0px (14.0dp)\n" + - "\tallAppsIconDrawablePaddingPx: 14.0px (7.0dp)\n" + - "\tallAppsCellHeightPx: 284.0px (142.0dp)\n" + - "\tallAppsCellWidthPx: 252.0px (126.0dp)\n" + - "\tallAppsBorderSpacePxX: 32.0px (16.0dp)\n" + - "\tallAppsBorderSpacePxY: 32.0px (16.0dp)\n" + - "\tnumShownAllAppsColumns: 6\n" + - "\tallAppsLeftRightPadding: 64.0px (32.0dp)\n" + - "\tallAppsLeftRightMargin: 380.0px (190.0dp)\n" + - "\thotseatBarSizePx: 200.0px (100.0dp)\n" + - "\tinv.hotseatColumnSpan: 4\n" + - "\thotseatCellHeightPx: 135.0px (67.5dp)\n" + - "\thotseatBarBottomSpacePx: 80.0px (40.0dp)\n" + - "\thotseatBarSidePaddingStartPx: 0.0px (0.0dp)\n" + - "\thotseatBarSidePaddingEndPx: 0.0px (0.0dp)\n" + - "\thotseatBarEndOffset: 705.0px (352.5dp)\n" + - "\thotseatQsbSpace: 64.0px (32.0dp)\n" + - "\thotseatQsbHeight: 126.0px (63.0dp)\n" + - "\tspringLoadedHotseatBarTopMarginPx: 128.0px (64.0dp)\n" + - "\tgetHotseatLayoutPadding(context).top: -8.0px (-4.0dp)\n" + - "\tgetHotseatLayoutPadding(context).bottom: 73.0px (36.5dp)\n" + - "\tgetHotseatLayoutPadding(context).left: 954.0px (477.0dp)\n" + - "\tgetHotseatLayoutPadding(context).right: 705.0px (352.5dp)\n" + - "\tnumShownHotseatIcons: 6\n" + - "\thotseatBorderSpace: 36.0px (18.0dp)\n" + - "\tisQsbInline: true\n" + - "\thotseatQsbWidth: 619.0px (309.5dp)\n" + - "\tisTaskbarPresent:true\n" + - "\tisTaskbarPresentInApps:true\n" + - "\ttaskbarSize: 120.0px (60.0dp)\n" + - "\tdesiredWorkspaceHorizontalMarginPx: 240.0px (120.0dp)\n" + - "\tworkspacePadding.left: 181.0px (90.5dp)\n" + - "\tworkspacePadding.top: 0.0px (0.0dp)\n" + - "\tworkspacePadding.right: 181.0px (90.5dp)\n" + - "\tworkspacePadding.bottom: 237.0px (118.5dp)\n" + - "\ticonScale: 1.0px (0.5dp)\n" + - "\tcellScaleToFit : 1.0px (0.5dp)\n" + - "\textraSpace: 104.0px (52.0dp)\n" + - "\tunscaled extraSpace: 104.0px (52.0dp)\n" + - "\tmaxEmptySpace: 200.0px (100.0dp)\n" + - "\tworkspaceTopPadding: 32.0px (16.0dp)\n" + - "\tworkspaceBottomPadding: 72.0px (36.0dp)\n" + - "\toverviewTaskMarginPx: 32.0px (16.0dp)\n" + - "\toverviewTaskIconSizePx: 96.0px (48.0dp)\n" + - "\toverviewTaskIconDrawableSizePx: 88.0px (44.0dp)\n" + - "\toverviewTaskIconDrawableSizeGridPx: 88.0px (44.0dp)\n" + - "\toverviewTaskThumbnailTopMarginPx: 128.0px (64.0dp)\n" + - "\toverviewActionsTopMarginPx: 40.0px (20.0dp)\n" + - "\toverviewActionsHeight: 96.0px (48.0dp)\n" + - "\toverviewActionsButtonSpacing: 72.0px (36.0dp)\n" + - "\toverviewPageSpacing: 88.0px (44.0dp)\n" + - "\toverviewRowSpacing: 72.0px (36.0dp)\n" + - "\toverviewGridSideMargin: 128.0px (64.0dp)\n" + - "\tdropTargetBarTopMarginPx: 0.0px (0.0dp)\n" + - "\tdropTargetBarSizePx: 144.0px (72.0dp)\n" + - "\tdropTargetBarBottomMarginPx: 64.0px (32.0dp)\n" + - "\tgetCellLayoutSpringLoadShrunkTop(): 312.0px (156.0dp)\n" + - "\tgetCellLayoutSpringLoadShrunkBottom(): 1272.0px (636.0dp)\n" + - "\tworkspaceSpringLoadedMinNextPageVisiblePx: 48.0px (24.0dp)\n" + - "\tgetWorkspaceSpringLoadScale(): 0.76250994px (0.38125497dp)\n" + - "\tgetCellLayoutHeight(): 1259.0px (629.5dp)\n" + - "\tgetCellLayoutWidth(): 2198.0px (1099.0dp)\n") - } - - @Test - fun tabletLandscape() { - initializeVarsForTablet(isLandscape = true) - val dp = newDP() - dp.isTaskbarPresentInApps = true - - assertThat(dump(dp)).isEqualTo("DeviceProfile:\n" + - "\t1 dp = 2.0 px\n" + - "\tisTablet:true\n" + - "\tisPhone:false\n" + - "\ttransposeLayoutWithOrientation:false\n" + - "\tisGestureMode:true\n" + - "\tisLandscape:true\n" + - "\tisMultiWindowMode:false\n" + - "\tisTwoPanels:false\n" + - "\twindowX: 0.0px (0.0dp)\n" + - "\twindowY: 0.0px (0.0dp)\n" + - "\twidthPx: 2560.0px (1280.0dp)\n" + - "\theightPx: 1600.0px (800.0dp)\n" + - "\tavailableWidthPx: 2560.0px (1280.0dp)\n" + - "\tavailableHeightPx: 1496.0px (748.0dp)\n" + - "\tmInsets.left: 0.0px (0.0dp)\n" + - "\tmInsets.top: 104.0px (52.0dp)\n" + - "\tmInsets.right: 0.0px (0.0dp)\n" + - "\tmInsets.bottom: 0.0px (0.0dp)\n" + - "\taspectRatio:1.6\n" + - "\tisScalableGrid:true\n" + - "\tinv.numRows: 5\n" + - "\tinv.numColumns: 6\n" + - "\tinv.numSearchContainerColumns: 3\n" + - "\tminCellSize: PointF(120.0, 104.0)dp\n" + - "\tcellWidthPx: 240.0px (120.0dp)\n" + - "\tcellHeightPx: 208.0px (104.0dp)\n" + - "\tgetCellSize().x: 240.0px (120.0dp)\n" + - "\tgetCellSize().y: 208.0px (104.0dp)\n" + - "\tcellLayoutBorderSpacePx Horizontal: 128.0px (64.0dp)\n" + - "\tcellLayoutBorderSpacePx Vertical: 32.0px (16.0dp)\n" + - "\tcellLayoutPaddingPx.left: 59.0px (29.5dp)\n" + - "\tcellLayoutPaddingPx.top: 32.0px (16.0dp)\n" + - "\tcellLayoutPaddingPx.right: 59.0px (29.5dp)\n" + - "\tcellLayoutPaddingPx.bottom: 59.0px (29.5dp)\n" + - "\ticonSizePx: 120.0px (60.0dp)\n" + - "\ticonTextSizePx: 28.0px (14.0dp)\n" + - "\ticonDrawablePaddingPx: 14.0px (7.0dp)\n" + - "\tfolderCellWidthPx: 240.0px (120.0dp)\n" + - "\tfolderCellHeightPx: 208.0px (104.0dp)\n" + - "\tfolderChildIconSizePx: 120.0px (60.0dp)\n" + - "\tfolderChildTextSizePx: 28.0px (14.0dp)\n" + - "\tfolderChildDrawablePaddingPx: 16.0px (8.0dp)\n" + - "\tfolderCellLayoutBorderSpacePx Horizontal: 32.0px (16.0dp)\n" + - "\tfolderCellLayoutBorderSpacePx Vertical: 32.0px (16.0dp)\n" + - "\tfolderContentPaddingLeftRight: 32.0px (16.0dp)\n" + - "\tfolderTopPadding: 48.0px (24.0dp)\n" + - "\tbottomSheetTopPadding: 104.0px (52.0dp)\n" + - "\tallAppsShiftRange: 1496.0px (748.0dp)\n" + - "\tallAppsTopPadding: 104.0px (52.0dp)\n" + - "\tallAppsIconSizePx: 120.0px (60.0dp)\n" + - "\tallAppsIconTextSizePx: 28.0px (14.0dp)\n" + - "\tallAppsIconDrawablePaddingPx: 14.0px (7.0dp)\n" + - "\tallAppsCellHeightPx: 284.0px (142.0dp)\n" + - "\tallAppsCellWidthPx: 252.0px (126.0dp)\n" + - "\tallAppsBorderSpacePxX: 32.0px (16.0dp)\n" + - "\tallAppsBorderSpacePxY: 32.0px (16.0dp)\n" + - "\tnumShownAllAppsColumns: 6\n" + - "\tallAppsLeftRightPadding: 64.0px (32.0dp)\n" + - "\tallAppsLeftRightMargin: 380.0px (190.0dp)\n" + - "\thotseatBarSizePx: 200.0px (100.0dp)\n" + - "\tinv.hotseatColumnSpan: 4\n" + - "\thotseatCellHeightPx: 135.0px (67.5dp)\n" + - "\thotseatBarBottomSpacePx: 80.0px (40.0dp)\n" + - "\thotseatBarSidePaddingStartPx: 0.0px (0.0dp)\n" + - "\thotseatBarSidePaddingEndPx: 0.0px (0.0dp)\n" + - "\thotseatBarEndOffset: 0.0px (0.0dp)\n" + - "\thotseatQsbSpace: 64.0px (32.0dp)\n" + - "\thotseatQsbHeight: 126.0px (63.0dp)\n" + - "\tspringLoadedHotseatBarTopMarginPx: 128.0px (64.0dp)\n" + - "\tgetHotseatLayoutPadding(context).top: -8.0px (-4.0dp)\n" + - "\tgetHotseatLayoutPadding(context).bottom: 73.0px (36.5dp)\n" + - "\tgetHotseatLayoutPadding(context).left: 1040.0px (520.0dp)\n" + - "\tgetHotseatLayoutPadding(context).right: 300.0px (150.0dp)\n" + - "\tnumShownHotseatIcons: 6\n" + - "\thotseatBorderSpace: 100.0px (50.0dp)\n" + - "\tisQsbInline: true\n" + - "\thotseatQsbWidth: 640.0px (320.0dp)\n" + - "\tisTaskbarPresent:true\n" + - "\tisTaskbarPresentInApps:true\n" + - "\ttaskbarSize: 120.0px (60.0dp)\n" + - "\tdesiredWorkspaceHorizontalMarginPx: 240.0px (120.0dp)\n" + - "\tworkspacePadding.left: 181.0px (90.5dp)\n" + - "\tworkspacePadding.top: 0.0px (0.0dp)\n" + - "\tworkspacePadding.right: 181.0px (90.5dp)\n" + - "\tworkspacePadding.bottom: 237.0px (118.5dp)\n" + - "\ticonScale: 1.0px (0.5dp)\n" + - "\tcellScaleToFit : 1.0px (0.5dp)\n" + - "\textraSpace: 104.0px (52.0dp)\n" + - "\tunscaled extraSpace: 104.0px (52.0dp)\n" + - "\tmaxEmptySpace: 200.0px (100.0dp)\n" + - "\tworkspaceTopPadding: 32.0px (16.0dp)\n" + - "\tworkspaceBottomPadding: 72.0px (36.0dp)\n" + - "\toverviewTaskMarginPx: 32.0px (16.0dp)\n" + - "\toverviewTaskIconSizePx: 96.0px (48.0dp)\n" + - "\toverviewTaskIconDrawableSizePx: 88.0px (44.0dp)\n" + - "\toverviewTaskIconDrawableSizeGridPx: 88.0px (44.0dp)\n" + - "\toverviewTaskThumbnailTopMarginPx: 128.0px (64.0dp)\n" + - "\toverviewActionsTopMarginPx: 40.0px (20.0dp)\n" + - "\toverviewActionsHeight: 96.0px (48.0dp)\n" + - "\toverviewActionsButtonSpacing: 72.0px (36.0dp)\n" + - "\toverviewPageSpacing: 88.0px (44.0dp)\n" + - "\toverviewRowSpacing: 72.0px (36.0dp)\n" + - "\toverviewGridSideMargin: 128.0px (64.0dp)\n" + - "\tdropTargetBarTopMarginPx: 0.0px (0.0dp)\n" + - "\tdropTargetBarSizePx: 144.0px (72.0dp)\n" + - "\tdropTargetBarBottomMarginPx: 64.0px (32.0dp)\n" + - "\tgetCellLayoutSpringLoadShrunkTop(): 312.0px (156.0dp)\n" + - "\tgetCellLayoutSpringLoadShrunkBottom(): 1272.0px (636.0dp)\n" + - "\tworkspaceSpringLoadedMinNextPageVisiblePx: 48.0px (24.0dp)\n" + - "\tgetWorkspaceSpringLoadScale(): 0.76250994px (0.38125497dp)\n" + - "\tgetCellLayoutHeight(): 1259.0px (629.5dp)\n" + - "\tgetCellLayoutWidth(): 2198.0px (1099.0dp)\n") - } - - @Test - fun tabletPortrait3Button() { - initializeVarsForTablet(isGestureMode = false) - val dp = newDP() - dp.isTaskbarPresentInApps = true - - assertThat(dump(dp)).isEqualTo("DeviceProfile:\n" + - "\t1 dp = 2.0 px\n" + - "\tisTablet:true\n" + - "\tisPhone:false\n" + - "\ttransposeLayoutWithOrientation:false\n" + - "\tisGestureMode:false\n" + - "\tisLandscape:false\n" + - "\tisMultiWindowMode:false\n" + - "\tisTwoPanels:false\n" + - "\twindowX: 0.0px (0.0dp)\n" + - "\twindowY: 0.0px (0.0dp)\n" + - "\twidthPx: 1600.0px (800.0dp)\n" + - "\theightPx: 2560.0px (1280.0dp)\n" + - "\tavailableWidthPx: 1600.0px (800.0dp)\n" + - "\tavailableHeightPx: 2456.0px (1228.0dp)\n" + - "\tmInsets.left: 0.0px (0.0dp)\n" + - "\tmInsets.top: 104.0px (52.0dp)\n" + - "\tmInsets.right: 0.0px (0.0dp)\n" + - "\tmInsets.bottom: 0.0px (0.0dp)\n" + - "\taspectRatio:1.6\n" + - "\tisScalableGrid:true\n" + - "\tinv.numRows: 5\n" + - "\tinv.numColumns: 6\n" + - "\tinv.numSearchContainerColumns: 3\n" + - "\tminCellSize: PointF(102.0, 120.0)dp\n" + - "\tcellWidthPx: 204.0px (102.0dp)\n" + - "\tcellHeightPx: 240.0px (120.0dp)\n" + - "\tgetCellSize().x: 204.0px (102.0dp)\n" + - "\tgetCellSize().y: 240.0px (120.0dp)\n" + - "\tcellLayoutBorderSpacePx Horizontal: 32.0px (16.0dp)\n" + - "\tcellLayoutBorderSpacePx Vertical: 128.0px (64.0dp)\n" + - "\tcellLayoutPaddingPx.left: 72.0px (36.0dp)\n" + - "\tcellLayoutPaddingPx.top: 72.0px (36.0dp)\n" + - "\tcellLayoutPaddingPx.right: 72.0px (36.0dp)\n" + - "\tcellLayoutPaddingPx.bottom: 72.0px (36.0dp)\n" + - "\ticonSizePx: 120.0px (60.0dp)\n" + - "\ticonTextSizePx: 28.0px (14.0dp)\n" + - "\ticonDrawablePaddingPx: 14.0px (7.0dp)\n" + - "\tfolderCellWidthPx: 240.0px (120.0dp)\n" + - "\tfolderCellHeightPx: 208.0px (104.0dp)\n" + - "\tfolderChildIconSizePx: 120.0px (60.0dp)\n" + - "\tfolderChildTextSizePx: 28.0px (14.0dp)\n" + - "\tfolderChildDrawablePaddingPx: 16.0px (8.0dp)\n" + - "\tfolderCellLayoutBorderSpacePx Horizontal: 32.0px (16.0dp)\n" + - "\tfolderCellLayoutBorderSpacePx Vertical: 32.0px (16.0dp)\n" + - "\tfolderContentPaddingLeftRight: 32.0px (16.0dp)\n" + - "\tfolderTopPadding: 48.0px (24.0dp)\n" + - "\tbottomSheetTopPadding: 704.0px (352.0dp)\n" + - "\tallAppsShiftRange: 1936.0px (968.0dp)\n" + - "\tallAppsTopPadding: 624.0px (312.0dp)\n" + - "\tallAppsIconSizePx: 120.0px (60.0dp)\n" + - "\tallAppsIconTextSizePx: 28.0px (14.0dp)\n" + - "\tallAppsIconDrawablePaddingPx: 14.0px (7.0dp)\n" + - "\tallAppsCellHeightPx: 316.0px (158.0dp)\n" + - "\tallAppsCellWidthPx: 192.0px (96.0dp)\n" + - "\tallAppsBorderSpacePxX: 16.0px (8.0dp)\n" + - "\tallAppsBorderSpacePxY: 32.0px (16.0dp)\n" + - "\tnumShownAllAppsColumns: 6\n" + - "\tallAppsLeftRightPadding: 56.0px (28.0dp)\n" + - "\tallAppsLeftRightMargin: 128.0px (64.0dp)\n" + - "\thotseatBarSizePx: 358.0px (179.0dp)\n" + - "\tinv.hotseatColumnSpan: 6\n" + - "\thotseatCellHeightPx: 135.0px (67.5dp)\n" + - "\thotseatBarBottomSpacePx: 72.0px (36.0dp)\n" + - "\thotseatBarSidePaddingStartPx: 0.0px (0.0dp)\n" + - "\thotseatBarSidePaddingEndPx: 0.0px (0.0dp)\n" + - "\thotseatBarEndOffset: 558.0px (279.0dp)\n" + - "\thotseatQsbSpace: 64.0px (32.0dp)\n" + - "\thotseatQsbHeight: 126.0px (63.0dp)\n" + - "\tspringLoadedHotseatBarTopMarginPx: 216.0px (108.0dp)\n" + - "\tgetHotseatLayoutPadding(context).top: 158.0px (79.0dp)\n" + - "\tgetHotseatLayoutPadding(context).bottom: 65.0px (32.5dp)\n" + - "\tgetHotseatLayoutPadding(context).left: 150.0px (75.0dp)\n" + - "\tgetHotseatLayoutPadding(context).right: 558.0px (279.0dp)\n" + - "\tnumShownHotseatIcons: 5\n" + - "\thotseatBorderSpace: 73.0px (36.5dp)\n" + - "\tisQsbInline: false\n" + - "\thotseatQsbWidth: 1300.0px (650.0dp)\n" + - "\tisTaskbarPresent:true\n" + - "\tisTaskbarPresentInApps:true\n" + - "\ttaskbarSize: 120.0px (60.0dp)\n" + - "\tdesiredWorkspaceHorizontalMarginPx: 108.0px (54.0dp)\n" + - "\tworkspacePadding.left: 36.0px (18.0dp)\n" + - "\tworkspacePadding.top: 87.0px (43.5dp)\n" + - "\tworkspacePadding.right: 36.0px (18.0dp)\n" + - "\tworkspacePadding.bottom: 513.0px (256.5dp)\n" + - "\ticonScale: 1.0px (0.5dp)\n" + - "\tcellScaleToFit : 1.0px (0.5dp)\n" + - "\textraSpace: 362.0px (181.0dp)\n" + - "\tunscaled extraSpace: 362.0px (181.0dp)\n" + - "\tmaxEmptySpace: 19998.0px (9999.0dp)\n" + - "\tworkspaceTopPadding: 159.0px (79.5dp)\n" + - "\tworkspaceBottomPadding: 203.0px (101.5dp)\n" + - "\toverviewTaskMarginPx: 32.0px (16.0dp)\n" + - "\toverviewTaskIconSizePx: 96.0px (48.0dp)\n" + - "\toverviewTaskIconDrawableSizePx: 88.0px (44.0dp)\n" + - "\toverviewTaskIconDrawableSizeGridPx: 88.0px (44.0dp)\n" + - "\toverviewTaskThumbnailTopMarginPx: 128.0px (64.0dp)\n" + - "\toverviewActionsTopMarginPx: 48.0px (24.0dp)\n" + - "\toverviewActionsHeight: 96.0px (48.0dp)\n" + - "\toverviewActionsButtonSpacing: 72.0px (36.0dp)\n" + - "\toverviewPageSpacing: 88.0px (44.0dp)\n" + - "\toverviewRowSpacing: 72.0px (36.0dp)\n" + - "\toverviewGridSideMargin: 128.0px (64.0dp)\n" + - "\tdropTargetBarTopMarginPx: 220.0px (110.0dp)\n" + - "\tdropTargetBarSizePx: 144.0px (72.0dp)\n" + - "\tdropTargetBarBottomMarginPx: 96.0px (48.0dp)\n" + - "\tgetCellLayoutSpringLoadShrunkTop(): 564.0px (282.0dp)\n" + - "\tgetCellLayoutSpringLoadShrunkBottom(): 1986.0px (993.0dp)\n" + - "\tworkspaceSpringLoadedMinNextPageVisiblePx: 48.0px (24.0dp)\n" + - "\tgetWorkspaceSpringLoadScale(): 0.76616377px (0.38308188dp)\n" + - "\tgetCellLayoutHeight(): 1856.0px (928.0dp)\n" + - "\tgetCellLayoutWidth(): 1528.0px (764.0dp)\n") - } - - @Test - fun tabletPortrait() { - initializeVarsForTablet() - val dp = newDP() - dp.isTaskbarPresentInApps = true - - assertThat(dump(dp)).isEqualTo("DeviceProfile:\n" + - "\t1 dp = 2.0 px\n" + - "\tisTablet:true\n" + - "\tisPhone:false\n" + - "\ttransposeLayoutWithOrientation:false\n" + - "\tisGestureMode:true\n" + - "\tisLandscape:false\n" + - "\tisMultiWindowMode:false\n" + - "\tisTwoPanels:false\n" + - "\twindowX: 0.0px (0.0dp)\n" + - "\twindowY: 0.0px (0.0dp)\n" + - "\twidthPx: 1600.0px (800.0dp)\n" + - "\theightPx: 2560.0px (1280.0dp)\n" + - "\tavailableWidthPx: 1600.0px (800.0dp)\n" + - "\tavailableHeightPx: 2456.0px (1228.0dp)\n" + - "\tmInsets.left: 0.0px (0.0dp)\n" + - "\tmInsets.top: 104.0px (52.0dp)\n" + - "\tmInsets.right: 0.0px (0.0dp)\n" + - "\tmInsets.bottom: 0.0px (0.0dp)\n" + - "\taspectRatio:1.6\n" + - "\tisScalableGrid:true\n" + - "\tinv.numRows: 5\n" + - "\tinv.numColumns: 6\n" + - "\tinv.numSearchContainerColumns: 3\n" + - "\tminCellSize: PointF(102.0, 120.0)dp\n" + - "\tcellWidthPx: 204.0px (102.0dp)\n" + - "\tcellHeightPx: 240.0px (120.0dp)\n" + - "\tgetCellSize().x: 204.0px (102.0dp)\n" + - "\tgetCellSize().y: 240.0px (120.0dp)\n" + - "\tcellLayoutBorderSpacePx Horizontal: 32.0px (16.0dp)\n" + - "\tcellLayoutBorderSpacePx Vertical: 128.0px (64.0dp)\n" + - "\tcellLayoutPaddingPx.left: 72.0px (36.0dp)\n" + - "\tcellLayoutPaddingPx.top: 72.0px (36.0dp)\n" + - "\tcellLayoutPaddingPx.right: 72.0px (36.0dp)\n" + - "\tcellLayoutPaddingPx.bottom: 72.0px (36.0dp)\n" + - "\ticonSizePx: 120.0px (60.0dp)\n" + - "\ticonTextSizePx: 28.0px (14.0dp)\n" + - "\ticonDrawablePaddingPx: 14.0px (7.0dp)\n" + - "\tfolderCellWidthPx: 240.0px (120.0dp)\n" + - "\tfolderCellHeightPx: 208.0px (104.0dp)\n" + - "\tfolderChildIconSizePx: 120.0px (60.0dp)\n" + - "\tfolderChildTextSizePx: 28.0px (14.0dp)\n" + - "\tfolderChildDrawablePaddingPx: 16.0px (8.0dp)\n" + - "\tfolderCellLayoutBorderSpacePx Horizontal: 32.0px (16.0dp)\n" + - "\tfolderCellLayoutBorderSpacePx Vertical: 32.0px (16.0dp)\n" + - "\tfolderContentPaddingLeftRight: 32.0px (16.0dp)\n" + - "\tfolderTopPadding: 48.0px (24.0dp)\n" + - "\tbottomSheetTopPadding: 704.0px (352.0dp)\n" + - "\tallAppsShiftRange: 1936.0px (968.0dp)\n" + - "\tallAppsTopPadding: 624.0px (312.0dp)\n" + - "\tallAppsIconSizePx: 120.0px (60.0dp)\n" + - "\tallAppsIconTextSizePx: 28.0px (14.0dp)\n" + - "\tallAppsIconDrawablePaddingPx: 14.0px (7.0dp)\n" + - "\tallAppsCellHeightPx: 316.0px (158.0dp)\n" + - "\tallAppsCellWidthPx: 192.0px (96.0dp)\n" + - "\tallAppsBorderSpacePxX: 16.0px (8.0dp)\n" + - "\tallAppsBorderSpacePxY: 32.0px (16.0dp)\n" + - "\tnumShownAllAppsColumns: 6\n" + - "\tallAppsLeftRightPadding: 56.0px (28.0dp)\n" + - "\tallAppsLeftRightMargin: 128.0px (64.0dp)\n" + - "\thotseatBarSizePx: 358.0px (179.0dp)\n" + - "\tinv.hotseatColumnSpan: 6\n" + - "\thotseatCellHeightPx: 135.0px (67.5dp)\n" + - "\thotseatBarBottomSpacePx: 72.0px (36.0dp)\n" + - "\thotseatBarSidePaddingStartPx: 0.0px (0.0dp)\n" + - "\thotseatBarSidePaddingEndPx: 0.0px (0.0dp)\n" + - "\thotseatBarEndOffset: 0.0px (0.0dp)\n" + - "\thotseatQsbSpace: 64.0px (32.0dp)\n" + - "\thotseatQsbHeight: 126.0px (63.0dp)\n" + - "\tspringLoadedHotseatBarTopMarginPx: 216.0px (108.0dp)\n" + - "\tgetHotseatLayoutPadding(context).top: 158.0px (79.0dp)\n" + - "\tgetHotseatLayoutPadding(context).bottom: 65.0px (32.5dp)\n" + - "\tgetHotseatLayoutPadding(context).left: 150.0px (75.0dp)\n" + - "\tgetHotseatLayoutPadding(context).right: 150.0px (75.0dp)\n" + - "\tnumShownHotseatIcons: 6\n" + - "\thotseatBorderSpace: 116.0px (58.0dp)\n" + - "\tisQsbInline: false\n" + - "\thotseatQsbWidth: 1300.0px (650.0dp)\n" + - "\tisTaskbarPresent:true\n" + - "\tisTaskbarPresentInApps:true\n" + - "\ttaskbarSize: 120.0px (60.0dp)\n" + - "\tdesiredWorkspaceHorizontalMarginPx: 108.0px (54.0dp)\n" + - "\tworkspacePadding.left: 36.0px (18.0dp)\n" + - "\tworkspacePadding.top: 87.0px (43.5dp)\n" + - "\tworkspacePadding.right: 36.0px (18.0dp)\n" + - "\tworkspacePadding.bottom: 513.0px (256.5dp)\n" + - "\ticonScale: 1.0px (0.5dp)\n" + - "\tcellScaleToFit : 1.0px (0.5dp)\n" + - "\textraSpace: 362.0px (181.0dp)\n" + - "\tunscaled extraSpace: 362.0px (181.0dp)\n" + - "\tmaxEmptySpace: 19998.0px (9999.0dp)\n" + - "\tworkspaceTopPadding: 159.0px (79.5dp)\n" + - "\tworkspaceBottomPadding: 203.0px (101.5dp)\n" + - "\toverviewTaskMarginPx: 32.0px (16.0dp)\n" + - "\toverviewTaskIconSizePx: 96.0px (48.0dp)\n" + - "\toverviewTaskIconDrawableSizePx: 88.0px (44.0dp)\n" + - "\toverviewTaskIconDrawableSizeGridPx: 88.0px (44.0dp)\n" + - "\toverviewTaskThumbnailTopMarginPx: 128.0px (64.0dp)\n" + - "\toverviewActionsTopMarginPx: 48.0px (24.0dp)\n" + - "\toverviewActionsHeight: 96.0px (48.0dp)\n" + - "\toverviewActionsButtonSpacing: 72.0px (36.0dp)\n" + - "\toverviewPageSpacing: 88.0px (44.0dp)\n" + - "\toverviewRowSpacing: 72.0px (36.0dp)\n" + - "\toverviewGridSideMargin: 128.0px (64.0dp)\n" + - "\tdropTargetBarTopMarginPx: 220.0px (110.0dp)\n" + - "\tdropTargetBarSizePx: 144.0px (72.0dp)\n" + - "\tdropTargetBarBottomMarginPx: 96.0px (48.0dp)\n" + - "\tgetCellLayoutSpringLoadShrunkTop(): 564.0px (282.0dp)\n" + - "\tgetCellLayoutSpringLoadShrunkBottom(): 1986.0px (993.0dp)\n" + - "\tworkspaceSpringLoadedMinNextPageVisiblePx: 48.0px (24.0dp)\n" + - "\tgetWorkspaceSpringLoadScale(): 0.76616377px (0.38308188dp)\n" + - "\tgetCellLayoutHeight(): 1856.0px (928.0dp)\n" + - "\tgetCellLayoutWidth(): 1528.0px (764.0dp)\n") - } - - @Test - fun twoPanelLandscape3Button() { - initializeVarsForTwoPanel(isLandscape = true, isGestureMode = false) - val dp = newDP() - dp.isTaskbarPresentInApps = true - - assertThat(dump(dp)).isEqualTo("DeviceProfile:\n" + - "\t1 dp = 2.625 px\n" + - "\tisTablet:true\n" + - "\tisPhone:false\n" + - "\ttransposeLayoutWithOrientation:false\n" + - "\tisGestureMode:false\n" + - "\tisLandscape:true\n" + - "\tisMultiWindowMode:false\n" + - "\tisTwoPanels:true\n" + - "\twindowX: 0.0px (0.0dp)\n" + - "\twindowY: 0.0px (0.0dp)\n" + - "\twidthPx: 2208.0px (841.1429dp)\n" + - "\theightPx: 1840.0px (700.9524dp)\n" + - "\tavailableWidthPx: 2208.0px (841.1429dp)\n" + - "\tavailableHeightPx: 1730.0px (659.0476dp)\n" + - "\tmInsets.left: 0.0px (0.0dp)\n" + - "\tmInsets.top: 110.0px (41.904762dp)\n" + - "\tmInsets.right: 0.0px (0.0dp)\n" + - "\tmInsets.bottom: 0.0px (0.0dp)\n" + - "\taspectRatio:1.2\n" + - "\tisScalableGrid:true\n" + - "\tinv.numRows: 4\n" + - "\tinv.numColumns: 4\n" + - "\tinv.numSearchContainerColumns: 4\n" + - "\tminCellSize: PointF(80.0, 102.0)dp\n" + - "\tcellWidthPx: 210.0px (80.0dp)\n" + - "\tcellHeightPx: 267.0px (101.71429dp)\n" + - "\tgetCellSize().x: 210.0px (80.0dp)\n" + - "\tgetCellSize().y: 267.0px (101.71429dp)\n" + - "\tcellLayoutBorderSpacePx Horizontal: 52.0px (19.809525dp)\n" + - "\tcellLayoutBorderSpacePx Vertical: 52.0px (19.809525dp)\n" + - "\tcellLayoutPaddingPx.left: 26.0px (9.904762dp)\n" + - "\tcellLayoutPaddingPx.top: 18.0px (6.857143dp)\n" + - "\tcellLayoutPaddingPx.right: 26.0px (9.904762dp)\n" + - "\tcellLayoutPaddingPx.bottom: 26.0px (9.904762dp)\n" + - "\ticonSizePx: 157.0px (59.809525dp)\n" + - "\ticonTextSizePx: 36.0px (13.714286dp)\n" + - "\ticonDrawablePaddingPx: 17.0px (6.4761906dp)\n" + - "\tfolderCellWidthPx: 210.0px (80.0dp)\n" + - "\tfolderCellHeightPx: 247.0px (94.09524dp)\n" + - "\tfolderChildIconSizePx: 158.0px (60.190475dp)\n" + - "\tfolderChildTextSizePx: 37.0px (14.095238dp)\n" + - "\tfolderChildDrawablePaddingPx: 13.0px (4.952381dp)\n" + - "\tfolderCellLayoutBorderSpacePx Horizontal: 42.0px (16.0dp)\n" + - "\tfolderCellLayoutBorderSpacePx Vertical: 42.0px (16.0dp)\n" + - "\tfolderContentPaddingLeftRight: 42.0px (16.0dp)\n" + - "\tfolderTopPadding: 63.0px (24.0dp)\n" + - "\tbottomSheetTopPadding: 110.0px (41.904762dp)\n" + - "\tallAppsShiftRange: 1730.0px (659.0476dp)\n" + - "\tallAppsTopPadding: 110.0px (41.904762dp)\n" + - "\tallAppsIconSizePx: 157.0px (59.809525dp)\n" + - "\tallAppsIconTextSizePx: 37.0px (14.095238dp)\n" + - "\tallAppsIconDrawablePaddingPx: 18.0px (6.857143dp)\n" + - "\tallAppsCellHeightPx: 315.0px (120.0dp)\n" + - "\tallAppsCellWidthPx: 210.0px (80.0dp)\n" + - "\tallAppsBorderSpacePxX: 52.0px (19.809525dp)\n" + - "\tallAppsBorderSpacePxY: 42.0px (16.0dp)\n" + - "\tnumShownAllAppsColumns: 6\n" + - "\tallAppsLeftRightPadding: 137.0px (52.190475dp)\n" + - "\tallAppsLeftRightMargin: 207.0px (78.85714dp)\n" + - "\thotseatBarSizePx: 417.0px (158.85715dp)\n" + - "\tinv.hotseatColumnSpan: 6\n" + - "\thotseatCellHeightPx: 177.0px (67.42857dp)\n" + - "\thotseatBarBottomSpacePx: 53.0px (20.190475dp)\n" + - "\thotseatBarSidePaddingStartPx: 0.0px (0.0dp)\n" + - "\thotseatBarSidePaddingEndPx: 0.0px (0.0dp)\n" + - "\thotseatBarEndOffset: 744.0px (283.42856dp)\n" + - "\thotseatQsbSpace: 74.0px (28.190475dp)\n" + - "\thotseatQsbHeight: 165.0px (62.857143dp)\n" + - "\tspringLoadedHotseatBarTopMarginPx: 116.0px (44.190475dp)\n" + - "\tgetHotseatLayoutPadding(context).top: 197.0px (75.04762dp)\n" + - "\tgetHotseatLayoutPadding(context).bottom: 43.0px (16.380953dp)\n" + - "\tgetHotseatLayoutPadding(context).left: 106.0px (40.38095dp)\n" + - "\tgetHotseatLayoutPadding(context).right: 744.0px (283.42856dp)\n" + - "\tnumShownHotseatIcons: 6\n" + - "\thotseatBorderSpace: 83.0px (31.619047dp)\n" + - "\tisQsbInline: false\n" + - "\thotseatQsbWidth: 1467.0px (558.8571dp)\n" + - "\tisTaskbarPresent:true\n" + - "\tisTaskbarPresentInApps:true\n" + - "\ttaskbarSize: 158.0px (60.190475dp)\n" + - "\tdesiredWorkspaceHorizontalMarginPx: 79.0px (30.095238dp)\n" + - "\tworkspacePadding.left: 53.0px (20.190475dp)\n" + - "\tworkspacePadding.top: 0.0px (0.0dp)\n" + - "\tworkspacePadding.right: 53.0px (20.190475dp)\n" + - "\tworkspacePadding.bottom: 461.0px (175.61905dp)\n" + - "\ticonScale: 0.99864316px (0.3804355dp)\n" + - "\tcellScaleToFit : 0.99864316px (0.3804355dp)\n" + - "\textraSpace: 57.0px (21.714285dp)\n" + - "\tunscaled extraSpace: 57.077446px (21.74379dp)\n" + - "\tmaxEmptySpace: 131.0px (49.904762dp)\n" + - "\tworkspaceTopPadding: 18.0px (6.857143dp)\n" + - "\tworkspaceBottomPadding: 39.0px (14.857142dp)\n" + - "\toverviewTaskMarginPx: 32.0px (12.190476dp)\n" + - "\toverviewTaskIconSizePx: 126.0px (48.0dp)\n" + - "\toverviewTaskIconDrawableSizePx: 116.0px (44.190475dp)\n" + - "\toverviewTaskIconDrawableSizeGridPx: 116.0px (44.190475dp)\n" + - "\toverviewTaskThumbnailTopMarginPx: 158.0px (60.190475dp)\n" + - "\toverviewActionsTopMarginPx: 32.0px (12.190476dp)\n" + - "\toverviewActionsHeight: 126.0px (48.0dp)\n" + - "\toverviewActionsButtonSpacing: 95.0px (36.190475dp)\n" + - "\toverviewPageSpacing: 95.0px (36.190475dp)\n" + - "\toverviewRowSpacing: 74.0px (28.190475dp)\n" + - "\toverviewGridSideMargin: 168.0px (64.0dp)\n" + - "\tdropTargetBarTopMarginPx: 0.0px (0.0dp)\n" + - "\tdropTargetBarSizePx: 147.0px (56.0dp)\n" + - "\tdropTargetBarBottomMarginPx: 42.0px (16.0dp)\n" + - "\tgetCellLayoutSpringLoadShrunkTop(): 299.0px (113.90476dp)\n" + - "\tgetCellLayoutSpringLoadShrunkBottom(): 1307.0px (497.90475dp)\n" + - "\tworkspaceSpringLoadedMinNextPageVisiblePx: 63.0px (24.0dp)\n" + - "\tgetWorkspaceSpringLoadScale(): 0.79432625px (0.30260047dp)\n" + - "\tgetCellLayoutHeight(): 1269.0px (483.42856dp)\n" + - "\tgetCellLayoutWidth(): 1051.0px (400.38095dp)\n") - } - - @Test - fun twoPanelLandscape() { - initializeVarsForTwoPanel(isLandscape = true) - val dp = newDP() - dp.isTaskbarPresentInApps = true - - assertThat(dump(dp)).isEqualTo("DeviceProfile:\n" + - "\t1 dp = 2.625 px\n" + - "\tisTablet:true\n" + - "\tisPhone:false\n" + - "\ttransposeLayoutWithOrientation:false\n" + - "\tisGestureMode:true\n" + - "\tisLandscape:true\n" + - "\tisMultiWindowMode:false\n" + - "\tisTwoPanels:true\n" + - "\twindowX: 0.0px (0.0dp)\n" + - "\twindowY: 0.0px (0.0dp)\n" + - "\twidthPx: 2208.0px (841.1429dp)\n" + - "\theightPx: 1840.0px (700.9524dp)\n" + - "\tavailableWidthPx: 2208.0px (841.1429dp)\n" + - "\tavailableHeightPx: 1730.0px (659.0476dp)\n" + - "\tmInsets.left: 0.0px (0.0dp)\n" + - "\tmInsets.top: 110.0px (41.904762dp)\n" + - "\tmInsets.right: 0.0px (0.0dp)\n" + - "\tmInsets.bottom: 0.0px (0.0dp)\n" + - "\taspectRatio:1.2\n" + - "\tisScalableGrid:true\n" + - "\tinv.numRows: 4\n" + - "\tinv.numColumns: 4\n" + - "\tinv.numSearchContainerColumns: 4\n" + - "\tminCellSize: PointF(80.0, 102.0)dp\n" + - "\tcellWidthPx: 210.0px (80.0dp)\n" + - "\tcellHeightPx: 267.0px (101.71429dp)\n" + - "\tgetCellSize().x: 210.0px (80.0dp)\n" + - "\tgetCellSize().y: 267.0px (101.71429dp)\n" + - "\tcellLayoutBorderSpacePx Horizontal: 52.0px (19.809525dp)\n" + - "\tcellLayoutBorderSpacePx Vertical: 52.0px (19.809525dp)\n" + - "\tcellLayoutPaddingPx.left: 26.0px (9.904762dp)\n" + - "\tcellLayoutPaddingPx.top: 18.0px (6.857143dp)\n" + - "\tcellLayoutPaddingPx.right: 26.0px (9.904762dp)\n" + - "\tcellLayoutPaddingPx.bottom: 26.0px (9.904762dp)\n" + - "\ticonSizePx: 157.0px (59.809525dp)\n" + - "\ticonTextSizePx: 36.0px (13.714286dp)\n" + - "\ticonDrawablePaddingPx: 17.0px (6.4761906dp)\n" + - "\tfolderCellWidthPx: 210.0px (80.0dp)\n" + - "\tfolderCellHeightPx: 247.0px (94.09524dp)\n" + - "\tfolderChildIconSizePx: 158.0px (60.190475dp)\n" + - "\tfolderChildTextSizePx: 37.0px (14.095238dp)\n" + - "\tfolderChildDrawablePaddingPx: 13.0px (4.952381dp)\n" + - "\tfolderCellLayoutBorderSpacePx Horizontal: 42.0px (16.0dp)\n" + - "\tfolderCellLayoutBorderSpacePx Vertical: 42.0px (16.0dp)\n" + - "\tfolderContentPaddingLeftRight: 42.0px (16.0dp)\n" + - "\tfolderTopPadding: 63.0px (24.0dp)\n" + - "\tbottomSheetTopPadding: 110.0px (41.904762dp)\n" + - "\tallAppsShiftRange: 1730.0px (659.0476dp)\n" + - "\tallAppsTopPadding: 110.0px (41.904762dp)\n" + - "\tallAppsIconSizePx: 157.0px (59.809525dp)\n" + - "\tallAppsIconTextSizePx: 37.0px (14.095238dp)\n" + - "\tallAppsIconDrawablePaddingPx: 18.0px (6.857143dp)\n" + - "\tallAppsCellHeightPx: 315.0px (120.0dp)\n" + - "\tallAppsCellWidthPx: 210.0px (80.0dp)\n" + - "\tallAppsBorderSpacePxX: 52.0px (19.809525dp)\n" + - "\tallAppsBorderSpacePxY: 42.0px (16.0dp)\n" + - "\tnumShownAllAppsColumns: 6\n" + - "\tallAppsLeftRightPadding: 137.0px (52.190475dp)\n" + - "\tallAppsLeftRightMargin: 207.0px (78.85714dp)\n" + - "\thotseatBarSizePx: 417.0px (158.85715dp)\n" + - "\tinv.hotseatColumnSpan: 6\n" + - "\thotseatCellHeightPx: 177.0px (67.42857dp)\n" + - "\thotseatBarBottomSpacePx: 53.0px (20.190475dp)\n" + - "\thotseatBarSidePaddingStartPx: 0.0px (0.0dp)\n" + - "\thotseatBarSidePaddingEndPx: 0.0px (0.0dp)\n" + - "\thotseatBarEndOffset: 0.0px (0.0dp)\n" + - "\thotseatQsbSpace: 74.0px (28.190475dp)\n" + - "\thotseatQsbHeight: 165.0px (62.857143dp)\n" + - "\tspringLoadedHotseatBarTopMarginPx: 116.0px (44.190475dp)\n" + - "\tgetHotseatLayoutPadding(context).top: 197.0px (75.04762dp)\n" + - "\tgetHotseatLayoutPadding(context).bottom: 43.0px (16.380953dp)\n" + - "\tgetHotseatLayoutPadding(context).left: 370.0px (140.95238dp)\n" + - "\tgetHotseatLayoutPadding(context).right: 370.0px (140.95238dp)\n" + - "\tnumShownHotseatIcons: 6\n" + - "\thotseatBorderSpace: 105.0px (40.0dp)\n" + - "\tisQsbInline: false\n" + - "\thotseatQsbWidth: 1467.0px (558.8571dp)\n" + - "\tisTaskbarPresent:true\n" + - "\tisTaskbarPresentInApps:true\n" + - "\ttaskbarSize: 158.0px (60.190475dp)\n" + - "\tdesiredWorkspaceHorizontalMarginPx: 79.0px (30.095238dp)\n" + - "\tworkspacePadding.left: 53.0px (20.190475dp)\n" + - "\tworkspacePadding.top: 0.0px (0.0dp)\n" + - "\tworkspacePadding.right: 53.0px (20.190475dp)\n" + - "\tworkspacePadding.bottom: 461.0px (175.61905dp)\n" + - "\ticonScale: 0.99864316px (0.3804355dp)\n" + - "\tcellScaleToFit : 0.99864316px (0.3804355dp)\n" + - "\textraSpace: 57.0px (21.714285dp)\n" + - "\tunscaled extraSpace: 57.077446px (21.74379dp)\n" + - "\tmaxEmptySpace: 131.0px (49.904762dp)\n" + - "\tworkspaceTopPadding: 18.0px (6.857143dp)\n" + - "\tworkspaceBottomPadding: 39.0px (14.857142dp)\n" + - "\toverviewTaskMarginPx: 32.0px (12.190476dp)\n" + - "\toverviewTaskIconSizePx: 126.0px (48.0dp)\n" + - "\toverviewTaskIconDrawableSizePx: 116.0px (44.190475dp)\n" + - "\toverviewTaskIconDrawableSizeGridPx: 116.0px (44.190475dp)\n" + - "\toverviewTaskThumbnailTopMarginPx: 158.0px (60.190475dp)\n" + - "\toverviewActionsTopMarginPx: 32.0px (12.190476dp)\n" + - "\toverviewActionsHeight: 126.0px (48.0dp)\n" + - "\toverviewActionsButtonSpacing: 95.0px (36.190475dp)\n" + - "\toverviewPageSpacing: 95.0px (36.190475dp)\n" + - "\toverviewRowSpacing: 74.0px (28.190475dp)\n" + - "\toverviewGridSideMargin: 168.0px (64.0dp)\n" + - "\tdropTargetBarTopMarginPx: 0.0px (0.0dp)\n" + - "\tdropTargetBarSizePx: 147.0px (56.0dp)\n" + - "\tdropTargetBarBottomMarginPx: 42.0px (16.0dp)\n" + - "\tgetCellLayoutSpringLoadShrunkTop(): 299.0px (113.90476dp)\n" + - "\tgetCellLayoutSpringLoadShrunkBottom(): 1307.0px (497.90475dp)\n" + - "\tworkspaceSpringLoadedMinNextPageVisiblePx: 63.0px (24.0dp)\n" + - "\tgetWorkspaceSpringLoadScale(): 0.79432625px (0.30260047dp)\n" + - "\tgetCellLayoutHeight(): 1269.0px (483.42856dp)\n" + - "\tgetCellLayoutWidth(): 1051.0px (400.38095dp)\n") - } - - @Test - fun twoPanelPortrait3Button() { - initializeVarsForTwoPanel(isGestureMode = false) - val dp = newDP() - dp.isTaskbarPresentInApps = true - - assertThat(dump(dp)).isEqualTo("DeviceProfile:\n" + - "\t1 dp = 2.625 px\n" + - "\tisTablet:true\n" + - "\tisPhone:false\n" + - "\ttransposeLayoutWithOrientation:false\n" + - "\tisGestureMode:false\n" + - "\tisLandscape:false\n" + - "\tisMultiWindowMode:false\n" + - "\tisTwoPanels:true\n" + - "\twindowX: 0.0px (0.0dp)\n" + - "\twindowY: 0.0px (0.0dp)\n" + - "\twidthPx: 1840.0px (700.9524dp)\n" + - "\theightPx: 2208.0px (841.1429dp)\n" + - "\tavailableWidthPx: 1840.0px (700.9524dp)\n" + - "\tavailableHeightPx: 2098.0px (799.2381dp)\n" + - "\tmInsets.left: 0.0px (0.0dp)\n" + - "\tmInsets.top: 110.0px (41.904762dp)\n" + - "\tmInsets.right: 0.0px (0.0dp)\n" + - "\tmInsets.bottom: 0.0px (0.0dp)\n" + - "\taspectRatio:1.2\n" + - "\tisScalableGrid:true\n" + - "\tinv.numRows: 4\n" + - "\tinv.numColumns: 4\n" + - "\tinv.numSearchContainerColumns: 4\n" + - "\tminCellSize: PointF(68.0, 116.0)dp\n" + - "\tcellWidthPx: 178.0px (67.809525dp)\n" + - "\tcellHeightPx: 304.0px (115.809525dp)\n" + - "\tgetCellSize().x: 178.0px (67.809525dp)\n" + - "\tgetCellSize().y: 304.0px (115.809525dp)\n" + - "\tcellLayoutBorderSpacePx Horizontal: 42.0px (16.0dp)\n" + - "\tcellLayoutBorderSpacePx Vertical: 52.0px (19.809525dp)\n" + - "\tcellLayoutPaddingPx.left: 21.0px (8.0dp)\n" + - "\tcellLayoutPaddingPx.top: 21.0px (8.0dp)\n" + - "\tcellLayoutPaddingPx.right: 21.0px (8.0dp)\n" + - "\tcellLayoutPaddingPx.bottom: 21.0px (8.0dp)\n" + - "\ticonSizePx: 136.0px (51.809525dp)\n" + - "\ticonTextSizePx: 31.0px (11.809524dp)\n" + - "\ticonDrawablePaddingPx: 17.0px (6.4761906dp)\n" + - "\tfolderCellWidthPx: 210.0px (80.0dp)\n" + - "\tfolderCellHeightPx: 247.0px (94.09524dp)\n" + - "\tfolderChildIconSizePx: 158.0px (60.190475dp)\n" + - "\tfolderChildTextSizePx: 37.0px (14.095238dp)\n" + - "\tfolderChildDrawablePaddingPx: 13.0px (4.952381dp)\n" + - "\tfolderCellLayoutBorderSpacePx Horizontal: 42.0px (16.0dp)\n" + - "\tfolderCellLayoutBorderSpacePx Vertical: 42.0px (16.0dp)\n" + - "\tfolderContentPaddingLeftRight: 42.0px (16.0dp)\n" + - "\tfolderTopPadding: 63.0px (24.0dp)\n" + - "\tbottomSheetTopPadding: 110.0px (41.904762dp)\n" + - "\tallAppsShiftRange: 2098.0px (799.2381dp)\n" + - "\tallAppsTopPadding: 110.0px (41.904762dp)\n" + - "\tallAppsIconSizePx: 136.0px (51.809525dp)\n" + - "\tallAppsIconTextSizePx: 31.0px (11.809524dp)\n" + - "\tallAppsIconDrawablePaddingPx: 18.0px (6.857143dp)\n" + - "\tallAppsCellHeightPx: 345.0px (131.42857dp)\n" + - "\tallAppsCellWidthPx: 178.0px (67.809525dp)\n" + - "\tallAppsBorderSpacePxX: 42.0px (16.0dp)\n" + - "\tallAppsBorderSpacePxY: 73.0px (27.809525dp)\n" + - "\tnumShownAllAppsColumns: 6\n" + - "\tallAppsLeftRightPadding: 126.0px (48.0dp)\n" + - "\tallAppsLeftRightMargin: 155.0px (59.04762dp)\n" + - "\thotseatBarSizePx: 459.0px (174.85715dp)\n" + - "\tinv.hotseatColumnSpan: 6\n" + - "\thotseatCellHeightPx: 153.0px (58.285713dp)\n" + - "\thotseatBarBottomSpacePx: 95.0px (36.190475dp)\n" + - "\thotseatBarSidePaddingStartPx: 0.0px (0.0dp)\n" + - "\thotseatBarSidePaddingEndPx: 0.0px (0.0dp)\n" + - "\thotseatBarEndOffset: 660.0px (251.42857dp)\n" + - "\thotseatQsbSpace: 95.0px (36.190475dp)\n" + - "\thotseatQsbHeight: 165.0px (62.857143dp)\n" + - "\tspringLoadedHotseatBarTopMarginPx: 171.0px (65.14286dp)\n" + - "\tgetHotseatLayoutPadding(context).top: 219.0px (83.42857dp)\n" + - "\tgetHotseatLayoutPadding(context).bottom: 87.0px (33.142857dp)\n" + - "\tgetHotseatLayoutPadding(context).left: 78.0px (29.714285dp)\n" + - "\tgetHotseatLayoutPadding(context).right: 660.0px (251.42857dp)\n" + - "\tnumShownHotseatIcons: 6\n" + - "\thotseatBorderSpace: 57.0px (21.714285dp)\n" + - "\tisQsbInline: false\n" + - "\thotseatQsbWidth: 1236.0px (470.85715dp)\n" + - "\tisTaskbarPresent:true\n" + - "\tisTaskbarPresentInApps:true\n" + - "\ttaskbarSize: 158.0px (60.190475dp)\n" + - "\tdesiredWorkspaceHorizontalMarginPx: 58.0px (22.095238dp)\n" + - "\tworkspacePadding.left: 37.0px (14.095238dp)\n" + - "\tworkspacePadding.top: 68.0px (25.904762dp)\n" + - "\tworkspacePadding.right: 37.0px (14.095238dp)\n" + - "\tworkspacePadding.bottom: 615.0px (234.28572dp)\n" + - "\ticonScale: 0.9978308px (0.38012603dp)\n" + - "\tcellScaleToFit : 0.9978308px (0.38012603dp)\n" + - "\textraSpace: 235.0px (89.52381dp)\n" + - "\tunscaled extraSpace: 235.51086px (89.71842dp)\n" + - "\tmaxEmptySpace: 236.0px (89.90476dp)\n" + - "\tworkspaceTopPadding: 89.0px (33.904762dp)\n" + - "\tworkspaceBottomPadding: 146.0px (55.61905dp)\n" + - "\toverviewTaskMarginPx: 32.0px (12.190476dp)\n" + - "\toverviewTaskIconSizePx: 126.0px (48.0dp)\n" + - "\toverviewTaskIconDrawableSizePx: 116.0px (44.190475dp)\n" + - "\toverviewTaskIconDrawableSizeGridPx: 116.0px (44.190475dp)\n" + - "\toverviewTaskThumbnailTopMarginPx: 158.0px (60.190475dp)\n" + - "\toverviewActionsTopMarginPx: 63.0px (24.0dp)\n" + - "\toverviewActionsHeight: 126.0px (48.0dp)\n" + - "\toverviewActionsButtonSpacing: 95.0px (36.190475dp)\n" + - "\toverviewPageSpacing: 95.0px (36.190475dp)\n" + - "\toverviewRowSpacing: 74.0px (28.190475dp)\n" + - "\toverviewGridSideMargin: 168.0px (64.0dp)\n" + - "\tdropTargetBarTopMarginPx: 168.0px (64.0dp)\n" + - "\tdropTargetBarSizePx: 147.0px (56.0dp)\n" + - "\tdropTargetBarBottomMarginPx: 42.0px (16.0dp)\n" + - "\tgetCellLayoutSpringLoadShrunkTop(): 467.0px (177.90475dp)\n" + - "\tgetCellLayoutSpringLoadShrunkBottom(): 1578.0px (601.1429dp)\n" + - "\tworkspaceSpringLoadedMinNextPageVisiblePx: 63.0px (24.0dp)\n" + - "\tgetWorkspaceSpringLoadScale(): 0.785159px (0.29910818dp)\n" + - "\tgetCellLayoutHeight(): 1415.0px (539.0476dp)\n" + - "\tgetCellLayoutWidth(): 883.0px (336.38095dp)\n") - } - - @Test - fun twoPanelPortrait() { - initializeVarsForTwoPanel() - val dp = newDP() - dp.isTaskbarPresentInApps = true - - assertThat(dump(dp)).isEqualTo("DeviceProfile:\n" + - "\t1 dp = 2.625 px\n" + - "\tisTablet:true\n" + - "\tisPhone:false\n" + - "\ttransposeLayoutWithOrientation:false\n" + - "\tisGestureMode:true\n" + - "\tisLandscape:false\n" + - "\tisMultiWindowMode:false\n" + - "\tisTwoPanels:true\n" + - "\twindowX: 0.0px (0.0dp)\n" + - "\twindowY: 0.0px (0.0dp)\n" + - "\twidthPx: 1840.0px (700.9524dp)\n" + - "\theightPx: 2208.0px (841.1429dp)\n" + - "\tavailableWidthPx: 1840.0px (700.9524dp)\n" + - "\tavailableHeightPx: 2098.0px (799.2381dp)\n" + - "\tmInsets.left: 0.0px (0.0dp)\n" + - "\tmInsets.top: 110.0px (41.904762dp)\n" + - "\tmInsets.right: 0.0px (0.0dp)\n" + - "\tmInsets.bottom: 0.0px (0.0dp)\n" + - "\taspectRatio:1.2\n" + - "\tisScalableGrid:true\n" + - "\tinv.numRows: 4\n" + - "\tinv.numColumns: 4\n" + - "\tinv.numSearchContainerColumns: 4\n" + - "\tminCellSize: PointF(68.0, 116.0)dp\n" + - "\tcellWidthPx: 178.0px (67.809525dp)\n" + - "\tcellHeightPx: 304.0px (115.809525dp)\n" + - "\tgetCellSize().x: 178.0px (67.809525dp)\n" + - "\tgetCellSize().y: 304.0px (115.809525dp)\n" + - "\tcellLayoutBorderSpacePx Horizontal: 42.0px (16.0dp)\n" + - "\tcellLayoutBorderSpacePx Vertical: 52.0px (19.809525dp)\n" + - "\tcellLayoutPaddingPx.left: 21.0px (8.0dp)\n" + - "\tcellLayoutPaddingPx.top: 21.0px (8.0dp)\n" + - "\tcellLayoutPaddingPx.right: 21.0px (8.0dp)\n" + - "\tcellLayoutPaddingPx.bottom: 21.0px (8.0dp)\n" + - "\ticonSizePx: 136.0px (51.809525dp)\n" + - "\ticonTextSizePx: 31.0px (11.809524dp)\n" + - "\ticonDrawablePaddingPx: 17.0px (6.4761906dp)\n" + - "\tfolderCellWidthPx: 210.0px (80.0dp)\n" + - "\tfolderCellHeightPx: 247.0px (94.09524dp)\n" + - "\tfolderChildIconSizePx: 158.0px (60.190475dp)\n" + - "\tfolderChildTextSizePx: 37.0px (14.095238dp)\n" + - "\tfolderChildDrawablePaddingPx: 13.0px (4.952381dp)\n" + - "\tfolderCellLayoutBorderSpacePx Horizontal: 42.0px (16.0dp)\n" + - "\tfolderCellLayoutBorderSpacePx Vertical: 42.0px (16.0dp)\n" + - "\tfolderContentPaddingLeftRight: 42.0px (16.0dp)\n" + - "\tfolderTopPadding: 63.0px (24.0dp)\n" + - "\tbottomSheetTopPadding: 110.0px (41.904762dp)\n" + - "\tallAppsShiftRange: 2098.0px (799.2381dp)\n" + - "\tallAppsTopPadding: 110.0px (41.904762dp)\n" + - "\tallAppsIconSizePx: 136.0px (51.809525dp)\n" + - "\tallAppsIconTextSizePx: 31.0px (11.809524dp)\n" + - "\tallAppsIconDrawablePaddingPx: 18.0px (6.857143dp)\n" + - "\tallAppsCellHeightPx: 345.0px (131.42857dp)\n" + - "\tallAppsCellWidthPx: 178.0px (67.809525dp)\n" + - "\tallAppsBorderSpacePxX: 42.0px (16.0dp)\n" + - "\tallAppsBorderSpacePxY: 73.0px (27.809525dp)\n" + - "\tnumShownAllAppsColumns: 6\n" + - "\tallAppsLeftRightPadding: 126.0px (48.0dp)\n" + - "\tallAppsLeftRightMargin: 155.0px (59.04762dp)\n" + - "\thotseatBarSizePx: 459.0px (174.85715dp)\n" + - "\tinv.hotseatColumnSpan: 6\n" + - "\thotseatCellHeightPx: 153.0px (58.285713dp)\n" + - "\thotseatBarBottomSpacePx: 95.0px (36.190475dp)\n" + - "\thotseatBarSidePaddingStartPx: 0.0px (0.0dp)\n" + - "\thotseatBarSidePaddingEndPx: 0.0px (0.0dp)\n" + - "\thotseatBarEndOffset: 0.0px (0.0dp)\n" + - "\thotseatQsbSpace: 95.0px (36.190475dp)\n" + - "\thotseatQsbHeight: 165.0px (62.857143dp)\n" + - "\tspringLoadedHotseatBarTopMarginPx: 171.0px (65.14286dp)\n" + - "\tgetHotseatLayoutPadding(context).top: 219.0px (83.42857dp)\n" + - "\tgetHotseatLayoutPadding(context).bottom: 87.0px (33.142857dp)\n" + - "\tgetHotseatLayoutPadding(context).left: 302.0px (115.04762dp)\n" + - "\tgetHotseatLayoutPadding(context).right: 302.0px (115.04762dp)\n" + - "\tnumShownHotseatIcons: 6\n" + - "\thotseatBorderSpace: 84.0px (32.0dp)\n" + - "\tisQsbInline: false\n" + - "\thotseatQsbWidth: 1236.0px (470.85715dp)\n" + - "\tisTaskbarPresent:true\n" + - "\tisTaskbarPresentInApps:true\n" + - "\ttaskbarSize: 158.0px (60.190475dp)\n" + - "\tdesiredWorkspaceHorizontalMarginPx: 58.0px (22.095238dp)\n" + - "\tworkspacePadding.left: 37.0px (14.095238dp)\n" + - "\tworkspacePadding.top: 68.0px (25.904762dp)\n" + - "\tworkspacePadding.right: 37.0px (14.095238dp)\n" + - "\tworkspacePadding.bottom: 615.0px (234.28572dp)\n" + - "\ticonScale: 0.9978308px (0.38012603dp)\n" + - "\tcellScaleToFit : 0.9978308px (0.38012603dp)\n" + - "\textraSpace: 235.0px (89.52381dp)\n" + - "\tunscaled extraSpace: 235.51086px (89.71842dp)\n" + - "\tmaxEmptySpace: 236.0px (89.90476dp)\n" + - "\tworkspaceTopPadding: 89.0px (33.904762dp)\n" + - "\tworkspaceBottomPadding: 146.0px (55.61905dp)\n" + - "\toverviewTaskMarginPx: 32.0px (12.190476dp)\n" + - "\toverviewTaskIconSizePx: 126.0px (48.0dp)\n" + - "\toverviewTaskIconDrawableSizePx: 116.0px (44.190475dp)\n" + - "\toverviewTaskIconDrawableSizeGridPx: 116.0px (44.190475dp)\n" + - "\toverviewTaskThumbnailTopMarginPx: 158.0px (60.190475dp)\n" + - "\toverviewActionsTopMarginPx: 63.0px (24.0dp)\n" + - "\toverviewActionsHeight: 126.0px (48.0dp)\n" + - "\toverviewActionsButtonSpacing: 95.0px (36.190475dp)\n" + - "\toverviewPageSpacing: 95.0px (36.190475dp)\n" + - "\toverviewRowSpacing: 74.0px (28.190475dp)\n" + - "\toverviewGridSideMargin: 168.0px (64.0dp)\n" + - "\tdropTargetBarTopMarginPx: 168.0px (64.0dp)\n" + - "\tdropTargetBarSizePx: 147.0px (56.0dp)\n" + - "\tdropTargetBarBottomMarginPx: 42.0px (16.0dp)\n" + - "\tgetCellLayoutSpringLoadShrunkTop(): 467.0px (177.90475dp)\n" + - "\tgetCellLayoutSpringLoadShrunkBottom(): 1578.0px (601.1429dp)\n" + - "\tworkspaceSpringLoadedMinNextPageVisiblePx: 63.0px (24.0dp)\n" + - "\tgetWorkspaceSpringLoadScale(): 0.785159px (0.29910818dp)\n" + - "\tgetCellLayoutHeight(): 1415.0px (539.0476dp)\n" + - "\tgetCellLayoutWidth(): 883.0px (336.38095dp)\n") - } - - @Test - fun phoneVerticalBar3Button() { - initializeVarsForPhone(isVerticalBar = true, isGestureMode = false) - val dp = newDP() - - assertThat(dump(dp)).isEqualTo("DeviceProfile:\n" + - "\t1 dp = 2.625 px\n" + - "\tisTablet:false\n" + - "\tisPhone:true\n" + - "\ttransposeLayoutWithOrientation:true\n" + - "\tisGestureMode:false\n" + - "\tisLandscape:true\n" + - "\tisMultiWindowMode:false\n" + - "\tisTwoPanels:false\n" + - "\twindowX: 0.0px (0.0dp)\n" + - "\twindowY: 0.0px (0.0dp)\n" + - "\twidthPx: 2400.0px (914.2857dp)\n" + - "\theightPx: 1080.0px (411.42856dp)\n" + - "\tavailableWidthPx: 2156.0px (821.3333dp)\n" + - "\tavailableHeightPx: 1006.0px (383.2381dp)\n" + - "\tmInsets.left: 118.0px (44.95238dp)\n" + - "\tmInsets.top: 74.0px (28.190475dp)\n" + - "\tmInsets.right: 126.0px (48.0dp)\n" + - "\tmInsets.bottom: 0.0px (0.0dp)\n" + - "\taspectRatio:2.2222223\n" + - "\tisScalableGrid:false\n" + - "\tinv.numRows: 5\n" + - "\tinv.numColumns: 4\n" + - "\tinv.numSearchContainerColumns: 4\n" + - "\tminCellSize: PointF(80.0, 104.0)dp\n" + - "\tcellWidthPx: 153.0px (58.285713dp)\n" + - "\tcellHeightPx: 160.0px (60.95238dp)\n" + - "\tgetCellSize().x: 461.0px (175.61905dp)\n" + - "\tgetCellSize().y: 193.0px (73.52381dp)\n" + - "\tcellLayoutBorderSpacePx Horizontal: 0.0px (0.0dp)\n" + - "\tcellLayoutBorderSpacePx Vertical: 0.0px (0.0dp)\n" + - "\tcellLayoutPaddingPx.left: 53.0px (20.190475dp)\n" + - "\tcellLayoutPaddingPx.top: 0.0px (0.0dp)\n" + - "\tcellLayoutPaddingPx.right: 53.0px (20.190475dp)\n" + - "\tcellLayoutPaddingPx.bottom: 40.0px (15.238095dp)\n" + - "\ticonSizePx: 142.0px (54.095238dp)\n" + - "\ticonTextSizePx: 0.0px (0.0dp)\n" + - "\ticonDrawablePaddingPx: 0.0px (0.0dp)\n" + - "\tfolderCellWidthPx: 175.0px (66.666664dp)\n" + - "\tfolderCellHeightPx: 205.0px (78.09524dp)\n" + - "\tfolderChildIconSizePx: 131.0px (49.904762dp)\n" + - "\tfolderChildTextSizePx: 34.0px (12.952381dp)\n" + - "\tfolderChildDrawablePaddingPx: 9.0px (3.4285715dp)\n" + - "\tfolderCellLayoutBorderSpacePx Horizontal: 42.0px (16.0dp)\n" + - "\tfolderCellLayoutBorderSpacePx Vertical: 42.0px (16.0dp)\n" + - "\tfolderContentPaddingLeftRight: 21.0px (8.0dp)\n" + - "\tfolderTopPadding: 42.0px (16.0dp)\n" + - "\tbottomSheetTopPadding: 114.0px (43.42857dp)\n" + - "\tallAppsShiftRange: 788.0px (300.1905dp)\n" + - "\tallAppsTopPadding: 0.0px (0.0dp)\n" + - "\tallAppsIconSizePx: 158.0px (60.190475dp)\n" + - "\tallAppsIconTextSizePx: 37.0px (14.095238dp)\n" + - "\tallAppsIconDrawablePaddingPx: 21.0px (8.0dp)\n" + - "\tallAppsCellHeightPx: 329.0px (125.333336dp)\n" + - "\tallAppsCellWidthPx: 200.0px (76.190475dp)\n" + - "\tallAppsBorderSpacePxX: 42.0px (16.0dp)\n" + - "\tallAppsBorderSpacePxY: 42.0px (16.0dp)\n" + - "\tnumShownAllAppsColumns: 4\n" + - "\tallAppsLeftRightPadding: 0.0px (0.0dp)\n" + - "\tallAppsLeftRightMargin: 0.0px (0.0dp)\n" + - "\thotseatBarSizePx: 247.0px (94.09524dp)\n" + - "\tinv.hotseatColumnSpan: 4\n" + - "\thotseatCellHeightPx: 160.0px (60.95238dp)\n" + - "\thotseatBarBottomSpacePx: 126.0px (48.0dp)\n" + - "\thotseatBarSidePaddingStartPx: 63.0px (24.0dp)\n" + - "\thotseatBarSidePaddingEndPx: 42.0px (16.0dp)\n" + - "\thotseatBarEndOffset: 0.0px (0.0dp)\n" + - "\thotseatQsbSpace: 95.0px (36.190475dp)\n" + - "\thotseatQsbHeight: 165.0px (62.857143dp)\n" + - "\tspringLoadedHotseatBarTopMarginPx: 118.0px (44.95238dp)\n" + - "\tgetHotseatLayoutPadding(context).top: 65.0px (24.761906dp)\n" + - "\tgetHotseatLayoutPadding(context).bottom: 48.0px (18.285715dp)\n" + - "\tgetHotseatLayoutPadding(context).left: 42.0px (16.0dp)\n" + - "\tgetHotseatLayoutPadding(context).right: 189.0px (72.0dp)\n" + - "\tnumShownHotseatIcons: 4\n" + - "\thotseatBorderSpace: 0.0px (0.0dp)\n" + - "\tisQsbInline: false\n" + - "\thotseatQsbWidth: 1525.0px (580.9524dp)\n" + - "\tisTaskbarPresent:false\n" + - "\tisTaskbarPresentInApps:false\n" + - "\ttaskbarSize: 0.0px (0.0dp)\n" + - "\tdesiredWorkspaceHorizontalMarginPx: 0.0px (0.0dp)\n" + - "\tworkspacePadding.left: 10.0px (3.8095238dp)\n" + - "\tworkspacePadding.top: 0.0px (0.0dp)\n" + - "\tworkspacePadding.right: 194.0px (73.90476dp)\n" + - "\tworkspacePadding.bottom: 0.0px (0.0dp)\n" + - "\ticonScale: 1.0px (0.3809524dp)\n" + - "\tcellScaleToFit : 1.0px (0.3809524dp)\n" + - "\textraSpace: 166.0px (63.238094dp)\n" + - "\tunscaled extraSpace: 166.0px (63.238094dp)\n" + - "\tmaxEmptySpace: 184.0px (70.09524dp)\n" + - "\tworkspaceTopPadding: 0.0px (0.0dp)\n" + - "\tworkspaceBottomPadding: 0.0px (0.0dp)\n" + - "\toverviewTaskMarginPx: 42.0px (16.0dp)\n" + - "\toverviewTaskIconSizePx: 126.0px (48.0dp)\n" + - "\toverviewTaskIconDrawableSizePx: 116.0px (44.190475dp)\n" + - "\toverviewTaskIconDrawableSizeGridPx: 0.0px (0.0dp)\n" + - "\toverviewTaskThumbnailTopMarginPx: 168.0px (64.0dp)\n" + - "\toverviewActionsTopMarginPx: 32.0px (12.190476dp)\n" + - "\toverviewActionsHeight: 126.0px (48.0dp)\n" + - "\toverviewActionsButtonSpacing: 95.0px (36.190475dp)\n" + - "\toverviewPageSpacing: 42.0px (16.0dp)\n" + - "\toverviewRowSpacing: 0.0px (0.0dp)\n" + - "\toverviewGridSideMargin: 0.0px (0.0dp)\n" + - "\tdropTargetBarTopMarginPx: 16.0px (6.095238dp)\n" + - "\tdropTargetBarSizePx: 95.0px (36.190475dp)\n" + - "\tdropTargetBarBottomMarginPx: 16.0px (6.095238dp)\n" + - "\tgetCellLayoutSpringLoadShrunkTop(): 201.0px (76.57143dp)\n" + - "\tgetCellLayoutSpringLoadShrunkBottom(): 983.0px (374.4762dp)\n" + - "\tworkspaceSpringLoadedMinNextPageVisiblePx: 63.0px (24.0dp)\n" + - "\tgetWorkspaceSpringLoadScale(): 0.777336px (0.296128dp)\n" + - "\tgetCellLayoutHeight(): 1006.0px (383.2381dp)\n" + - "\tgetCellLayoutWidth(): 1952.0px (743.619dp)\n") - } - - @Test - fun phoneVerticalBar() { - initializeVarsForPhone(isVerticalBar = true) - val dp = newDP() - - assertThat(dump(dp)).isEqualTo("DeviceProfile:\n" + - "\t1 dp = 2.625 px\n" + - "\tisTablet:false\n" + - "\tisPhone:true\n" + - "\ttransposeLayoutWithOrientation:true\n" + - "\tisGestureMode:true\n" + - "\tisLandscape:true\n" + - "\tisMultiWindowMode:false\n" + - "\tisTwoPanels:false\n" + - "\twindowX: 0.0px (0.0dp)\n" + - "\twindowY: 0.0px (0.0dp)\n" + - "\twidthPx: 2400.0px (914.2857dp)\n" + - "\theightPx: 1080.0px (411.42856dp)\n" + - "\tavailableWidthPx: 2282.0px (869.3333dp)\n" + - "\tavailableHeightPx: 943.0px (359.2381dp)\n" + - "\tmInsets.left: 118.0px (44.95238dp)\n" + - "\tmInsets.top: 74.0px (28.190475dp)\n" + - "\tmInsets.right: 0.0px (0.0dp)\n" + - "\tmInsets.bottom: 63.0px (24.0dp)\n" + - "\taspectRatio:2.2222223\n" + - "\tisScalableGrid:false\n" + - "\tinv.numRows: 5\n" + - "\tinv.numColumns: 4\n" + - "\tinv.numSearchContainerColumns: 4\n" + - "\tminCellSize: PointF(80.0, 104.0)dp\n" + - "\tcellWidthPx: 153.0px (58.285713dp)\n" + - "\tcellHeightPx: 160.0px (60.95238dp)\n" + - "\tgetCellSize().x: 493.0px (187.80952dp)\n" + - "\tgetCellSize().y: 180.0px (68.57143dp)\n" + - "\tcellLayoutBorderSpacePx Horizontal: 0.0px (0.0dp)\n" + - "\tcellLayoutBorderSpacePx Vertical: 0.0px (0.0dp)\n" + - "\tcellLayoutPaddingPx.left: 53.0px (20.190475dp)\n" + - "\tcellLayoutPaddingPx.top: 0.0px (0.0dp)\n" + - "\tcellLayoutPaddingPx.right: 53.0px (20.190475dp)\n" + - "\tcellLayoutPaddingPx.bottom: 40.0px (15.238095dp)\n" + - "\ticonSizePx: 142.0px (54.095238dp)\n" + - "\ticonTextSizePx: 0.0px (0.0dp)\n" + - "\ticonDrawablePaddingPx: 0.0px (0.0dp)\n" + - "\tfolderCellWidthPx: 159.0px (60.57143dp)\n" + - "\tfolderCellHeightPx: 187.0px (71.2381dp)\n" + - "\tfolderChildIconSizePx: 119.0px (45.333332dp)\n" + - "\tfolderChildTextSizePx: 31.0px (11.809524dp)\n" + - "\tfolderChildDrawablePaddingPx: 8.0px (3.047619dp)\n" + - "\tfolderCellLayoutBorderSpacePx Horizontal: 42.0px (16.0dp)\n" + - "\tfolderCellLayoutBorderSpacePx Vertical: 42.0px (16.0dp)\n" + - "\tfolderContentPaddingLeftRight: 21.0px (8.0dp)\n" + - "\tfolderTopPadding: 42.0px (16.0dp)\n" + - "\tbottomSheetTopPadding: 114.0px (43.42857dp)\n" + - "\tallAppsShiftRange: 788.0px (300.1905dp)\n" + - "\tallAppsTopPadding: 0.0px (0.0dp)\n" + - "\tallAppsIconSizePx: 158.0px (60.190475dp)\n" + - "\tallAppsIconTextSizePx: 37.0px (14.095238dp)\n" + - "\tallAppsIconDrawablePaddingPx: 21.0px (8.0dp)\n" + - "\tallAppsCellHeightPx: 329.0px (125.333336dp)\n" + - "\tallAppsCellWidthPx: 200.0px (76.190475dp)\n" + - "\tallAppsBorderSpacePxX: 42.0px (16.0dp)\n" + - "\tallAppsBorderSpacePxY: 42.0px (16.0dp)\n" + - "\tnumShownAllAppsColumns: 4\n" + - "\tallAppsLeftRightPadding: 0.0px (0.0dp)\n" + - "\tallAppsLeftRightMargin: 0.0px (0.0dp)\n" + - "\thotseatBarSizePx: 247.0px (94.09524dp)\n" + - "\tinv.hotseatColumnSpan: 4\n" + - "\thotseatCellHeightPx: 160.0px (60.95238dp)\n" + - "\thotseatBarBottomSpacePx: 126.0px (48.0dp)\n" + - "\thotseatBarSidePaddingStartPx: 63.0px (24.0dp)\n" + - "\thotseatBarSidePaddingEndPx: 42.0px (16.0dp)\n" + - "\thotseatBarEndOffset: 0.0px (0.0dp)\n" + - "\thotseatQsbSpace: 95.0px (36.190475dp)\n" + - "\thotseatQsbHeight: 165.0px (62.857143dp)\n" + - "\tspringLoadedHotseatBarTopMarginPx: 118.0px (44.95238dp)\n" + - "\tgetHotseatLayoutPadding(context).top: 65.0px (24.761906dp)\n" + - "\tgetHotseatLayoutPadding(context).bottom: 111.0px (42.285713dp)\n" + - "\tgetHotseatLayoutPadding(context).left: 42.0px (16.0dp)\n" + - "\tgetHotseatLayoutPadding(context).right: 63.0px (24.0dp)\n" + - "\tnumShownHotseatIcons: 4\n" + - "\thotseatBorderSpace: 0.0px (0.0dp)\n" + - "\tisQsbInline: false\n" + - "\thotseatQsbWidth: 1621.0px (617.5238dp)\n" + - "\tisTaskbarPresent:false\n" + - "\tisTaskbarPresentInApps:false\n" + - "\ttaskbarSize: 0.0px (0.0dp)\n" + - "\tdesiredWorkspaceHorizontalMarginPx: 0.0px (0.0dp)\n" + - "\tworkspacePadding.left: 10.0px (3.8095238dp)\n" + - "\tworkspacePadding.top: 0.0px (0.0dp)\n" + - "\tworkspacePadding.right: 194.0px (73.90476dp)\n" + - "\tworkspacePadding.bottom: 0.0px (0.0dp)\n" + - "\ticonScale: 1.0px (0.3809524dp)\n" + - "\tcellScaleToFit : 1.0px (0.3809524dp)\n" + - "\textraSpace: 103.0px (39.238094dp)\n" + - "\tunscaled extraSpace: 103.0px (39.238094dp)\n" + - "\tmaxEmptySpace: 131.0px (49.904762dp)\n" + - "\tworkspaceTopPadding: 0.0px (0.0dp)\n" + - "\tworkspaceBottomPadding: 0.0px (0.0dp)\n" + - "\toverviewTaskMarginPx: 42.0px (16.0dp)\n" + - "\toverviewTaskIconSizePx: 126.0px (48.0dp)\n" + - "\toverviewTaskIconDrawableSizePx: 116.0px (44.190475dp)\n" + - "\toverviewTaskIconDrawableSizeGridPx: 0.0px (0.0dp)\n" + - "\toverviewTaskThumbnailTopMarginPx: 168.0px (64.0dp)\n" + - "\toverviewActionsTopMarginPx: 32.0px (12.190476dp)\n" + - "\toverviewActionsHeight: 126.0px (48.0dp)\n" + - "\toverviewActionsButtonSpacing: 95.0px (36.190475dp)\n" + - "\toverviewPageSpacing: 42.0px (16.0dp)\n" + - "\toverviewRowSpacing: 0.0px (0.0dp)\n" + - "\toverviewGridSideMargin: 0.0px (0.0dp)\n" + - "\tdropTargetBarTopMarginPx: 16.0px (6.095238dp)\n" + - "\tdropTargetBarSizePx: 95.0px (36.190475dp)\n" + - "\tdropTargetBarBottomMarginPx: 16.0px (6.095238dp)\n" + - "\tgetCellLayoutSpringLoadShrunkTop(): 201.0px (76.57143dp)\n" + - "\tgetCellLayoutSpringLoadShrunkBottom(): 927.0px (353.14285dp)\n" + - "\tworkspaceSpringLoadedMinNextPageVisiblePx: 63.0px (24.0dp)\n" + - "\tgetWorkspaceSpringLoadScale(): 0.76988333px (0.2932889dp)\n" + - "\tgetCellLayoutHeight(): 943.0px (359.2381dp)\n" + - "\tgetCellLayoutWidth(): 2078.0px (791.619dp)\n") - } -} \ No newline at end of file diff --git a/quickstep/tests/src/com/android/quickstep/OrientationTouchTransformerTest.java b/quickstep/tests/src/com/android/quickstep/OrientationTouchTransformerTest.java index c822578f5d..9c240f08c7 100644 --- a/quickstep/tests/src/com/android/quickstep/OrientationTouchTransformerTest.java +++ b/quickstep/tests/src/com/android/quickstep/OrientationTouchTransformerTest.java @@ -19,7 +19,7 @@ package com.android.quickstep; import static androidx.test.core.app.ApplicationProvider.getApplicationContext; -import static com.android.launcher3.util.DisplayController.NavigationMode.NO_BUTTON; +import static com.android.launcher3.util.NavigationMode.NO_BUTTON; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; diff --git a/quickstep/tests/src/com/android/quickstep/util/TaskViewSimulatorTest.java b/quickstep/tests/src/com/android/quickstep/util/TaskViewSimulatorTest.java index d43aafa162..190b002d09 100644 --- a/quickstep/tests/src/com/android/quickstep/util/TaskViewSimulatorTest.java +++ b/quickstep/tests/src/com/android/quickstep/util/TaskViewSimulatorTest.java @@ -34,6 +34,7 @@ import com.android.launcher3.InvariantDeviceProfile; import com.android.launcher3.util.DisplayController; import com.android.launcher3.util.DisplayController.Info; import com.android.launcher3.util.LauncherModelHelper; +import com.android.launcher3.util.NavigationMode; import com.android.launcher3.util.ReflectionHelpers; import com.android.launcher3.util.RotationUtils; import com.android.launcher3.util.WindowBounds; @@ -164,6 +165,7 @@ public class TaskViewSimulatorTest { WindowManagerProxy wmProxy = mock(WindowManagerProxy.class); doReturn(cdi).when(wmProxy).getDisplayInfo(any()); doReturn(wm).when(wmProxy).getRealBounds(any(), any()); + doReturn(NavigationMode.NO_BUTTON).when(wmProxy).getNavigationMode(any()); ArrayMap perDisplayBoundsCache = new ArrayMap<>(); diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java index 1febd68a17..0292e0402d 100644 --- a/src/com/android/launcher3/DeviceProfile.java +++ b/src/com/android/launcher3/DeviceProfile.java @@ -52,6 +52,7 @@ import com.android.launcher3.util.WindowBounds; import java.io.PrintWriter; import java.util.List; +import java.util.Locale; @SuppressLint("NewApi") public class DeviceProfile { @@ -1354,6 +1355,10 @@ public class DeviceProfile { return "\t" + name + ": " + value + "px (" + dpiFromPx(value, mMetrics.densityDpi) + "dp)"; } + private String dpPointFToString(String name, PointF value) { + return String.format(Locale.ENGLISH, "\t%s: PointF(%.1f, %.1f)dp", name, value.x, value.y); + } + /** Dumps various DeviceProfile variables to the specified writer. */ public void dump(Context context, String prefix, PrintWriter writer) { writer.println(prefix + "DeviceProfile:"); @@ -1389,7 +1394,7 @@ public class DeviceProfile { writer.println(prefix + "\tinv.numSearchContainerColumns: " + inv.numSearchContainerColumns); - writer.println(prefix + "\tminCellSize: " + inv.minCellSize[mTypeIndex] + "dp"); + writer.println(prefix + dpPointFToString("minCellSize", inv.minCellSize[mTypeIndex])); writer.println(prefix + pxToDpStr("cellWidthPx", cellWidthPx)); writer.println(prefix + pxToDpStr("cellHeightPx", cellHeightPx)); @@ -1669,7 +1674,7 @@ public class DeviceProfile { mTransposeLayoutWithOrientation = !mInfo.isTablet(mWindowBounds); } if (mIsGestureMode == null) { - mIsGestureMode = DisplayController.getNavigationMode(mContext).hasGestures; + mIsGestureMode = mInfo.navigationMode.hasGestures; } if (mDotRendererCache == null) { mDotRendererCache = new SparseArray<>(); diff --git a/src/com/android/launcher3/testing/shared/ResourceUtils.java b/src/com/android/launcher3/testing/shared/ResourceUtils.java index 551aeaf7b0..d0ae2581c7 100644 --- a/src/com/android/launcher3/testing/shared/ResourceUtils.java +++ b/src/com/android/launcher3/testing/shared/ResourceUtils.java @@ -36,6 +36,8 @@ public class ResourceUtils { public static final String STATUS_BAR_HEIGHT_LANDSCAPE = "status_bar_height_landscape"; public static final String STATUS_BAR_HEIGHT_PORTRAIT = "status_bar_height_portrait"; + public static final String NAV_BAR_INTERACTION_MODE_RES_NAME = "config_navBarInteractionMode"; + public static int getNavbarSize(String resName, Resources res) { return getDimenByName(resName, res, DEFAULT_NAVBAR_VALUE); } diff --git a/src/com/android/launcher3/touch/PortraitPagedViewHandler.java b/src/com/android/launcher3/touch/PortraitPagedViewHandler.java index dd9f64266e..07d183953b 100644 --- a/src/com/android/launcher3/touch/PortraitPagedViewHandler.java +++ b/src/com/android/launcher3/touch/PortraitPagedViewHandler.java @@ -27,7 +27,7 @@ import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT; import static com.android.launcher3.LauncherAnimUtils.VIEW_TRANSLATE_X; import static com.android.launcher3.LauncherAnimUtils.VIEW_TRANSLATE_Y; import static com.android.launcher3.touch.SingleAxisSwipeDetector.VERTICAL; -import static com.android.launcher3.util.DisplayController.NavigationMode.THREE_BUTTONS; +import static com.android.launcher3.util.NavigationMode.THREE_BUTTONS; import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_BOTTOM_OR_RIGHT; import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_TOP_OR_LEFT; diff --git a/src/com/android/launcher3/util/DisplayController.java b/src/com/android/launcher3/util/DisplayController.java index 94f9f25ceb..e57c88d98c 100644 --- a/src/com/android/launcher3/util/DisplayController.java +++ b/src/com/android/launcher3/util/DisplayController.java @@ -19,11 +19,7 @@ import static android.content.Intent.ACTION_CONFIGURATION_CHANGED; import static android.view.Display.DEFAULT_DISPLAY; import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION; -import static com.android.launcher3.testing.shared.ResourceUtils.INVALID_RESOURCE_HANDLE; import static com.android.launcher3.Utilities.dpiFromPx; -import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_NAVIGATION_MODE_2_BUTTON; -import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_NAVIGATION_MODE_3_BUTTON; -import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_NAVIGATION_MODE_GESTURE_BUTTON; import static com.android.launcher3.util.Executors.MAIN_EXECUTOR; import static com.android.launcher3.util.PackageManagerHelper.getPackageFilter; import static com.android.launcher3.util.window.WindowManagerProxy.MIN_TABLET_WIDTH; @@ -46,9 +42,7 @@ import android.view.Display; import androidx.annotation.AnyThread; import androidx.annotation.UiThread; -import com.android.launcher3.testing.shared.ResourceUtils; import com.android.launcher3.Utilities; -import com.android.launcher3.logging.StatsLogManager.LauncherEvent; import com.android.launcher3.util.window.CachedDisplayInfo; import com.android.launcher3.util.window.WindowManagerProxy; @@ -56,6 +50,7 @@ import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -81,7 +76,6 @@ public class DisplayController implements ComponentCallbacks, SafeCloseable { | CHANGE_DENSITY | CHANGE_SUPPORTED_BOUNDS | CHANGE_NAVIGATION_MODE; private static final String ACTION_OVERLAY_CHANGED = "android.intent.action.OVERLAY_CHANGED"; - private static final String NAV_BAR_INTERACTION_MODE_RES_NAME = "config_navBarInteractionMode"; private static final String TARGET_OVERLAY_PACKAGE = "android"; private final Context mContext; @@ -294,7 +288,7 @@ public class DisplayController implements ComponentCallbacks, SafeCloseable { // Used for testing public Info(Context displayInfoContext, WindowManagerProxy wmProxy, - ArrayMap perDisplayBoundsCache) { + Map perDisplayBoundsCache) { CachedDisplayInfo displayInfo = wmProxy.getDisplayInfo(displayInfoContext); normalizedDisplayInfo = displayInfo.normalize(); rotation = displayInfo.rotation; @@ -305,7 +299,7 @@ public class DisplayController implements ComponentCallbacks, SafeCloseable { fontScale = config.fontScale; densityDpi = config.densityDpi; mScreenSizeDp = new PortraitSize(config.screenHeightDp, config.screenWidthDp); - navigationMode = parseNavigationMode(displayInfoContext); + navigationMode = wmProxy.getNavigationMode(displayInfoContext); mPerDisplayBounds.putAll(perDisplayBoundsCache); WindowBounds[] cachedValue = mPerDisplayBounds.get(normalizedDisplayInfo); @@ -405,35 +399,4 @@ public class DisplayController implements ComponentCallbacks, SafeCloseable { } } - public enum NavigationMode { - THREE_BUTTONS(false, 0, LAUNCHER_NAVIGATION_MODE_3_BUTTON), - TWO_BUTTONS(true, 1, LAUNCHER_NAVIGATION_MODE_2_BUTTON), - NO_BUTTON(true, 2, LAUNCHER_NAVIGATION_MODE_GESTURE_BUTTON); - - public final boolean hasGestures; - public final int resValue; - public final LauncherEvent launcherEvent; - - NavigationMode(boolean hasGestures, int resValue, LauncherEvent launcherEvent) { - this.hasGestures = hasGestures; - this.resValue = resValue; - this.launcherEvent = launcherEvent; - } - } - - private static NavigationMode parseNavigationMode(Context context) { - int modeInt = ResourceUtils.getIntegerByName(NAV_BAR_INTERACTION_MODE_RES_NAME, - context.getResources(), INVALID_RESOURCE_HANDLE); - - if (modeInt == INVALID_RESOURCE_HANDLE) { - Log.e(TAG, "Failed to get system resource ID. Incompatible framework version?"); - } else { - for (NavigationMode m : NavigationMode.values()) { - if (m.resValue == modeInt) { - return m; - } - } - } - return Utilities.ATLEAST_S ? NavigationMode.NO_BUTTON : NavigationMode.THREE_BUTTONS; - } } diff --git a/src/com/android/launcher3/util/NavigationMode.java b/src/com/android/launcher3/util/NavigationMode.java new file mode 100644 index 0000000000..37dd41c274 --- /dev/null +++ b/src/com/android/launcher3/util/NavigationMode.java @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.launcher3.util; + +import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_NAVIGATION_MODE_2_BUTTON; +import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_NAVIGATION_MODE_3_BUTTON; +import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_NAVIGATION_MODE_GESTURE_BUTTON; + +import com.android.launcher3.logging.StatsLogManager; + +/** + * Navigation mode used in the device. + */ +public enum NavigationMode { + THREE_BUTTONS(false, 0, LAUNCHER_NAVIGATION_MODE_3_BUTTON), + TWO_BUTTONS(true, 1, LAUNCHER_NAVIGATION_MODE_2_BUTTON), + NO_BUTTON(true, 2, LAUNCHER_NAVIGATION_MODE_GESTURE_BUTTON); + + public final boolean hasGestures; + public final int resValue; + public final StatsLogManager.LauncherEvent launcherEvent; + + NavigationMode(boolean hasGestures, int resValue, StatsLogManager.LauncherEvent launcherEvent) { + this.hasGestures = hasGestures; + this.resValue = resValue; + this.launcherEvent = launcherEvent; + } +} diff --git a/src/com/android/launcher3/util/window/WindowManagerProxy.java b/src/com/android/launcher3/util/window/WindowManagerProxy.java index 582ff8dc9c..fb2ae732b7 100644 --- a/src/com/android/launcher3/util/window/WindowManagerProxy.java +++ b/src/com/android/launcher3/util/window/WindowManagerProxy.java @@ -17,14 +17,15 @@ package com.android.launcher3.util.window; import static android.view.Display.DEFAULT_DISPLAY; +import static com.android.launcher3.Utilities.dpiFromPx; import static com.android.launcher3.testing.shared.ResourceUtils.INVALID_RESOURCE_HANDLE; import static com.android.launcher3.testing.shared.ResourceUtils.NAVBAR_HEIGHT; import static com.android.launcher3.testing.shared.ResourceUtils.NAVBAR_HEIGHT_LANDSCAPE; import static com.android.launcher3.testing.shared.ResourceUtils.NAVBAR_LANDSCAPE_LEFT_RIGHT_SIZE; +import static com.android.launcher3.testing.shared.ResourceUtils.NAV_BAR_INTERACTION_MODE_RES_NAME; import static com.android.launcher3.testing.shared.ResourceUtils.STATUS_BAR_HEIGHT; import static com.android.launcher3.testing.shared.ResourceUtils.STATUS_BAR_HEIGHT_LANDSCAPE; import static com.android.launcher3.testing.shared.ResourceUtils.STATUS_BAR_HEIGHT_PORTRAIT; -import static com.android.launcher3.Utilities.dpiFromPx; import static com.android.launcher3.util.MainThreadInitializedObject.forOverride; import static com.android.launcher3.util.RotationUtils.deltaRotation; import static com.android.launcher3.util.RotationUtils.rotateRect; @@ -40,6 +41,7 @@ import android.graphics.Rect; import android.hardware.display.DisplayManager; import android.os.Build; import android.util.ArrayMap; +import android.util.Log; import android.view.Display; import android.view.DisplayCutout; import android.view.Surface; @@ -48,9 +50,10 @@ import android.view.WindowManager; import android.view.WindowMetrics; import com.android.launcher3.R; -import com.android.launcher3.testing.shared.ResourceUtils; import com.android.launcher3.Utilities; +import com.android.launcher3.testing.shared.ResourceUtils; import com.android.launcher3.util.MainThreadInitializedObject; +import com.android.launcher3.util.NavigationMode; import com.android.launcher3.util.ResourceBasedOverride; import com.android.launcher3.util.WindowBounds; @@ -59,6 +62,7 @@ import com.android.launcher3.util.WindowBounds; */ public class WindowManagerProxy implements ResourceBasedOverride { + private static final String TAG = "WindowManagerProxy"; public static final int MIN_TABLET_WIDTH = 600; public static final MainThreadInitializedObject INSTANCE = @@ -343,4 +347,24 @@ public class WindowManagerProxy implements ResourceBasedOverride { return displayInfoContext.getSystemService(DisplayManager.class).getDisplay( DEFAULT_DISPLAY); } + + /** + * Returns the current navigation mode from resource. + */ + public NavigationMode getNavigationMode(Context context) { + int modeInt = ResourceUtils.getIntegerByName(NAV_BAR_INTERACTION_MODE_RES_NAME, + context.getResources(), INVALID_RESOURCE_HANDLE); + + if (modeInt == INVALID_RESOURCE_HANDLE) { + Log.e(TAG, "Failed to get system resource ID. Incompatible framework version?"); + } else { + for (NavigationMode m : NavigationMode.values()) { + if (m.resValue == modeInt) { + return m; + } + } + } + return Utilities.ATLEAST_S ? NavigationMode.NO_BUTTON : + NavigationMode.THREE_BUTTONS; + } }