Add DeviceProfile tests on all attributes across different configurations.
Fix: 237542518 Test: DeviceProfilePhoneTest.kt Test: DeviceProfileVerticalBarTest.kt Test: DeviceProfilePhone3ButtonTest.kt Test: DeviceProfileVerticalBar3ButtonTest.kt Test: DeviceProfileTabletLandscapeTest.kt Test: DeviceProfileTabletPortraitTest.kt Test: DeviceProfileTabletLandscape3ButtonTest.kt Test: DeviceProfileTabletPortrait3ButtonTest.kt Test: DeviceProfileTwoPanelLandscapeTest.kt Test: DeviceProfileTwoPanelPortraitTest.kt Test: DeviceProfileTwoPanelLandscape3ButtonTest.kt Test: DeviceProfileTwoPanelPortrait3ButtonTest.kt Change-Id: I1596dcd1fb8c9b353cdfcab224d7670d88bed716
This commit is contained in:
@@ -0,0 +1,486 @@
|
||||
/*
|
||||
* 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.DeviceProfile
|
||||
import com.android.launcher3.DeviceProfileBaseTest
|
||||
import com.google.common.truth.Truth.assertThat
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
|
||||
/**
|
||||
* Tests for DeviceProfile for phone with 3-Button navigation.
|
||||
*/
|
||||
@SmallTest
|
||||
@RunWith(AndroidJUnit4::class)
|
||||
class DeviceProfilePhone3ButtonTest : DeviceProfileBaseTest() {
|
||||
|
||||
lateinit var dp: DeviceProfile
|
||||
|
||||
@Before
|
||||
fun before() {
|
||||
initializeVarsForPhone(isGestureMode = false)
|
||||
dp = newDP()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isScalableGrid() {
|
||||
assertThat(dp.isScalableGrid).isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellWidthPx() {
|
||||
assertThat(dp.cellWidthPx).isEqualTo(265)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellHeightPx() {
|
||||
assertThat(dp.cellHeightPx).isEqualTo(343)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellSizeX() {
|
||||
assertThat(dp.getCellSize().x).isEqualTo(265)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellSizeY() {
|
||||
assertThat(dp.getCellSize().y).isEqualTo(552)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutBorderSpacePxX() {
|
||||
assertThat(dp.cellLayoutBorderSpacePx.x).isEqualTo(66)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutBorderSpacePxY() {
|
||||
assertThat(dp.cellLayoutBorderSpacePx.y).isEqualTo(66)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutPaddingPxLeft() {
|
||||
assertThat(dp.cellLayoutPaddingPx.left).isEqualTo(38)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutPaddingPxTop() {
|
||||
assertThat(dp.cellLayoutPaddingPx.top).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutPaddingPxRight() {
|
||||
assertThat(dp.cellLayoutPaddingPx.right).isEqualTo(38)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutPaddingPxBottom() {
|
||||
assertThat(dp.cellLayoutPaddingPx.bottom).isEqualTo(38)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun iconSizePx() {
|
||||
assertThat(dp.iconSizePx).isEqualTo(196)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun iconTextSizePx() {
|
||||
assertThat(dp.iconTextSizePx).isEqualTo(49)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun iconDrawablePaddingPx() {
|
||||
assertThat(dp.iconDrawablePaddingPx).isEqualTo(25)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellWidthPx() {
|
||||
assertThat(dp.folderCellWidthPx).isEqualTo(265)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellHeightPx() {
|
||||
assertThat(dp.folderCellHeightPx).isEqualTo(343)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderChildIconSizePx() {
|
||||
assertThat(dp.folderChildIconSizePx).isEqualTo(196)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderChildTextSizePx() {
|
||||
assertThat(dp.folderChildTextSizePx).isEqualTo(49)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderChildDrawablePaddingPx() {
|
||||
assertThat(dp.folderChildDrawablePaddingPx).isEqualTo(27)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellLayoutBorderSpaceOriginalPx() {
|
||||
assertThat(dp.folderCellLayoutBorderSpaceOriginalPx).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellLayoutBorderSpacePxX() {
|
||||
assertThat(dp.folderCellLayoutBorderSpacePx.x).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellLayoutBorderSpacePxY() {
|
||||
assertThat(dp.folderCellLayoutBorderSpacePx.y).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun bottomSheetTopPadding() {
|
||||
assertThat(dp.bottomSheetTopPadding).isEqualTo(38)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsShiftRange() {
|
||||
assertThat(dp.allAppsShiftRange).isEqualTo(1050)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsTopPadding() {
|
||||
assertThat(dp.allAppsTopPadding).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsIconSizePx() {
|
||||
assertThat(dp.allAppsIconSizePx).isEqualTo(232)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsIconTextSizePx() {
|
||||
assertThat(dp.allAppsIconTextSizePx).isEqualTo(58)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsIconDrawablePaddingPx() {
|
||||
assertThat(dp.allAppsIconDrawablePaddingPx).isEqualTo(25)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsCellHeightPx() {
|
||||
assertThat(dp.allAppsCellHeightPx).isEqualTo(409)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsCellWidthPx() {
|
||||
assertThat(dp.allAppsCellWidthPx).isEqualTo(265)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsBorderSpacePxX() {
|
||||
assertThat(dp.allAppsBorderSpacePx.x).isEqualTo(66)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsBorderSpacePxY() {
|
||||
assertThat(dp.allAppsBorderSpacePx.y).isEqualTo(66)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun numShownAllAppsColumns() {
|
||||
assertThat(dp.numShownAllAppsColumns).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsLeftRightPadding() {
|
||||
assertThat(dp.allAppsLeftRightPadding).isEqualTo(91)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsLeftRightMargin() {
|
||||
assertThat(dp.allAppsLeftRightMargin).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarSizePx() {
|
||||
assertThat(dp.hotseatBarSizePx).isEqualTo(669)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatCellHeightPx() {
|
||||
assertThat(dp.hotseatCellHeightPx).isEqualTo(221)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarBottomPaddingPx() {
|
||||
assertThat(dp.hotseatBarBottomSpacePx).isEqualTo(168)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarSidePaddingStartPx() {
|
||||
assertThat(dp.hotseatBarSidePaddingStartPx).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarSidePaddingEndPx() {
|
||||
assertThat(dp.hotseatBarSidePaddingEndPx).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatQsbSpace() {
|
||||
assertThat(dp.hotseatQsbSpace).isEqualTo(126)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatQsbHeight() {
|
||||
assertThat(dp.hotseatQsbHeight).isEqualTo(221)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun springLoadedHotseatBarTopMarginPx() {
|
||||
assertThat(dp.springLoadedHotseatBarTopMarginPx).isEqualTo(266)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun numShownHotseatIcons() {
|
||||
assertThat(dp.numShownHotseatIcons).isEqualTo(4)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBorderSpace() {
|
||||
assertThat(dp.hotseatBorderSpace).isEqualTo(135)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isQsbInline() {
|
||||
assertThat(dp.isQsbInline).isEqualTo(false)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun qsbWidth() {
|
||||
assertThat(dp.qsbWidth).isEqualTo(1189)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isTaskbarPresent() {
|
||||
assertThat(dp.isTaskbarPresent).isEqualTo(false)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isTaskbarPresentInApps() {
|
||||
assertThat(dp.isTaskbarPresentInApps).isEqualTo(false)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun taskbarSize() {
|
||||
assertThat(dp.taskbarSize).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun desiredWorkspaceHorizontalMarginPx() {
|
||||
assertThat(dp.desiredWorkspaceHorizontalMarginPx).isEqualTo(91)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspacePaddingLeft() {
|
||||
assertThat(dp.workspacePadding.left).isEqualTo(53)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspacePaddingTop() {
|
||||
assertThat(dp.workspacePadding.top).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspacePaddingRight() {
|
||||
assertThat(dp.workspacePadding.right).isEqualTo(53)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspacePaddingBottom() {
|
||||
assertThat(dp.workspacePadding.bottom).isEqualTo(573)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun iconScale() {
|
||||
assertThat(dp.iconScale).isEqualTo(1)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellScaleToFit() {
|
||||
assertThat(dp.cellScaleToFit).isEqualTo(1.182266f)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspaceTopPadding() {
|
||||
assertThat(dp.workspaceTopPadding).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspaceBottomPadding() {
|
||||
assertThat(dp.workspaceBottomPadding).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskMarginPx() {
|
||||
assertThat(dp.overviewTaskMarginPx).isEqualTo(56)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskMarginGridPx() {
|
||||
assertThat(dp.overviewTaskMarginGridPx).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskIconSizePx() {
|
||||
assertThat(dp.overviewTaskIconSizePx).isEqualTo(168)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskIconDrawableSizePx() {
|
||||
assertThat(dp.overviewTaskIconDrawableSizePx).isEqualTo(154)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskIconDrawableSizeGridPx() {
|
||||
assertThat(dp.overviewTaskIconDrawableSizeGridPx).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskThumbnailTopMarginPx() {
|
||||
assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(280)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewActionsTopMarginPx() {
|
||||
assertThat(dp.overviewActionsTopMarginPx).isEqualTo(84)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewActionsHeight() {
|
||||
assertThat(dp.overviewActionsHeight).isEqualTo(168)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewActionsButtonSpacing() {
|
||||
assertThat(dp.overviewActionsButtonSpacing).isEqualTo(126)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewPageSpacing() {
|
||||
assertThat(dp.overviewPageSpacing).isEqualTo(56)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewRowSpacing() {
|
||||
assertThat(dp.overviewRowSpacing).isEqualTo(-112)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewGridSideMargin() {
|
||||
assertThat(dp.overviewGridSideMargin).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun dropTargetBarTopMarginPx() {
|
||||
assertThat(dp.dropTargetBarTopMarginPx).isEqualTo(112)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun dropTargetBarSizePx() {
|
||||
assertThat(dp.dropTargetBarSizePx).isEqualTo(196)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun dropTargetBarBottomMarginPx() {
|
||||
assertThat(dp.dropTargetBarBottomMarginPx).isEqualTo(56)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspaceSpringLoadedMinNextPageVisiblePx() {
|
||||
assertThat(dp.workspaceSpringLoadedMinNextPageVisiblePx).isEqualTo(84)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getWorkspaceSpringLoadScale() {
|
||||
assertThat(dp.workspaceSpringLoadScale).isEqualTo(0.74417657f)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellLayoutHeight() {
|
||||
assertThat(dp.cellLayoutHeight).isEqualTo(2447)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellLayoutWidth() {
|
||||
assertThat(dp.cellLayoutWidth).isEqualTo(1334)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getPanelCount() {
|
||||
assertThat(dp.panelCount).isEqualTo(1)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isVerticalBarLayout() {
|
||||
assertThat(dp.isVerticalBarLayout).isEqualTo(false)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellLayoutSpringLoadShrunkTop() {
|
||||
assertThat(dp.cellLayoutSpringLoadShrunkTop).isEqualTo(364)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellLayoutSpringLoadShrunkBottom() {
|
||||
assertThat(dp.cellLayoutSpringLoadShrunkBottom).isEqualTo(2185)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getQsbOffsetY() {
|
||||
assertThat(dp.qsbOffsetY).isEqualTo(147)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getTaskbarOffsetY() {
|
||||
assertThat(dp.taskbarOffsetY).isEqualTo(558)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getHotseatLayoutPaddingLeft() {
|
||||
assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(125)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getHotseatLayoutPaddingTop() {
|
||||
assertThat(dp.getHotseatLayoutPadding(context).top).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getHotseatLayoutPaddingRight() {
|
||||
assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(125)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getHotseatLayoutPaddingBottom() {
|
||||
assertThat(dp.getHotseatLayoutPadding(context).bottom).isEqualTo(448)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarEndOffset() {
|
||||
assertThat(dp.hotseatBarEndOffset).isEqualTo(0)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,486 @@
|
||||
/*
|
||||
* 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.DeviceProfile
|
||||
import com.android.launcher3.DeviceProfileBaseTest
|
||||
import com.google.common.truth.Truth.assertThat
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
|
||||
/**
|
||||
* Tests for DeviceProfile for phone.
|
||||
*/
|
||||
@SmallTest
|
||||
@RunWith(AndroidJUnit4::class)
|
||||
class DeviceProfilePhoneTest : DeviceProfileBaseTest() {
|
||||
|
||||
lateinit var dp: DeviceProfile
|
||||
|
||||
@Before
|
||||
fun before() {
|
||||
initializeVarsForPhone()
|
||||
dp = newDP()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isScalableGrid() {
|
||||
assertThat(dp.isScalableGrid).isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellWidthPx() {
|
||||
assertThat(dp.cellWidthPx).isEqualTo(265)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellHeightPx() {
|
||||
assertThat(dp.cellHeightPx).isEqualTo(343)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellSizeX() {
|
||||
assertThat(dp.getCellSize().x).isEqualTo(265)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellSizeY() {
|
||||
assertThat(dp.getCellSize().y).isEqualTo(552)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutBorderSpacePxX() {
|
||||
assertThat(dp.cellLayoutBorderSpacePx.x).isEqualTo(66)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutBorderSpacePxY() {
|
||||
assertThat(dp.cellLayoutBorderSpacePx.y).isEqualTo(66)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutPaddingPxLeft() {
|
||||
assertThat(dp.cellLayoutPaddingPx.left).isEqualTo(38)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutPaddingPxTop() {
|
||||
assertThat(dp.cellLayoutPaddingPx.top).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutPaddingPxRight() {
|
||||
assertThat(dp.cellLayoutPaddingPx.right).isEqualTo(38)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutPaddingPxBottom() {
|
||||
assertThat(dp.cellLayoutPaddingPx.bottom).isEqualTo(38)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun iconSizePx() {
|
||||
assertThat(dp.iconSizePx).isEqualTo(196)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun iconTextSizePx() {
|
||||
assertThat(dp.iconTextSizePx).isEqualTo(49)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun iconDrawablePaddingPx() {
|
||||
assertThat(dp.iconDrawablePaddingPx).isEqualTo(25)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellWidthPx() {
|
||||
assertThat(dp.folderCellWidthPx).isEqualTo(265)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellHeightPx() {
|
||||
assertThat(dp.folderCellHeightPx).isEqualTo(343)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderChildIconSizePx() {
|
||||
assertThat(dp.folderChildIconSizePx).isEqualTo(196)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderChildTextSizePx() {
|
||||
assertThat(dp.folderChildTextSizePx).isEqualTo(49)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderChildDrawablePaddingPx() {
|
||||
assertThat(dp.folderChildDrawablePaddingPx).isEqualTo(27)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellLayoutBorderSpaceOriginalPx() {
|
||||
assertThat(dp.folderCellLayoutBorderSpaceOriginalPx).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellLayoutBorderSpacePxX() {
|
||||
assertThat(dp.folderCellLayoutBorderSpacePx.x).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellLayoutBorderSpacePxY() {
|
||||
assertThat(dp.folderCellLayoutBorderSpacePx.y).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun bottomSheetTopPadding() {
|
||||
assertThat(dp.bottomSheetTopPadding).isEqualTo(38)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsShiftRange() {
|
||||
assertThat(dp.allAppsShiftRange).isEqualTo(1050)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsTopPadding() {
|
||||
assertThat(dp.allAppsTopPadding).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsIconSizePx() {
|
||||
assertThat(dp.allAppsIconSizePx).isEqualTo(232)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsIconTextSizePx() {
|
||||
assertThat(dp.allAppsIconTextSizePx).isEqualTo(58)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsIconDrawablePaddingPx() {
|
||||
assertThat(dp.allAppsIconDrawablePaddingPx).isEqualTo(25)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsCellHeightPx() {
|
||||
assertThat(dp.allAppsCellHeightPx).isEqualTo(409)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsCellWidthPx() {
|
||||
assertThat(dp.allAppsCellWidthPx).isEqualTo(265)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsBorderSpacePxX() {
|
||||
assertThat(dp.allAppsBorderSpacePx.x).isEqualTo(66)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsBorderSpacePxY() {
|
||||
assertThat(dp.allAppsBorderSpacePx.y).isEqualTo(66)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun numShownAllAppsColumns() {
|
||||
assertThat(dp.numShownAllAppsColumns).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsLeftRightPadding() {
|
||||
assertThat(dp.allAppsLeftRightPadding).isEqualTo(91)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsLeftRightMargin() {
|
||||
assertThat(dp.allAppsLeftRightMargin).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarSizePx() {
|
||||
assertThat(dp.hotseatBarSizePx).isEqualTo(669)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatCellHeightPx() {
|
||||
assertThat(dp.hotseatCellHeightPx).isEqualTo(221)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarBottomPaddingPx() {
|
||||
assertThat(dp.hotseatBarBottomSpacePx).isEqualTo(168)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarSidePaddingStartPx() {
|
||||
assertThat(dp.hotseatBarSidePaddingStartPx).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarSidePaddingEndPx() {
|
||||
assertThat(dp.hotseatBarSidePaddingEndPx).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatQsbSpace() {
|
||||
assertThat(dp.hotseatQsbSpace).isEqualTo(126)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatQsbHeight() {
|
||||
assertThat(dp.hotseatQsbHeight).isEqualTo(221)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun springLoadedHotseatBarTopMarginPx() {
|
||||
assertThat(dp.springLoadedHotseatBarTopMarginPx).isEqualTo(266)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun numShownHotseatIcons() {
|
||||
assertThat(dp.numShownHotseatIcons).isEqualTo(4)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBorderSpace() {
|
||||
assertThat(dp.hotseatBorderSpace).isEqualTo(135)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isQsbInline() {
|
||||
assertThat(dp.isQsbInline).isEqualTo(false)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun qsbWidth() {
|
||||
assertThat(dp.qsbWidth).isEqualTo(1189)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isTaskbarPresent() {
|
||||
assertThat(dp.isTaskbarPresent).isEqualTo(false)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isTaskbarPresentInApps() {
|
||||
assertThat(dp.isTaskbarPresentInApps).isEqualTo(false)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun taskbarSize() {
|
||||
assertThat(dp.taskbarSize).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun desiredWorkspaceHorizontalMarginPx() {
|
||||
assertThat(dp.desiredWorkspaceHorizontalMarginPx).isEqualTo(91)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspacePaddingLeft() {
|
||||
assertThat(dp.workspacePadding.left).isEqualTo(53)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspacePaddingTop() {
|
||||
assertThat(dp.workspacePadding.top).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspacePaddingRight() {
|
||||
assertThat(dp.workspacePadding.right).isEqualTo(53)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspacePaddingBottom() {
|
||||
assertThat(dp.workspacePadding.bottom).isEqualTo(573)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun iconScale() {
|
||||
assertThat(dp.iconScale).isEqualTo(1)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellScaleToFit() {
|
||||
assertThat(dp.cellScaleToFit).isEqualTo(1.182266f)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspaceTopPadding() {
|
||||
assertThat(dp.workspaceTopPadding).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspaceBottomPadding() {
|
||||
assertThat(dp.workspaceBottomPadding).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskMarginPx() {
|
||||
assertThat(dp.overviewTaskMarginPx).isEqualTo(56)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskMarginGridPx() {
|
||||
assertThat(dp.overviewTaskMarginGridPx).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskIconSizePx() {
|
||||
assertThat(dp.overviewTaskIconSizePx).isEqualTo(168)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskIconDrawableSizePx() {
|
||||
assertThat(dp.overviewTaskIconDrawableSizePx).isEqualTo(154)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskIconDrawableSizeGridPx() {
|
||||
assertThat(dp.overviewTaskIconDrawableSizeGridPx).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskThumbnailTopMarginPx() {
|
||||
assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(280)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewActionsTopMarginPx() {
|
||||
assertThat(dp.overviewActionsTopMarginPx).isEqualTo(84)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewActionsHeight() {
|
||||
assertThat(dp.overviewActionsHeight).isEqualTo(168)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewActionsButtonSpacing() {
|
||||
assertThat(dp.overviewActionsButtonSpacing).isEqualTo(126)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewPageSpacing() {
|
||||
assertThat(dp.overviewPageSpacing).isEqualTo(56)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewRowSpacing() {
|
||||
assertThat(dp.overviewRowSpacing).isEqualTo(-112)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewGridSideMargin() {
|
||||
assertThat(dp.overviewGridSideMargin).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun dropTargetBarTopMarginPx() {
|
||||
assertThat(dp.dropTargetBarTopMarginPx).isEqualTo(112)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun dropTargetBarSizePx() {
|
||||
assertThat(dp.dropTargetBarSizePx).isEqualTo(196)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun dropTargetBarBottomMarginPx() {
|
||||
assertThat(dp.dropTargetBarBottomMarginPx).isEqualTo(56)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspaceSpringLoadedMinNextPageVisiblePx() {
|
||||
assertThat(dp.workspaceSpringLoadedMinNextPageVisiblePx).isEqualTo(84)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getWorkspaceSpringLoadScale() {
|
||||
assertThat(dp.workspaceSpringLoadScale).isEqualTo(0.74417657f)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellLayoutHeight() {
|
||||
assertThat(dp.cellLayoutHeight).isEqualTo(2447)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellLayoutWidth() {
|
||||
assertThat(dp.cellLayoutWidth).isEqualTo(1334)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getPanelCount() {
|
||||
assertThat(dp.panelCount).isEqualTo(1)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isVerticalBarLayout() {
|
||||
assertThat(dp.isVerticalBarLayout).isEqualTo(false)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellLayoutSpringLoadShrunkTop() {
|
||||
assertThat(dp.cellLayoutSpringLoadShrunkTop).isEqualTo(364)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellLayoutSpringLoadShrunkBottom() {
|
||||
assertThat(dp.cellLayoutSpringLoadShrunkBottom).isEqualTo(2185)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getQsbOffsetY() {
|
||||
assertThat(dp.qsbOffsetY).isEqualTo(147)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getTaskbarOffsetY() {
|
||||
assertThat(dp.taskbarOffsetY).isEqualTo(558)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getHotseatLayoutPaddingLeft() {
|
||||
assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(125)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getHotseatLayoutPaddingTop() {
|
||||
assertThat(dp.getHotseatLayoutPadding(context).top).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getHotseatLayoutPaddingRight() {
|
||||
assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(125)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getHotseatLayoutPaddingBottom() {
|
||||
assertThat(dp.getHotseatLayoutPadding(context).bottom).isEqualTo(448)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarEndOffset() {
|
||||
assertThat(dp.hotseatBarEndOffset).isEqualTo(0)
|
||||
}
|
||||
}
|
||||
@@ -1,122 +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.android.launcher3.InvariantDeviceProfile
|
||||
import com.android.launcher3.util.WindowBounds
|
||||
import com.google.common.truth.Truth.assertThat
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.mockito.ArgumentMatchers
|
||||
import org.mockito.Mockito.`when` as whenever
|
||||
|
||||
/**
|
||||
* Test for [DeviceProfile] quickstep.
|
||||
*/
|
||||
@SmallTest
|
||||
@RunWith(AndroidJUnit4::class)
|
||||
class DeviceProfileQuickstepTest : DeviceProfileBaseTest() {
|
||||
|
||||
@Test
|
||||
fun getCellLayoutWidthAndHeight_twoPanelLandscapeScalable4By4GridTablet() {
|
||||
val tabletWidth = 2560
|
||||
val tabletHeight = 1600
|
||||
val availableWidth = 2560
|
||||
val availableHeight = 1500
|
||||
windowBounds = WindowBounds(tabletWidth, tabletHeight, availableWidth, availableHeight, 0)
|
||||
useTwoPanels = true
|
||||
whenever(info.isTablet(ArgumentMatchers.any())).thenReturn(true)
|
||||
whenever(info.densityDpi).thenReturn(320)
|
||||
whenever(info.smallestSizeDp(ArgumentMatchers.any())).thenReturn(800f)
|
||||
inv = newScalableInvariantDeviceProfile()
|
||||
|
||||
val dp = newDP()
|
||||
|
||||
assertThat(dp.cellLayoutWidth).isEqualTo(1237)
|
||||
assertThat(dp.cellLayoutHeight).isEqualTo(1215)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellSize_twoPanelLandscapeScalable4By4GridTablet() {
|
||||
val tabletWidth = 2560
|
||||
val tabletHeight = 1600
|
||||
val availableWidth = 2560
|
||||
val availableHeight = 1500
|
||||
windowBounds = WindowBounds(tabletWidth, tabletHeight, availableWidth, availableHeight, 0)
|
||||
useTwoPanels = true
|
||||
whenever(info.isTablet(ArgumentMatchers.any())).thenReturn(true)
|
||||
whenever(info.densityDpi).thenReturn(320)
|
||||
whenever(info.smallestSizeDp(ArgumentMatchers.any())).thenReturn(800f)
|
||||
inv = newScalableInvariantDeviceProfile()
|
||||
|
||||
val dp = newDP()
|
||||
|
||||
assertThat(dp.getCellSize().y).isEqualTo(260)
|
||||
assertThat(dp.getCellSize().x).isEqualTo(259)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getPanelCount_twoPanelLandscapeScalable4By4GridTablet() {
|
||||
val tabletWidth = 2560
|
||||
val tabletHeight = 1600
|
||||
val availableWidth = 2560
|
||||
val availableHeight = 1500
|
||||
windowBounds = WindowBounds(tabletWidth, tabletHeight, availableWidth, availableHeight, 0)
|
||||
useTwoPanels = true
|
||||
whenever(info.isTablet(ArgumentMatchers.any())).thenReturn(true)
|
||||
whenever(info.densityDpi).thenReturn(320)
|
||||
whenever(info.smallestSizeDp(ArgumentMatchers.any())).thenReturn(800f)
|
||||
inv = newScalableInvariantDeviceProfile()
|
||||
|
||||
val dp = newDP()
|
||||
|
||||
assertThat(dp.panelCount).isEqualTo(2)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getWorkspaceSpringLoadShrunkTopBottom_landscapePhoneVerticalBar() {
|
||||
inv = newScalableInvariantDeviceProfile()
|
||||
initializeVarsForPhone(true)
|
||||
inv = newScalableInvariantDeviceProfile().apply {
|
||||
deviceType = InvariantDeviceProfile.TYPE_PHONE
|
||||
transposeLayoutWithOrientation = true
|
||||
}
|
||||
|
||||
val dp = newDP()
|
||||
|
||||
assertThat(dp.isVerticalBarLayout).isEqualTo(true)
|
||||
assertThat(dp.cellLayoutSpringLoadShrunkTop).isEqualTo(168)
|
||||
assertThat(dp.cellLayoutSpringLoadShrunkBottom).isEqualTo(1358)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getWorkspaceSpringLoadShrunkTopBottom_portraitPhone() {
|
||||
inv = newScalableInvariantDeviceProfile()
|
||||
initializeVarsForPhone()
|
||||
inv = newScalableInvariantDeviceProfile().apply {
|
||||
deviceType = InvariantDeviceProfile.TYPE_PHONE
|
||||
}
|
||||
|
||||
val dp = newDP()
|
||||
|
||||
assertThat(dp.isVerticalBarLayout).isEqualTo(false)
|
||||
assertThat(dp.cellLayoutSpringLoadShrunkTop).isEqualTo(364)
|
||||
assertThat(dp.cellLayoutSpringLoadShrunkBottom).isEqualTo(2185)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,486 @@
|
||||
/*
|
||||
* 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.DeviceProfile
|
||||
import com.android.launcher3.DeviceProfileBaseTest
|
||||
import com.google.common.truth.Truth.assertThat
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
|
||||
/**
|
||||
* Tests for DeviceProfile for tablet in landscape with 3-Button navigation.
|
||||
*/
|
||||
@SmallTest
|
||||
@RunWith(AndroidJUnit4::class)
|
||||
class DeviceProfileTabletLandscape3ButtonTest : DeviceProfileBaseTest() {
|
||||
|
||||
lateinit var dp: DeviceProfile
|
||||
|
||||
@Before
|
||||
fun before() {
|
||||
initializeVarsForTablet(isLandscape = true, isGestureMode = false)
|
||||
dp = newDP()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isScalableGrid() {
|
||||
assertThat(dp.isScalableGrid).isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellWidthPx() {
|
||||
assertThat(dp.cellWidthPx).isEqualTo(227)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellHeightPx() {
|
||||
assertThat(dp.cellHeightPx).isEqualTo(294)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellSizeX() {
|
||||
assertThat(dp.cellSize.x).isEqualTo(558)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellSizeY() {
|
||||
assertThat(dp.cellSize.y).isEqualTo(294)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutBorderSpacePxX() {
|
||||
assertThat(dp.cellLayoutBorderSpacePx.x).isEqualTo(57)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutBorderSpacePxY() {
|
||||
assertThat(dp.cellLayoutBorderSpacePx.y).isEqualTo(57)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutPaddingPxLeft() {
|
||||
assertThat(dp.cellLayoutPaddingPx.left).isEqualTo(59)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutPaddingPxTop() {
|
||||
assertThat(dp.cellLayoutPaddingPx.top).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutPaddingPxRight() {
|
||||
assertThat(dp.cellLayoutPaddingPx.right).isEqualTo(59)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutPaddingPxBottom() {
|
||||
assertThat(dp.cellLayoutPaddingPx.bottom).isEqualTo(59)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun iconSizePx() {
|
||||
assertThat(dp.iconSizePx).isEqualTo(112)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun iconTextSizePx() {
|
||||
assertThat(dp.iconTextSizePx).isEqualTo(28)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun iconDrawablePaddingPx() {
|
||||
assertThat(dp.iconDrawablePaddingPx).isEqualTo(14)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellWidthPx() {
|
||||
assertThat(dp.folderCellWidthPx).isEqualTo(227)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellHeightPx() {
|
||||
assertThat(dp.folderCellHeightPx).isEqualTo(294)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderChildIconSizePx() {
|
||||
assertThat(dp.folderChildIconSizePx).isEqualTo(112)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderChildTextSizePx() {
|
||||
assertThat(dp.folderChildTextSizePx).isEqualTo(28)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderChildDrawablePaddingPx() {
|
||||
assertThat(dp.folderChildDrawablePaddingPx).isEqualTo(48)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellLayoutBorderSpaceOriginalPx() {
|
||||
assertThat(dp.folderCellLayoutBorderSpaceOriginalPx).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellLayoutBorderSpacePxX() {
|
||||
assertThat(dp.folderCellLayoutBorderSpacePx.x).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellLayoutBorderSpacePxY() {
|
||||
assertThat(dp.folderCellLayoutBorderSpacePx.y).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun bottomSheetTopPadding() {
|
||||
assertThat(dp.bottomSheetTopPadding).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsShiftRange() {
|
||||
assertThat(dp.allAppsShiftRange).isEqualTo(1600)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsTopPadding() {
|
||||
assertThat(dp.allAppsTopPadding).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsIconSizePx() {
|
||||
assertThat(dp.allAppsIconSizePx).isEqualTo(199)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsIconTextSizePx() {
|
||||
assertThat(dp.allAppsIconTextSizePx).isEqualTo(50)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsIconDrawablePaddingPx() {
|
||||
assertThat(dp.allAppsIconDrawablePaddingPx).isEqualTo(14)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsCellHeightPx() {
|
||||
assertThat(dp.allAppsCellHeightPx).isEqualTo(351)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsCellWidthPx() {
|
||||
assertThat(dp.allAppsCellWidthPx).isEqualTo(227)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsBorderSpacePxX() {
|
||||
assertThat(dp.allAppsBorderSpacePx.x).isEqualTo(57)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsBorderSpacePxY() {
|
||||
assertThat(dp.allAppsBorderSpacePx.y).isEqualTo(57)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun numShownAllAppsColumns() {
|
||||
assertThat(dp.numShownAllAppsColumns).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsLeftRightPadding() {
|
||||
assertThat(dp.allAppsLeftRightPadding).isEqualTo(64)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsLeftRightMargin() {
|
||||
assertThat(dp.allAppsLeftRightMargin).isEqualTo(1244)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarSizePx() {
|
||||
assertThat(dp.hotseatBarSizePx).isEqualTo(228)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatCellHeightPx() {
|
||||
assertThat(dp.hotseatCellHeightPx).isEqualTo(126)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarBottomSpacePx() {
|
||||
assertThat(dp.hotseatBarBottomSpacePx).isEqualTo(116)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarSidePaddingStartPx() {
|
||||
assertThat(dp.hotseatBarSidePaddingStartPx).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarSidePaddingEndPx() {
|
||||
assertThat(dp.hotseatBarSidePaddingEndPx).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatQsbSpace() {
|
||||
assertThat(dp.hotseatQsbSpace).isEqualTo(56)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatQsbHeight() {
|
||||
assertThat(dp.hotseatQsbHeight).isEqualTo(126)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun springLoadedHotseatBarTopMarginPx() {
|
||||
assertThat(dp.springLoadedHotseatBarTopMarginPx).isEqualTo(128)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun numShownHotseatIcons() {
|
||||
assertThat(dp.numShownHotseatIcons).isEqualTo(5)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBorderSpace() {
|
||||
assertThat(dp.hotseatBorderSpace).isEqualTo(32)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isQsbInline() {
|
||||
assertThat(dp.isQsbInline).isEqualTo(true)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun qsbWidth() {
|
||||
assertThat(dp.qsbWidth).isEqualTo(1237)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isTaskbarPresent() {
|
||||
assertThat(dp.isTaskbarPresent).isEqualTo(true)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isTaskbarPresentInApps() {
|
||||
assertThat(dp.isTaskbarPresentInApps).isEqualTo(false)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun taskbarSize() {
|
||||
assertThat(dp.taskbarSize).isEqualTo(120)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun desiredWorkspaceHorizontalMarginPx() {
|
||||
assertThat(dp.desiredWorkspaceHorizontalMarginPx).isEqualTo(78)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspacePaddingLeft() {
|
||||
assertThat(dp.workspacePadding.left).isEqualTo(19)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspacePaddingTop() {
|
||||
assertThat(dp.workspacePadding.top).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspacePaddingRight() {
|
||||
assertThat(dp.workspacePadding.right).isEqualTo(19)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspacePaddingBottom() {
|
||||
assertThat(dp.workspacePadding.bottom).isEqualTo(93)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun iconScale() {
|
||||
assertThat(dp.iconScale).isEqualTo(1)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellScaleToFit() {
|
||||
assertThat(dp.cellScaleToFit).isEqualTo(1.7736843f)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspaceTopPadding() {
|
||||
assertThat(dp.workspaceTopPadding).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspaceBottomPadding() {
|
||||
assertThat(dp.workspaceBottomPadding).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskMarginPx() {
|
||||
assertThat(dp.overviewTaskMarginPx).isEqualTo(32)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskMarginGridPx() {
|
||||
assertThat(dp.overviewTaskMarginGridPx).isEqualTo(32)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskIconSizePx() {
|
||||
assertThat(dp.overviewTaskIconSizePx).isEqualTo(96)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskIconDrawableSizePx() {
|
||||
assertThat(dp.overviewTaskIconDrawableSizePx).isEqualTo(88)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskIconDrawableSizeGridPx() {
|
||||
assertThat(dp.overviewTaskIconDrawableSizeGridPx).isEqualTo(88)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskThumbnailTopMarginPx() {
|
||||
assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(160)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewActionsTopMarginPx() {
|
||||
assertThat(dp.overviewActionsTopMarginPx).isEqualTo(40)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewActionsHeight() {
|
||||
assertThat(dp.overviewActionsHeight).isEqualTo(96)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewActionsButtonSpacing() {
|
||||
assertThat(dp.overviewActionsButtonSpacing).isEqualTo(72)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewPageSpacing() {
|
||||
assertThat(dp.overviewPageSpacing).isEqualTo(88)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewRowSpacing() {
|
||||
assertThat(dp.overviewRowSpacing).isEqualTo(40)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewGridSideMargin() {
|
||||
assertThat(dp.overviewGridSideMargin).isEqualTo(128)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun dropTargetBarTopMarginPx() {
|
||||
assertThat(dp.dropTargetBarTopMarginPx).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun dropTargetBarSizePx() {
|
||||
assertThat(dp.dropTargetBarSizePx).isEqualTo(144)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun dropTargetBarBottomMarginPx() {
|
||||
assertThat(dp.dropTargetBarBottomMarginPx).isEqualTo(64)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspaceSpringLoadedMinNextPageVisiblePx() {
|
||||
assertThat(dp.workspaceSpringLoadedMinNextPageVisiblePx).isEqualTo(48)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getWorkspaceSpringLoadScale() {
|
||||
assertThat(dp.workspaceSpringLoadScale).isEqualTo(0.7363184f)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellLayoutHeight() {
|
||||
assertThat(dp.cellLayoutHeight).isEqualTo(1407)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellLayoutWidth() {
|
||||
assertThat(dp.cellLayoutWidth).isEqualTo(2522)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getPanelCount() {
|
||||
assertThat(dp.panelCount).isEqualTo(1)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isVerticalBarLayout() {
|
||||
assertThat(dp.isVerticalBarLayout).isEqualTo(false)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellLayoutSpringLoadShrunkTop() {
|
||||
assertThat(dp.cellLayoutSpringLoadShrunkTop).isEqualTo(208)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellLayoutSpringLoadShrunkBottom() {
|
||||
assertThat(dp.cellLayoutSpringLoadShrunkBottom).isEqualTo(1244)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getQsbOffsetY() {
|
||||
assertThat(dp.qsbOffsetY).isEqualTo(109)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getTaskbarOffsetY() {
|
||||
assertThat(dp.taskbarOffsetY).isEqualTo(112)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getHotseatLayoutPaddingLeft() {
|
||||
assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(1443)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getHotseatLayoutPaddingTop() {
|
||||
assertThat(dp.getHotseatLayoutPadding(context).top).isEqualTo(-7)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getHotseatLayoutPaddingRight() {
|
||||
assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(428)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getHotseatLayoutPaddingBottom() {
|
||||
assertThat(dp.getHotseatLayoutPadding(context).bottom).isEqualTo(109)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarEndOffset() {
|
||||
assertThat(dp.hotseatBarEndOffset).isEqualTo(428)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,486 @@
|
||||
/*
|
||||
* 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.DeviceProfile
|
||||
import com.android.launcher3.DeviceProfileBaseTest
|
||||
import com.google.common.truth.Truth.assertThat
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
|
||||
/**
|
||||
* Tests for DeviceProfile for tablet in landscape.
|
||||
*/
|
||||
@SmallTest
|
||||
@RunWith(AndroidJUnit4::class)
|
||||
class DeviceProfileTabletLandscapeTest : DeviceProfileBaseTest() {
|
||||
|
||||
lateinit var dp: DeviceProfile
|
||||
|
||||
@Before
|
||||
fun before() {
|
||||
initializeVarsForTablet(isLandscape = true)
|
||||
dp = newDP()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isScalableGrid() {
|
||||
assertThat(dp.isScalableGrid).isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellWidthPx() {
|
||||
assertThat(dp.cellWidthPx).isEqualTo(227)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellHeightPx() {
|
||||
assertThat(dp.cellHeightPx).isEqualTo(294)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellSizeX() {
|
||||
assertThat(dp.cellSize.x).isEqualTo(558)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellSizeY() {
|
||||
assertThat(dp.cellSize.y).isEqualTo(294)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutBorderSpacePxX() {
|
||||
assertThat(dp.cellLayoutBorderSpacePx.x).isEqualTo(57)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutBorderSpacePxY() {
|
||||
assertThat(dp.cellLayoutBorderSpacePx.y).isEqualTo(57)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutPaddingPxLeft() {
|
||||
assertThat(dp.cellLayoutPaddingPx.left).isEqualTo(59)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutPaddingPxTop() {
|
||||
assertThat(dp.cellLayoutPaddingPx.top).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutPaddingPxRight() {
|
||||
assertThat(dp.cellLayoutPaddingPx.right).isEqualTo(59)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutPaddingPxBottom() {
|
||||
assertThat(dp.cellLayoutPaddingPx.bottom).isEqualTo(59)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun iconSizePx() {
|
||||
assertThat(dp.iconSizePx).isEqualTo(112)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun iconTextSizePx() {
|
||||
assertThat(dp.iconTextSizePx).isEqualTo(28)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun iconDrawablePaddingPx() {
|
||||
assertThat(dp.iconDrawablePaddingPx).isEqualTo(14)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellWidthPx() {
|
||||
assertThat(dp.folderCellWidthPx).isEqualTo(227)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellHeightPx() {
|
||||
assertThat(dp.folderCellHeightPx).isEqualTo(294)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderChildIconSizePx() {
|
||||
assertThat(dp.folderChildIconSizePx).isEqualTo(112)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderChildTextSizePx() {
|
||||
assertThat(dp.folderChildTextSizePx).isEqualTo(28)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderChildDrawablePaddingPx() {
|
||||
assertThat(dp.folderChildDrawablePaddingPx).isEqualTo(48)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellLayoutBorderSpaceOriginalPx() {
|
||||
assertThat(dp.folderCellLayoutBorderSpaceOriginalPx).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellLayoutBorderSpacePxX() {
|
||||
assertThat(dp.folderCellLayoutBorderSpacePx.x).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellLayoutBorderSpacePxY() {
|
||||
assertThat(dp.folderCellLayoutBorderSpacePx.y).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun bottomSheetTopPadding() {
|
||||
assertThat(dp.bottomSheetTopPadding).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsShiftRange() {
|
||||
assertThat(dp.allAppsShiftRange).isEqualTo(1600)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsTopPadding() {
|
||||
assertThat(dp.allAppsTopPadding).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsIconSizePx() {
|
||||
assertThat(dp.allAppsIconSizePx).isEqualTo(199)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsIconTextSizePx() {
|
||||
assertThat(dp.allAppsIconTextSizePx).isEqualTo(50)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsIconDrawablePaddingPx() {
|
||||
assertThat(dp.allAppsIconDrawablePaddingPx).isEqualTo(14)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsCellHeightPx() {
|
||||
assertThat(dp.allAppsCellHeightPx).isEqualTo(351)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsCellWidthPx() {
|
||||
assertThat(dp.allAppsCellWidthPx).isEqualTo(227)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsBorderSpacePxX() {
|
||||
assertThat(dp.allAppsBorderSpacePx.x).isEqualTo(57)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsBorderSpacePxY() {
|
||||
assertThat(dp.allAppsBorderSpacePx.y).isEqualTo(57)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun numShownAllAppsColumns() {
|
||||
assertThat(dp.numShownAllAppsColumns).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsLeftRightPadding() {
|
||||
assertThat(dp.allAppsLeftRightPadding).isEqualTo(64)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsLeftRightMargin() {
|
||||
assertThat(dp.allAppsLeftRightMargin).isEqualTo(1244)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarSizePx() {
|
||||
assertThat(dp.hotseatBarSizePx).isEqualTo(228)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatCellHeightPx() {
|
||||
assertThat(dp.hotseatCellHeightPx).isEqualTo(126)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarBottomSpacePx() {
|
||||
assertThat(dp.hotseatBarBottomSpacePx).isEqualTo(116)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarSidePaddingStartPx() {
|
||||
assertThat(dp.hotseatBarSidePaddingStartPx).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarSidePaddingEndPx() {
|
||||
assertThat(dp.hotseatBarSidePaddingEndPx).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatQsbSpace() {
|
||||
assertThat(dp.hotseatQsbSpace).isEqualTo(56)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatQsbHeight() {
|
||||
assertThat(dp.hotseatQsbHeight).isEqualTo(126)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun springLoadedHotseatBarTopMarginPx() {
|
||||
assertThat(dp.springLoadedHotseatBarTopMarginPx).isEqualTo(128)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun numShownHotseatIcons() {
|
||||
assertThat(dp.numShownHotseatIcons).isEqualTo(4)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBorderSpace() {
|
||||
assertThat(dp.hotseatBorderSpace).isEqualTo(503)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isQsbInline() {
|
||||
assertThat(dp.isQsbInline).isEqualTo(true)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun qsbWidth() {
|
||||
assertThat(dp.qsbWidth).isEqualTo(-503)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isTaskbarPresent() {
|
||||
assertThat(dp.isTaskbarPresent).isEqualTo(true)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isTaskbarPresentInApps() {
|
||||
assertThat(dp.isTaskbarPresentInApps).isEqualTo(false)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun taskbarSize() {
|
||||
assertThat(dp.taskbarSize).isEqualTo(120)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun desiredWorkspaceHorizontalMarginPx() {
|
||||
assertThat(dp.desiredWorkspaceHorizontalMarginPx).isEqualTo(78)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspacePaddingLeft() {
|
||||
assertThat(dp.workspacePadding.left).isEqualTo(19)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspacePaddingTop() {
|
||||
assertThat(dp.workspacePadding.top).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspacePaddingRight() {
|
||||
assertThat(dp.workspacePadding.right).isEqualTo(19)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspacePaddingBottom() {
|
||||
assertThat(dp.workspacePadding.bottom).isEqualTo(93)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun iconScale() {
|
||||
assertThat(dp.iconScale).isEqualTo(1)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellScaleToFit() {
|
||||
assertThat(dp.cellScaleToFit).isEqualTo(1.7736843f)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspaceTopPadding() {
|
||||
assertThat(dp.workspaceTopPadding).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspaceBottomPadding() {
|
||||
assertThat(dp.workspaceBottomPadding).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskMarginPx() {
|
||||
assertThat(dp.overviewTaskMarginPx).isEqualTo(32)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskMarginGridPx() {
|
||||
assertThat(dp.overviewTaskMarginGridPx).isEqualTo(32)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskIconSizePx() {
|
||||
assertThat(dp.overviewTaskIconSizePx).isEqualTo(96)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskIconDrawableSizePx() {
|
||||
assertThat(dp.overviewTaskIconDrawableSizePx).isEqualTo(88)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskIconDrawableSizeGridPx() {
|
||||
assertThat(dp.overviewTaskIconDrawableSizeGridPx).isEqualTo(88)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskThumbnailTopMarginPx() {
|
||||
assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(160)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewActionsTopMarginPx() {
|
||||
assertThat(dp.overviewActionsTopMarginPx).isEqualTo(40)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewActionsHeight() {
|
||||
assertThat(dp.overviewActionsHeight).isEqualTo(96)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewActionsButtonSpacing() {
|
||||
assertThat(dp.overviewActionsButtonSpacing).isEqualTo(72)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewPageSpacing() {
|
||||
assertThat(dp.overviewPageSpacing).isEqualTo(88)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewRowSpacing() {
|
||||
assertThat(dp.overviewRowSpacing).isEqualTo(40)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewGridSideMargin() {
|
||||
assertThat(dp.overviewGridSideMargin).isEqualTo(128)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun dropTargetBarTopMarginPx() {
|
||||
assertThat(dp.dropTargetBarTopMarginPx).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun dropTargetBarSizePx() {
|
||||
assertThat(dp.dropTargetBarSizePx).isEqualTo(144)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun dropTargetBarBottomMarginPx() {
|
||||
assertThat(dp.dropTargetBarBottomMarginPx).isEqualTo(64)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspaceSpringLoadedMinNextPageVisiblePx() {
|
||||
assertThat(dp.workspaceSpringLoadedMinNextPageVisiblePx).isEqualTo(48)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getWorkspaceSpringLoadScale() {
|
||||
assertThat(dp.workspaceSpringLoadScale).isEqualTo(0.7363184f)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellLayoutHeight() {
|
||||
assertThat(dp.cellLayoutHeight).isEqualTo(1407)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellLayoutWidth() {
|
||||
assertThat(dp.cellLayoutWidth).isEqualTo(2522)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getPanelCount() {
|
||||
assertThat(dp.panelCount).isEqualTo(1)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isVerticalBarLayout() {
|
||||
assertThat(dp.isVerticalBarLayout).isEqualTo(false)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellLayoutSpringLoadShrunkTop() {
|
||||
assertThat(dp.cellLayoutSpringLoadShrunkTop).isEqualTo(208)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellLayoutSpringLoadShrunkBottom() {
|
||||
assertThat(dp.cellLayoutSpringLoadShrunkBottom).isEqualTo(1244)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getQsbOffsetY() {
|
||||
assertThat(dp.qsbOffsetY).isEqualTo(109)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getTaskbarOffsetY() {
|
||||
assertThat(dp.taskbarOffsetY).isEqualTo(112)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getHotseatLayoutPaddingLeft() {
|
||||
assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(301)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getHotseatLayoutPaddingTop() {
|
||||
assertThat(dp.getHotseatLayoutPadding(context).top).isEqualTo(-7)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getHotseatLayoutPaddingRight() {
|
||||
assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(301)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getHotseatLayoutPaddingBottom() {
|
||||
assertThat(dp.getHotseatLayoutPadding(context).bottom).isEqualTo(109)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarEndOffset() {
|
||||
assertThat(dp.hotseatBarEndOffset).isEqualTo(0)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,486 @@
|
||||
/*
|
||||
* 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.DeviceProfile
|
||||
import com.android.launcher3.DeviceProfileBaseTest
|
||||
import com.google.common.truth.Truth.assertThat
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
|
||||
/**
|
||||
* Tests for DeviceProfile for tablet in portrait with 3-Button navigation.
|
||||
*/
|
||||
@SmallTest
|
||||
@RunWith(AndroidJUnit4::class)
|
||||
class DeviceProfileTabletPortrait3ButtonTest : DeviceProfileBaseTest() {
|
||||
|
||||
lateinit var dp: DeviceProfile
|
||||
|
||||
@Before
|
||||
fun before() {
|
||||
initializeVarsForTablet(isGestureMode = false)
|
||||
dp = newDP()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isScalableGrid() {
|
||||
assertThat(dp.isScalableGrid).isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellWidthPx() {
|
||||
assertThat(dp.cellWidthPx).isEqualTo(294)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellHeightPx() {
|
||||
assertThat(dp.cellHeightPx).isEqualTo(382)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellSizeX() {
|
||||
assertThat(dp.cellSize.x).isEqualTo(294)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellSizeY() {
|
||||
assertThat(dp.cellSize.y).isEqualTo(482)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutBorderSpacePxX() {
|
||||
assertThat(dp.cellLayoutBorderSpacePx.x).isEqualTo(74)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutBorderSpacePxY() {
|
||||
assertThat(dp.cellLayoutBorderSpacePx.y).isEqualTo(74)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutPaddingPxLeft() {
|
||||
assertThat(dp.cellLayoutPaddingPx.left).isEqualTo(72)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutPaddingPxTop() {
|
||||
assertThat(dp.cellLayoutPaddingPx.top).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutPaddingPxRight() {
|
||||
assertThat(dp.cellLayoutPaddingPx.right).isEqualTo(72)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutPaddingPxBottom() {
|
||||
assertThat(dp.cellLayoutPaddingPx.bottom).isEqualTo(72)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun iconSizePx() {
|
||||
assertThat(dp.iconSizePx).isEqualTo(112)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun iconTextSizePx() {
|
||||
assertThat(dp.iconTextSizePx).isEqualTo(28)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun iconDrawablePaddingPx() {
|
||||
assertThat(dp.iconDrawablePaddingPx).isEqualTo(14)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellWidthPx() {
|
||||
assertThat(dp.folderCellWidthPx).isEqualTo(294)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellHeightPx() {
|
||||
assertThat(dp.folderCellHeightPx).isEqualTo(382)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderChildIconSizePx() {
|
||||
assertThat(dp.folderChildIconSizePx).isEqualTo(112)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderChildTextSizePx() {
|
||||
assertThat(dp.folderChildTextSizePx).isEqualTo(28)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderChildDrawablePaddingPx() {
|
||||
assertThat(dp.folderChildDrawablePaddingPx).isEqualTo(77)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellLayoutBorderSpaceOriginalPx() {
|
||||
assertThat(dp.folderCellLayoutBorderSpaceOriginalPx).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellLayoutBorderSpacePxX() {
|
||||
assertThat(dp.folderCellLayoutBorderSpacePx.x).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellLayoutBorderSpacePxY() {
|
||||
assertThat(dp.folderCellLayoutBorderSpacePx.y).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun bottomSheetTopPadding() {
|
||||
assertThat(dp.bottomSheetTopPadding).isEqualTo(600)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsShiftRange() {
|
||||
assertThat(dp.allAppsShiftRange).isEqualTo(1960)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsTopPadding() {
|
||||
assertThat(dp.allAppsTopPadding).isEqualTo(600)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsIconSizePx() {
|
||||
assertThat(dp.allAppsIconSizePx).isEqualTo(257)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsIconTextSizePx() {
|
||||
assertThat(dp.allAppsIconTextSizePx).isEqualTo(64)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsIconDrawablePaddingPx() {
|
||||
assertThat(dp.allAppsIconDrawablePaddingPx).isEqualTo(14)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsCellHeightPx() {
|
||||
assertThat(dp.allAppsCellHeightPx).isEqualTo(456)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsCellWidthPx() {
|
||||
assertThat(dp.allAppsCellWidthPx).isEqualTo(294)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsBorderSpacePxX() {
|
||||
assertThat(dp.allAppsBorderSpacePx.x).isEqualTo(74)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsBorderSpacePxY() {
|
||||
assertThat(dp.allAppsBorderSpacePx.y).isEqualTo(74)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun numShownAllAppsColumns() {
|
||||
assertThat(dp.numShownAllAppsColumns).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsLeftRightPadding() {
|
||||
assertThat(dp.allAppsLeftRightPadding).isEqualTo(56)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsLeftRightMargin() {
|
||||
assertThat(dp.allAppsLeftRightMargin).isEqualTo(781)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarSizePx() {
|
||||
assertThat(dp.hotseatBarSizePx).isEqualTo(386)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatCellHeightPx() {
|
||||
assertThat(dp.hotseatCellHeightPx).isEqualTo(126)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarBottomSpacePx() {
|
||||
assertThat(dp.hotseatBarBottomSpacePx).isEqualTo(116)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarSidePaddingStartPx() {
|
||||
assertThat(dp.hotseatBarSidePaddingStartPx).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarSidePaddingEndPx() {
|
||||
assertThat(dp.hotseatBarSidePaddingEndPx).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatQsbSpace() {
|
||||
assertThat(dp.hotseatQsbSpace).isEqualTo(56)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatQsbHeight() {
|
||||
assertThat(dp.hotseatQsbHeight).isEqualTo(126)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun springLoadedHotseatBarTopMarginPx() {
|
||||
assertThat(dp.springLoadedHotseatBarTopMarginPx).isEqualTo(216)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun numShownHotseatIcons() {
|
||||
assertThat(dp.numShownHotseatIcons).isEqualTo(4)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBorderSpace() {
|
||||
assertThat(dp.hotseatBorderSpace).isEqualTo(32)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isQsbInline() {
|
||||
assertThat(dp.isQsbInline).isEqualTo(false)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun qsbWidth() {
|
||||
assertThat(dp.qsbWidth).isEqualTo(1216)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isTaskbarPresent() {
|
||||
assertThat(dp.isTaskbarPresent).isEqualTo(true)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isTaskbarPresentInApps() {
|
||||
assertThat(dp.isTaskbarPresentInApps).isEqualTo(false)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun taskbarSize() {
|
||||
assertThat(dp.taskbarSize).isEqualTo(120)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun desiredWorkspaceHorizontalMarginPx() {
|
||||
assertThat(dp.desiredWorkspaceHorizontalMarginPx).isEqualTo(101)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspacePaddingLeft() {
|
||||
assertThat(dp.workspacePadding.left).isEqualTo(29)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspacePaddingTop() {
|
||||
assertThat(dp.workspacePadding.top).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspacePaddingRight() {
|
||||
assertThat(dp.workspacePadding.right).isEqualTo(29)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspacePaddingBottom() {
|
||||
assertThat(dp.workspacePadding.bottom).isEqualTo(238)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun iconScale() {
|
||||
assertThat(dp.iconScale).isEqualTo(1)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellScaleToFit() {
|
||||
assertThat(dp.cellScaleToFit).isEqualTo(2.2988505f)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspaceTopPadding() {
|
||||
assertThat(dp.workspaceTopPadding).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspaceBottomPadding() {
|
||||
assertThat(dp.workspaceBottomPadding).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskMarginPx() {
|
||||
assertThat(dp.overviewTaskMarginPx).isEqualTo(32)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskMarginGridPx() {
|
||||
assertThat(dp.overviewTaskMarginGridPx).isEqualTo(32)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskIconSizePx() {
|
||||
assertThat(dp.overviewTaskIconSizePx).isEqualTo(96)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskIconDrawableSizePx() {
|
||||
assertThat(dp.overviewTaskIconDrawableSizePx).isEqualTo(88)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskIconDrawableSizeGridPx() {
|
||||
assertThat(dp.overviewTaskIconDrawableSizeGridPx).isEqualTo(88)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskThumbnailTopMarginPx() {
|
||||
assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(160)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewActionsTopMarginPx() {
|
||||
assertThat(dp.overviewActionsTopMarginPx).isEqualTo(48)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewActionsHeight() {
|
||||
assertThat(dp.overviewActionsHeight).isEqualTo(96)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewActionsButtonSpacing() {
|
||||
assertThat(dp.overviewActionsButtonSpacing).isEqualTo(72)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewPageSpacing() {
|
||||
assertThat(dp.overviewPageSpacing).isEqualTo(88)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewRowSpacing() {
|
||||
assertThat(dp.overviewRowSpacing).isEqualTo(40)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewGridSideMargin() {
|
||||
assertThat(dp.overviewGridSideMargin).isEqualTo(128)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun dropTargetBarTopMarginPx() {
|
||||
assertThat(dp.dropTargetBarTopMarginPx).isEqualTo(220)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun dropTargetBarSizePx() {
|
||||
assertThat(dp.dropTargetBarSizePx).isEqualTo(144)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun dropTargetBarBottomMarginPx() {
|
||||
assertThat(dp.dropTargetBarBottomMarginPx).isEqualTo(96)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspaceSpringLoadedMinNextPageVisiblePx() {
|
||||
assertThat(dp.workspaceSpringLoadedMinNextPageVisiblePx).isEqualTo(48)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getWorkspaceSpringLoadScale() {
|
||||
assertThat(dp.workspaceSpringLoadScale).isEqualTo(0.6741674f)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellLayoutHeight() {
|
||||
assertThat(dp.cellLayoutHeight).isEqualTo(2222)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellLayoutWidth() {
|
||||
assertThat(dp.cellLayoutWidth).isEqualTo(1542)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getPanelCount() {
|
||||
assertThat(dp.panelCount).isEqualTo(1)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isVerticalBarLayout() {
|
||||
assertThat(dp.isVerticalBarLayout).isEqualTo(false)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellLayoutSpringLoadShrunkTop() {
|
||||
assertThat(dp.cellLayoutSpringLoadShrunkTop).isEqualTo(460)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellLayoutSpringLoadShrunkBottom() {
|
||||
assertThat(dp.cellLayoutSpringLoadShrunkBottom).isEqualTo(1958)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getQsbOffsetY() {
|
||||
assertThat(dp.qsbOffsetY).isEqualTo(272)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getTaskbarOffsetY() {
|
||||
assertThat(dp.taskbarOffsetY).isEqualTo(112)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getHotseatLayoutPaddingLeft() {
|
||||
assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(528)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getHotseatLayoutPaddingTop() {
|
||||
assertThat(dp.getHotseatLayoutPadding(context).top).isEqualTo(151)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getHotseatLayoutPaddingRight() {
|
||||
assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(528)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getHotseatLayoutPaddingBottom() {
|
||||
assertThat(dp.getHotseatLayoutPadding(context).bottom).isEqualTo(109)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarEndOffset() {
|
||||
assertThat(dp.hotseatBarEndOffset).isEqualTo(428)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,486 @@
|
||||
/*
|
||||
* 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.DeviceProfile
|
||||
import com.android.launcher3.DeviceProfileBaseTest
|
||||
import com.google.common.truth.Truth.assertThat
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
|
||||
/**
|
||||
* Tests for DeviceProfile for tablet in portrait.
|
||||
*/
|
||||
@SmallTest
|
||||
@RunWith(AndroidJUnit4::class)
|
||||
class DeviceProfileTabletPortraitTest : DeviceProfileBaseTest() {
|
||||
|
||||
lateinit var dp: DeviceProfile
|
||||
|
||||
@Before
|
||||
fun before() {
|
||||
initializeVarsForTablet()
|
||||
dp = newDP()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isScalableGrid() {
|
||||
assertThat(dp.isScalableGrid).isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellWidthPx() {
|
||||
assertThat(dp.cellWidthPx).isEqualTo(294)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellHeightPx() {
|
||||
assertThat(dp.cellHeightPx).isEqualTo(382)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellSizeX() {
|
||||
assertThat(dp.cellSize.x).isEqualTo(294)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellSizeY() {
|
||||
assertThat(dp.cellSize.y).isEqualTo(482)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutBorderSpacePxX() {
|
||||
assertThat(dp.cellLayoutBorderSpacePx.x).isEqualTo(74)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutBorderSpacePxY() {
|
||||
assertThat(dp.cellLayoutBorderSpacePx.y).isEqualTo(74)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutPaddingPxLeft() {
|
||||
assertThat(dp.cellLayoutPaddingPx.left).isEqualTo(72)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutPaddingPxTop() {
|
||||
assertThat(dp.cellLayoutPaddingPx.top).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutPaddingPxRight() {
|
||||
assertThat(dp.cellLayoutPaddingPx.right).isEqualTo(72)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutPaddingPxBottom() {
|
||||
assertThat(dp.cellLayoutPaddingPx.bottom).isEqualTo(72)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun iconSizePx() {
|
||||
assertThat(dp.iconSizePx).isEqualTo(112)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun iconTextSizePx() {
|
||||
assertThat(dp.iconTextSizePx).isEqualTo(28)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun iconDrawablePaddingPx() {
|
||||
assertThat(dp.iconDrawablePaddingPx).isEqualTo(14)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellWidthPx() {
|
||||
assertThat(dp.folderCellWidthPx).isEqualTo(294)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellHeightPx() {
|
||||
assertThat(dp.folderCellHeightPx).isEqualTo(382)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderChildIconSizePx() {
|
||||
assertThat(dp.folderChildIconSizePx).isEqualTo(112)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderChildTextSizePx() {
|
||||
assertThat(dp.folderChildTextSizePx).isEqualTo(28)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderChildDrawablePaddingPx() {
|
||||
assertThat(dp.folderChildDrawablePaddingPx).isEqualTo(77)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellLayoutBorderSpaceOriginalPx() {
|
||||
assertThat(dp.folderCellLayoutBorderSpaceOriginalPx).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellLayoutBorderSpacePxX() {
|
||||
assertThat(dp.folderCellLayoutBorderSpacePx.x).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellLayoutBorderSpacePxY() {
|
||||
assertThat(dp.folderCellLayoutBorderSpacePx.y).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun bottomSheetTopPadding() {
|
||||
assertThat(dp.bottomSheetTopPadding).isEqualTo(600)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsShiftRange() {
|
||||
assertThat(dp.allAppsShiftRange).isEqualTo(1960)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsTopPadding() {
|
||||
assertThat(dp.allAppsTopPadding).isEqualTo(600)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsIconSizePx() {
|
||||
assertThat(dp.allAppsIconSizePx).isEqualTo(257)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsIconTextSizePx() {
|
||||
assertThat(dp.allAppsIconTextSizePx).isEqualTo(64)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsIconDrawablePaddingPx() {
|
||||
assertThat(dp.allAppsIconDrawablePaddingPx).isEqualTo(14)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsCellHeightPx() {
|
||||
assertThat(dp.allAppsCellHeightPx).isEqualTo(456)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsCellWidthPx() {
|
||||
assertThat(dp.allAppsCellWidthPx).isEqualTo(294)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsBorderSpacePxX() {
|
||||
assertThat(dp.allAppsBorderSpacePx.x).isEqualTo(74)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsBorderSpacePxY() {
|
||||
assertThat(dp.allAppsBorderSpacePx.y).isEqualTo(74)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun numShownAllAppsColumns() {
|
||||
assertThat(dp.numShownAllAppsColumns).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsLeftRightPadding() {
|
||||
assertThat(dp.allAppsLeftRightPadding).isEqualTo(56)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsLeftRightMargin() {
|
||||
assertThat(dp.allAppsLeftRightMargin).isEqualTo(781)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarSizePx() {
|
||||
assertThat(dp.hotseatBarSizePx).isEqualTo(386)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatCellHeightPx() {
|
||||
assertThat(dp.hotseatCellHeightPx).isEqualTo(126)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarBottomSpacePx() {
|
||||
assertThat(dp.hotseatBarBottomSpacePx).isEqualTo(116)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarSidePaddingStartPx() {
|
||||
assertThat(dp.hotseatBarSidePaddingStartPx).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarSidePaddingEndPx() {
|
||||
assertThat(dp.hotseatBarSidePaddingEndPx).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatQsbSpace() {
|
||||
assertThat(dp.hotseatQsbSpace).isEqualTo(56)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatQsbHeight() {
|
||||
assertThat(dp.hotseatQsbHeight).isEqualTo(126)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun springLoadedHotseatBarTopMarginPx() {
|
||||
assertThat(dp.springLoadedHotseatBarTopMarginPx).isEqualTo(216)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun numShownHotseatIcons() {
|
||||
assertThat(dp.numShownHotseatIcons).isEqualTo(4)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBorderSpace() {
|
||||
assertThat(dp.hotseatBorderSpace).isEqualTo(256)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isQsbInline() {
|
||||
assertThat(dp.isQsbInline).isEqualTo(false)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun qsbWidth() {
|
||||
assertThat(dp.qsbWidth).isEqualTo(1216)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isTaskbarPresent() {
|
||||
assertThat(dp.isTaskbarPresent).isEqualTo(true)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isTaskbarPresentInApps() {
|
||||
assertThat(dp.isTaskbarPresentInApps).isEqualTo(false)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun taskbarSize() {
|
||||
assertThat(dp.taskbarSize).isEqualTo(120)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun desiredWorkspaceHorizontalMarginPx() {
|
||||
assertThat(dp.desiredWorkspaceHorizontalMarginPx).isEqualTo(101)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspacePaddingLeft() {
|
||||
assertThat(dp.workspacePadding.left).isEqualTo(29)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspacePaddingTop() {
|
||||
assertThat(dp.workspacePadding.top).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspacePaddingRight() {
|
||||
assertThat(dp.workspacePadding.right).isEqualTo(29)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspacePaddingBottom() {
|
||||
assertThat(dp.workspacePadding.bottom).isEqualTo(238)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun iconScale() {
|
||||
assertThat(dp.iconScale).isEqualTo(1)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellScaleToFit() {
|
||||
assertThat(dp.cellScaleToFit).isEqualTo(2.2988505f)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspaceTopPadding() {
|
||||
assertThat(dp.workspaceTopPadding).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspaceBottomPadding() {
|
||||
assertThat(dp.workspaceBottomPadding).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskMarginPx() {
|
||||
assertThat(dp.overviewTaskMarginPx).isEqualTo(32)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskMarginGridPx() {
|
||||
assertThat(dp.overviewTaskMarginGridPx).isEqualTo(32)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskIconSizePx() {
|
||||
assertThat(dp.overviewTaskIconSizePx).isEqualTo(96)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskIconDrawableSizePx() {
|
||||
assertThat(dp.overviewTaskIconDrawableSizePx).isEqualTo(88)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskIconDrawableSizeGridPx() {
|
||||
assertThat(dp.overviewTaskIconDrawableSizeGridPx).isEqualTo(88)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskThumbnailTopMarginPx() {
|
||||
assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(160)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewActionsTopMarginPx() {
|
||||
assertThat(dp.overviewActionsTopMarginPx).isEqualTo(48)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewActionsHeight() {
|
||||
assertThat(dp.overviewActionsHeight).isEqualTo(96)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewActionsButtonSpacing() {
|
||||
assertThat(dp.overviewActionsButtonSpacing).isEqualTo(72)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewPageSpacing() {
|
||||
assertThat(dp.overviewPageSpacing).isEqualTo(88)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewRowSpacing() {
|
||||
assertThat(dp.overviewRowSpacing).isEqualTo(40)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewGridSideMargin() {
|
||||
assertThat(dp.overviewGridSideMargin).isEqualTo(128)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun dropTargetBarTopMarginPx() {
|
||||
assertThat(dp.dropTargetBarTopMarginPx).isEqualTo(220)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun dropTargetBarSizePx() {
|
||||
assertThat(dp.dropTargetBarSizePx).isEqualTo(144)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun dropTargetBarBottomMarginPx() {
|
||||
assertThat(dp.dropTargetBarBottomMarginPx).isEqualTo(96)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspaceSpringLoadedMinNextPageVisiblePx() {
|
||||
assertThat(dp.workspaceSpringLoadedMinNextPageVisiblePx).isEqualTo(48)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getWorkspaceSpringLoadScale() {
|
||||
assertThat(dp.workspaceSpringLoadScale).isEqualTo(0.6741674f)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellLayoutHeight() {
|
||||
assertThat(dp.cellLayoutHeight).isEqualTo(2222)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellLayoutWidth() {
|
||||
assertThat(dp.cellLayoutWidth).isEqualTo(1542)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getPanelCount() {
|
||||
assertThat(dp.panelCount).isEqualTo(1)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isVerticalBarLayout() {
|
||||
assertThat(dp.isVerticalBarLayout).isEqualTo(false)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellLayoutSpringLoadShrunkTop() {
|
||||
assertThat(dp.cellLayoutSpringLoadShrunkTop).isEqualTo(460)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellLayoutSpringLoadShrunkBottom() {
|
||||
assertThat(dp.cellLayoutSpringLoadShrunkBottom).isEqualTo(1958)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getQsbOffsetY() {
|
||||
assertThat(dp.qsbOffsetY).isEqualTo(272)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getTaskbarOffsetY() {
|
||||
assertThat(dp.taskbarOffsetY).isEqualTo(112)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getHotseatLayoutPaddingLeft() {
|
||||
assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(192)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getHotseatLayoutPaddingTop() {
|
||||
assertThat(dp.getHotseatLayoutPadding(context).top).isEqualTo(151)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getHotseatLayoutPaddingRight() {
|
||||
assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(192)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getHotseatLayoutPaddingBottom() {
|
||||
assertThat(dp.getHotseatLayoutPadding(context).bottom).isEqualTo(109)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarEndOffset() {
|
||||
assertThat(dp.hotseatBarEndOffset).isEqualTo(0)
|
||||
}
|
||||
}
|
||||
+486
@@ -0,0 +1,486 @@
|
||||
/*
|
||||
* 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.DeviceProfile
|
||||
import com.android.launcher3.DeviceProfileBaseTest
|
||||
import com.google.common.truth.Truth.assertThat
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
|
||||
/**
|
||||
* Tests for DeviceProfile for two panel in landscape with 3-Button navigation.
|
||||
*/
|
||||
@SmallTest
|
||||
@RunWith(AndroidJUnit4::class)
|
||||
class DeviceProfileTwoPanelLandscape3ButtonTest : DeviceProfileBaseTest() {
|
||||
|
||||
lateinit var dp: DeviceProfile
|
||||
|
||||
@Before
|
||||
fun before() {
|
||||
initializeVarsForTablet(isLandscape = true, isTwoPanel = true, isGestureMode = false)
|
||||
dp = newDP()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isScalableGrid() {
|
||||
assertThat(dp.isScalableGrid).isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellWidthPx() {
|
||||
assertThat(dp.cellWidthPx).isEqualTo(200)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellHeightPx() {
|
||||
assertThat(dp.cellHeightPx).isEqualTo(260)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellSizeX() {
|
||||
assertThat(dp.cellSize.x).isEqualTo(259)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellSizeY() {
|
||||
assertThat(dp.cellSize.y).isEqualTo(260)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutBorderSpacePxX() {
|
||||
assertThat(dp.cellLayoutBorderSpacePx.x).isEqualTo(50)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutBorderSpacePxY() {
|
||||
assertThat(dp.cellLayoutBorderSpacePx.y).isEqualTo(50)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutPaddingPxLeft() {
|
||||
assertThat(dp.cellLayoutPaddingPx.left).isEqualTo(25)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutPaddingPxTop() {
|
||||
assertThat(dp.cellLayoutPaddingPx.top).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutPaddingPxRight() {
|
||||
assertThat(dp.cellLayoutPaddingPx.right).isEqualTo(25)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutPaddingPxBottom() {
|
||||
assertThat(dp.cellLayoutPaddingPx.bottom).isEqualTo(25)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun iconSizePx() {
|
||||
assertThat(dp.iconSizePx).isEqualTo(112)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun iconTextSizePx() {
|
||||
assertThat(dp.iconTextSizePx).isEqualTo(28)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun iconDrawablePaddingPx() {
|
||||
assertThat(dp.iconDrawablePaddingPx).isEqualTo(14)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellWidthPx() {
|
||||
assertThat(dp.folderCellWidthPx).isEqualTo(200)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellHeightPx() {
|
||||
assertThat(dp.folderCellHeightPx).isEqualTo(260)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderChildIconSizePx() {
|
||||
assertThat(dp.folderChildIconSizePx).isEqualTo(112)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderChildTextSizePx() {
|
||||
assertThat(dp.folderChildTextSizePx).isEqualTo(28)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderChildDrawablePaddingPx() {
|
||||
assertThat(dp.folderChildDrawablePaddingPx).isEqualTo(36)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellLayoutBorderSpaceOriginalPx() {
|
||||
assertThat(dp.folderCellLayoutBorderSpaceOriginalPx).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellLayoutBorderSpacePxX() {
|
||||
assertThat(dp.folderCellLayoutBorderSpacePx.x).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellLayoutBorderSpacePxY() {
|
||||
assertThat(dp.folderCellLayoutBorderSpacePx.y).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun bottomSheetTopPadding() {
|
||||
assertThat(dp.bottomSheetTopPadding).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsShiftRange() {
|
||||
assertThat(dp.allAppsShiftRange).isEqualTo(1600)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsTopPadding() {
|
||||
assertThat(dp.allAppsTopPadding).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsIconSizePx() {
|
||||
assertThat(dp.allAppsIconSizePx).isEqualTo(175)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsIconTextSizePx() {
|
||||
assertThat(dp.allAppsIconTextSizePx).isEqualTo(44)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsIconDrawablePaddingPx() {
|
||||
assertThat(dp.allAppsIconDrawablePaddingPx).isEqualTo(14)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsCellHeightPx() {
|
||||
assertThat(dp.allAppsCellHeightPx).isEqualTo(310)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsCellWidthPx() {
|
||||
assertThat(dp.allAppsCellWidthPx).isEqualTo(200)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsBorderSpacePxX() {
|
||||
assertThat(dp.allAppsBorderSpacePx.x).isEqualTo(50)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsBorderSpacePxY() {
|
||||
assertThat(dp.allAppsBorderSpacePx.y).isEqualTo(50)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun numShownAllAppsColumns() {
|
||||
assertThat(dp.numShownAllAppsColumns).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsLeftRightPadding() {
|
||||
assertThat(dp.allAppsLeftRightPadding).isEqualTo(64)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsLeftRightMargin() {
|
||||
assertThat(dp.allAppsLeftRightMargin).isEqualTo(1241)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarSizePx() {
|
||||
assertThat(dp.hotseatBarSizePx).isEqualTo(386)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatCellHeightPx() {
|
||||
assertThat(dp.hotseatCellHeightPx).isEqualTo(126)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarBottomSpacePx() {
|
||||
assertThat(dp.hotseatBarBottomSpacePx).isEqualTo(116)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarSidePaddingStartPx() {
|
||||
assertThat(dp.hotseatBarSidePaddingStartPx).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarSidePaddingEndPx() {
|
||||
assertThat(dp.hotseatBarSidePaddingEndPx).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatQsbSpace() {
|
||||
assertThat(dp.hotseatQsbSpace).isEqualTo(56)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatQsbHeight() {
|
||||
assertThat(dp.hotseatQsbHeight).isEqualTo(126)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun springLoadedHotseatBarTopMarginPx() {
|
||||
assertThat(dp.springLoadedHotseatBarTopMarginPx).isEqualTo(128)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun numShownHotseatIcons() {
|
||||
assertThat(dp.numShownHotseatIcons).isEqualTo(6)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBorderSpace() {
|
||||
assertThat(dp.hotseatBorderSpace).isEqualTo(32)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isQsbInline() {
|
||||
assertThat(dp.isQsbInline).isEqualTo(false)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun qsbWidth() {
|
||||
assertThat(dp.qsbWidth).isEqualTo(1039)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isTaskbarPresent() {
|
||||
assertThat(dp.isTaskbarPresent).isEqualTo(true)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isTaskbarPresentInApps() {
|
||||
assertThat(dp.isTaskbarPresentInApps).isEqualTo(false)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun taskbarSize() {
|
||||
assertThat(dp.taskbarSize).isEqualTo(120)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun desiredWorkspaceHorizontalMarginPx() {
|
||||
assertThat(dp.desiredWorkspaceHorizontalMarginPx).isEqualTo(68)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspacePaddingLeft() {
|
||||
assertThat(dp.workspacePadding.left).isEqualTo(43)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspacePaddingTop() {
|
||||
assertThat(dp.workspacePadding.top).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspacePaddingRight() {
|
||||
assertThat(dp.workspacePadding.right).isEqualTo(43)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspacePaddingBottom() {
|
||||
assertThat(dp.workspacePadding.bottom).isEqualTo(285)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun iconScale() {
|
||||
assertThat(dp.iconScale).isEqualTo(1)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellScaleToFit() {
|
||||
assertThat(dp.cellScaleToFit).isEqualTo(1.5657895f)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspaceTopPadding() {
|
||||
assertThat(dp.workspaceTopPadding).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspaceBottomPadding() {
|
||||
assertThat(dp.workspaceBottomPadding).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskMarginPx() {
|
||||
assertThat(dp.overviewTaskMarginPx).isEqualTo(32)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskMarginGridPx() {
|
||||
assertThat(dp.overviewTaskMarginGridPx).isEqualTo(32)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskIconSizePx() {
|
||||
assertThat(dp.overviewTaskIconSizePx).isEqualTo(96)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskIconDrawableSizePx() {
|
||||
assertThat(dp.overviewTaskIconDrawableSizePx).isEqualTo(88)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskIconDrawableSizeGridPx() {
|
||||
assertThat(dp.overviewTaskIconDrawableSizeGridPx).isEqualTo(88)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskThumbnailTopMarginPx() {
|
||||
assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(160)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewActionsTopMarginPx() {
|
||||
assertThat(dp.overviewActionsTopMarginPx).isEqualTo(40)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewActionsHeight() {
|
||||
assertThat(dp.overviewActionsHeight).isEqualTo(96)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewActionsButtonSpacing() {
|
||||
assertThat(dp.overviewActionsButtonSpacing).isEqualTo(72)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewPageSpacing() {
|
||||
assertThat(dp.overviewPageSpacing).isEqualTo(88)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewRowSpacing() {
|
||||
assertThat(dp.overviewRowSpacing).isEqualTo(40)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewGridSideMargin() {
|
||||
assertThat(dp.overviewGridSideMargin).isEqualTo(128)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun dropTargetBarTopMarginPx() {
|
||||
assertThat(dp.dropTargetBarTopMarginPx).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun dropTargetBarSizePx() {
|
||||
assertThat(dp.dropTargetBarSizePx).isEqualTo(144)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun dropTargetBarBottomMarginPx() {
|
||||
assertThat(dp.dropTargetBarBottomMarginPx).isEqualTo(64)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspaceSpringLoadedMinNextPageVisiblePx() {
|
||||
assertThat(dp.workspaceSpringLoadedMinNextPageVisiblePx).isEqualTo(48)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getWorkspaceSpringLoadScale() {
|
||||
assertThat(dp.workspaceSpringLoadScale).isEqualTo(0.7226337f)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellLayoutHeight() {
|
||||
assertThat(dp.cellLayoutHeight).isEqualTo(1215)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellLayoutWidth() {
|
||||
assertThat(dp.cellLayoutWidth).isEqualTo(1237)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getPanelCount() {
|
||||
assertThat(dp.panelCount).isEqualTo(2)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isVerticalBarLayout() {
|
||||
assertThat(dp.isVerticalBarLayout).isEqualTo(false)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellLayoutSpringLoadShrunkTop() {
|
||||
assertThat(dp.cellLayoutSpringLoadShrunkTop).isEqualTo(208)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellLayoutSpringLoadShrunkBottom() {
|
||||
assertThat(dp.cellLayoutSpringLoadShrunkBottom).isEqualTo(1086)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getQsbOffsetY() {
|
||||
assertThat(dp.qsbOffsetY).isEqualTo(272)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getTaskbarOffsetY() {
|
||||
assertThat(dp.taskbarOffsetY).isEqualTo(112)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getHotseatLayoutPaddingLeft() {
|
||||
assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(864)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getHotseatLayoutPaddingTop() {
|
||||
assertThat(dp.getHotseatLayoutPadding(context).top).isEqualTo(151)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getHotseatLayoutPaddingRight() {
|
||||
assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(864)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getHotseatLayoutPaddingBottom() {
|
||||
assertThat(dp.getHotseatLayoutPadding(context).bottom).isEqualTo(109)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarEndOffset() {
|
||||
assertThat(dp.hotseatBarEndOffset).isEqualTo(428)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,486 @@
|
||||
/*
|
||||
* 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.DeviceProfile
|
||||
import com.android.launcher3.DeviceProfileBaseTest
|
||||
import com.google.common.truth.Truth.assertThat
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
|
||||
/**
|
||||
* Tests for DeviceProfile for two panel in landscape.
|
||||
*/
|
||||
@SmallTest
|
||||
@RunWith(AndroidJUnit4::class)
|
||||
class DeviceProfileTwoPanelLandscapeTest : DeviceProfileBaseTest() {
|
||||
|
||||
lateinit var dp: DeviceProfile
|
||||
|
||||
@Before
|
||||
fun before() {
|
||||
initializeVarsForTablet(isLandscape = true, isTwoPanel = true)
|
||||
dp = newDP()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isScalableGrid() {
|
||||
assertThat(dp.isScalableGrid).isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellWidthPx() {
|
||||
assertThat(dp.cellWidthPx).isEqualTo(200)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellHeightPx() {
|
||||
assertThat(dp.cellHeightPx).isEqualTo(260)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellSizeX() {
|
||||
assertThat(dp.cellSize.x).isEqualTo(259)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellSizeY() {
|
||||
assertThat(dp.cellSize.y).isEqualTo(260)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutBorderSpacePxX() {
|
||||
assertThat(dp.cellLayoutBorderSpacePx.x).isEqualTo(50)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutBorderSpacePxY() {
|
||||
assertThat(dp.cellLayoutBorderSpacePx.y).isEqualTo(50)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutPaddingPxLeft() {
|
||||
assertThat(dp.cellLayoutPaddingPx.left).isEqualTo(25)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutPaddingPxTop() {
|
||||
assertThat(dp.cellLayoutPaddingPx.top).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutPaddingPxRight() {
|
||||
assertThat(dp.cellLayoutPaddingPx.right).isEqualTo(25)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutPaddingPxBottom() {
|
||||
assertThat(dp.cellLayoutPaddingPx.bottom).isEqualTo(25)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun iconSizePx() {
|
||||
assertThat(dp.iconSizePx).isEqualTo(112)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun iconTextSizePx() {
|
||||
assertThat(dp.iconTextSizePx).isEqualTo(28)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun iconDrawablePaddingPx() {
|
||||
assertThat(dp.iconDrawablePaddingPx).isEqualTo(14)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellWidthPx() {
|
||||
assertThat(dp.folderCellWidthPx).isEqualTo(200)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellHeightPx() {
|
||||
assertThat(dp.folderCellHeightPx).isEqualTo(260)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderChildIconSizePx() {
|
||||
assertThat(dp.folderChildIconSizePx).isEqualTo(112)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderChildTextSizePx() {
|
||||
assertThat(dp.folderChildTextSizePx).isEqualTo(28)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderChildDrawablePaddingPx() {
|
||||
assertThat(dp.folderChildDrawablePaddingPx).isEqualTo(36)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellLayoutBorderSpaceOriginalPx() {
|
||||
assertThat(dp.folderCellLayoutBorderSpaceOriginalPx).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellLayoutBorderSpacePxX() {
|
||||
assertThat(dp.folderCellLayoutBorderSpacePx.x).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellLayoutBorderSpacePxY() {
|
||||
assertThat(dp.folderCellLayoutBorderSpacePx.y).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun bottomSheetTopPadding() {
|
||||
assertThat(dp.bottomSheetTopPadding).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsShiftRange() {
|
||||
assertThat(dp.allAppsShiftRange).isEqualTo(1600)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsTopPadding() {
|
||||
assertThat(dp.allAppsTopPadding).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsIconSizePx() {
|
||||
assertThat(dp.allAppsIconSizePx).isEqualTo(175)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsIconTextSizePx() {
|
||||
assertThat(dp.allAppsIconTextSizePx).isEqualTo(44)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsIconDrawablePaddingPx() {
|
||||
assertThat(dp.allAppsIconDrawablePaddingPx).isEqualTo(14)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsCellHeightPx() {
|
||||
assertThat(dp.allAppsCellHeightPx).isEqualTo(310)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsCellWidthPx() {
|
||||
assertThat(dp.allAppsCellWidthPx).isEqualTo(200)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsBorderSpacePxX() {
|
||||
assertThat(dp.allAppsBorderSpacePx.x).isEqualTo(50)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsBorderSpacePxY() {
|
||||
assertThat(dp.allAppsBorderSpacePx.y).isEqualTo(50)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun numShownAllAppsColumns() {
|
||||
assertThat(dp.numShownAllAppsColumns).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsLeftRightPadding() {
|
||||
assertThat(dp.allAppsLeftRightPadding).isEqualTo(64)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsLeftRightMargin() {
|
||||
assertThat(dp.allAppsLeftRightMargin).isEqualTo(1241)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarSizePx() {
|
||||
assertThat(dp.hotseatBarSizePx).isEqualTo(386)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatCellHeightPx() {
|
||||
assertThat(dp.hotseatCellHeightPx).isEqualTo(126)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarBottomSpacePx() {
|
||||
assertThat(dp.hotseatBarBottomSpacePx).isEqualTo(116)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarSidePaddingStartPx() {
|
||||
assertThat(dp.hotseatBarSidePaddingStartPx).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarSidePaddingEndPx() {
|
||||
assertThat(dp.hotseatBarSidePaddingEndPx).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatQsbSpace() {
|
||||
assertThat(dp.hotseatQsbSpace).isEqualTo(56)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatQsbHeight() {
|
||||
assertThat(dp.hotseatQsbHeight).isEqualTo(126)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun springLoadedHotseatBarTopMarginPx() {
|
||||
assertThat(dp.springLoadedHotseatBarTopMarginPx).isEqualTo(128)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun numShownHotseatIcons() {
|
||||
assertThat(dp.numShownHotseatIcons).isEqualTo(6)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBorderSpace() {
|
||||
assertThat(dp.hotseatBorderSpace).isEqualTo(73)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isQsbInline() {
|
||||
assertThat(dp.isQsbInline).isEqualTo(false)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun qsbWidth() {
|
||||
assertThat(dp.qsbWidth).isEqualTo(1039)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isTaskbarPresent() {
|
||||
assertThat(dp.isTaskbarPresent).isEqualTo(true)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isTaskbarPresentInApps() {
|
||||
assertThat(dp.isTaskbarPresentInApps).isEqualTo(false)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun taskbarSize() {
|
||||
assertThat(dp.taskbarSize).isEqualTo(120)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun desiredWorkspaceHorizontalMarginPx() {
|
||||
assertThat(dp.desiredWorkspaceHorizontalMarginPx).isEqualTo(68)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspacePaddingLeft() {
|
||||
assertThat(dp.workspacePadding.left).isEqualTo(43)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspacePaddingTop() {
|
||||
assertThat(dp.workspacePadding.top).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspacePaddingRight() {
|
||||
assertThat(dp.workspacePadding.right).isEqualTo(43)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspacePaddingBottom() {
|
||||
assertThat(dp.workspacePadding.bottom).isEqualTo(285)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun iconScale() {
|
||||
assertThat(dp.iconScale).isEqualTo(1)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellScaleToFit() {
|
||||
assertThat(dp.cellScaleToFit).isEqualTo(1.5657895f)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspaceTopPadding() {
|
||||
assertThat(dp.workspaceTopPadding).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspaceBottomPadding() {
|
||||
assertThat(dp.workspaceBottomPadding).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskMarginPx() {
|
||||
assertThat(dp.overviewTaskMarginPx).isEqualTo(32)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskMarginGridPx() {
|
||||
assertThat(dp.overviewTaskMarginGridPx).isEqualTo(32)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskIconSizePx() {
|
||||
assertThat(dp.overviewTaskIconSizePx).isEqualTo(96)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskIconDrawableSizePx() {
|
||||
assertThat(dp.overviewTaskIconDrawableSizePx).isEqualTo(88)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskIconDrawableSizeGridPx() {
|
||||
assertThat(dp.overviewTaskIconDrawableSizeGridPx).isEqualTo(88)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskThumbnailTopMarginPx() {
|
||||
assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(160)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewActionsTopMarginPx() {
|
||||
assertThat(dp.overviewActionsTopMarginPx).isEqualTo(40)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewActionsHeight() {
|
||||
assertThat(dp.overviewActionsHeight).isEqualTo(96)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewActionsButtonSpacing() {
|
||||
assertThat(dp.overviewActionsButtonSpacing).isEqualTo(72)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewPageSpacing() {
|
||||
assertThat(dp.overviewPageSpacing).isEqualTo(88)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewRowSpacing() {
|
||||
assertThat(dp.overviewRowSpacing).isEqualTo(40)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewGridSideMargin() {
|
||||
assertThat(dp.overviewGridSideMargin).isEqualTo(128)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun dropTargetBarTopMarginPx() {
|
||||
assertThat(dp.dropTargetBarTopMarginPx).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun dropTargetBarSizePx() {
|
||||
assertThat(dp.dropTargetBarSizePx).isEqualTo(144)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun dropTargetBarBottomMarginPx() {
|
||||
assertThat(dp.dropTargetBarBottomMarginPx).isEqualTo(64)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspaceSpringLoadedMinNextPageVisiblePx() {
|
||||
assertThat(dp.workspaceSpringLoadedMinNextPageVisiblePx).isEqualTo(48)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getWorkspaceSpringLoadScale() {
|
||||
assertThat(dp.workspaceSpringLoadScale).isEqualTo(0.7226337f)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellLayoutHeight() {
|
||||
assertThat(dp.cellLayoutHeight).isEqualTo(1215)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellLayoutWidth() {
|
||||
assertThat(dp.cellLayoutWidth).isEqualTo(1237)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getPanelCount() {
|
||||
assertThat(dp.panelCount).isEqualTo(2)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isVerticalBarLayout() {
|
||||
assertThat(dp.isVerticalBarLayout).isEqualTo(false)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellLayoutSpringLoadShrunkTop() {
|
||||
assertThat(dp.cellLayoutSpringLoadShrunkTop).isEqualTo(208)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellLayoutSpringLoadShrunkBottom() {
|
||||
assertThat(dp.cellLayoutSpringLoadShrunkBottom).isEqualTo(1086)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getQsbOffsetY() {
|
||||
assertThat(dp.qsbOffsetY).isEqualTo(272)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getTaskbarOffsetY() {
|
||||
assertThat(dp.taskbarOffsetY).isEqualTo(112)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getHotseatLayoutPaddingLeft() {
|
||||
assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(761)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getHotseatLayoutPaddingTop() {
|
||||
assertThat(dp.getHotseatLayoutPadding(context).top).isEqualTo(151)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getHotseatLayoutPaddingRight() {
|
||||
assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(761)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getHotseatLayoutPaddingBottom() {
|
||||
assertThat(dp.getHotseatLayoutPadding(context).bottom).isEqualTo(109)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarEndOffset() {
|
||||
assertThat(dp.hotseatBarEndOffset).isEqualTo(0)
|
||||
}
|
||||
}
|
||||
+486
@@ -0,0 +1,486 @@
|
||||
/*
|
||||
* 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.DeviceProfile
|
||||
import com.android.launcher3.DeviceProfileBaseTest
|
||||
import com.google.common.truth.Truth.assertThat
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
|
||||
/**
|
||||
* Tests for DeviceProfile for two panel in portrait with 3-Button navigation.
|
||||
*/
|
||||
@SmallTest
|
||||
@RunWith(AndroidJUnit4::class)
|
||||
class DeviceProfileTwoPanelPortrait3ButtonTest : DeviceProfileBaseTest() {
|
||||
|
||||
lateinit var dp: DeviceProfile
|
||||
|
||||
@Before
|
||||
fun before() {
|
||||
initializeVarsForTablet(isTwoPanel = true, isGestureMode = false)
|
||||
dp = newDP()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isScalableGrid() {
|
||||
assertThat(dp.isScalableGrid).isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellWidthPx() {
|
||||
assertThat(dp.cellWidthPx).isEqualTo(153)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellHeightPx() {
|
||||
assertThat(dp.cellHeightPx).isEqualTo(199)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellSizeX() {
|
||||
assertThat(dp.cellSize.x).isEqualTo(153)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellSizeY() {
|
||||
assertThat(dp.cellSize.y).isEqualTo(509)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutBorderSpacePxX() {
|
||||
assertThat(dp.cellLayoutBorderSpacePx.x).isEqualTo(38)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutBorderSpacePxY() {
|
||||
assertThat(dp.cellLayoutBorderSpacePx.y).isEqualTo(38)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutPaddingPxLeft() {
|
||||
assertThat(dp.cellLayoutPaddingPx.left).isEqualTo(19)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutPaddingPxTop() {
|
||||
assertThat(dp.cellLayoutPaddingPx.top).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutPaddingPxRight() {
|
||||
assertThat(dp.cellLayoutPaddingPx.right).isEqualTo(19)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutPaddingPxBottom() {
|
||||
assertThat(dp.cellLayoutPaddingPx.bottom).isEqualTo(19)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun iconSizePx() {
|
||||
assertThat(dp.iconSizePx).isEqualTo(112)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun iconTextSizePx() {
|
||||
assertThat(dp.iconTextSizePx).isEqualTo(28)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun iconDrawablePaddingPx() {
|
||||
assertThat(dp.iconDrawablePaddingPx).isEqualTo(14)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellWidthPx() {
|
||||
assertThat(dp.folderCellWidthPx).isEqualTo(153)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellHeightPx() {
|
||||
assertThat(dp.folderCellHeightPx).isEqualTo(199)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderChildIconSizePx() {
|
||||
assertThat(dp.folderChildIconSizePx).isEqualTo(112)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderChildTextSizePx() {
|
||||
assertThat(dp.folderChildTextSizePx).isEqualTo(28)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderChildDrawablePaddingPx() {
|
||||
assertThat(dp.folderChildDrawablePaddingPx).isEqualTo(16)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellLayoutBorderSpaceOriginalPx() {
|
||||
assertThat(dp.folderCellLayoutBorderSpaceOriginalPx).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellLayoutBorderSpacePxX() {
|
||||
assertThat(dp.folderCellLayoutBorderSpacePx.x).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellLayoutBorderSpacePxY() {
|
||||
assertThat(dp.folderCellLayoutBorderSpacePx.y).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun bottomSheetTopPadding() {
|
||||
assertThat(dp.bottomSheetTopPadding).isEqualTo(600)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsShiftRange() {
|
||||
assertThat(dp.allAppsShiftRange).isEqualTo(1960)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsTopPadding() {
|
||||
assertThat(dp.allAppsTopPadding).isEqualTo(600)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsIconSizePx() {
|
||||
assertThat(dp.allAppsIconSizePx).isEqualTo(134)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsIconTextSizePx() {
|
||||
assertThat(dp.allAppsIconTextSizePx).isEqualTo(34)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsIconDrawablePaddingPx() {
|
||||
assertThat(dp.allAppsIconDrawablePaddingPx).isEqualTo(14)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsCellHeightPx() {
|
||||
assertThat(dp.allAppsCellHeightPx).isEqualTo(237)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsCellWidthPx() {
|
||||
assertThat(dp.allAppsCellWidthPx).isEqualTo(153)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsBorderSpacePxX() {
|
||||
assertThat(dp.allAppsBorderSpacePx.x).isEqualTo(38)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsBorderSpacePxY() {
|
||||
assertThat(dp.allAppsBorderSpacePx.y).isEqualTo(38)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun numShownAllAppsColumns() {
|
||||
assertThat(dp.numShownAllAppsColumns).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsLeftRightPadding() {
|
||||
assertThat(dp.allAppsLeftRightPadding).isEqualTo(56)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsLeftRightMargin() {
|
||||
assertThat(dp.allAppsLeftRightMargin).isEqualTo(763)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarSizePx() {
|
||||
assertThat(dp.hotseatBarSizePx).isEqualTo(386)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatCellHeightPx() {
|
||||
assertThat(dp.hotseatCellHeightPx).isEqualTo(126)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarBottomSpacePx() {
|
||||
assertThat(dp.hotseatBarBottomSpacePx).isEqualTo(116)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarSidePaddingStartPx() {
|
||||
assertThat(dp.hotseatBarSidePaddingStartPx).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarSidePaddingEndPx() {
|
||||
assertThat(dp.hotseatBarSidePaddingEndPx).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatQsbSpace() {
|
||||
assertThat(dp.hotseatQsbSpace).isEqualTo(56)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatQsbHeight() {
|
||||
assertThat(dp.hotseatQsbHeight).isEqualTo(126)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun springLoadedHotseatBarTopMarginPx() {
|
||||
assertThat(dp.springLoadedHotseatBarTopMarginPx).isEqualTo(216)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun numShownHotseatIcons() {
|
||||
assertThat(dp.numShownHotseatIcons).isEqualTo(6)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBorderSpace() {
|
||||
assertThat(dp.hotseatBorderSpace).isEqualTo(32)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isQsbInline() {
|
||||
assertThat(dp.isQsbInline).isEqualTo(false)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun qsbWidth() {
|
||||
assertThat(dp.qsbWidth).isEqualTo(685)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isTaskbarPresent() {
|
||||
assertThat(dp.isTaskbarPresent).isEqualTo(true)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isTaskbarPresentInApps() {
|
||||
assertThat(dp.isTaskbarPresentInApps).isEqualTo(false)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun taskbarSize() {
|
||||
assertThat(dp.taskbarSize).isEqualTo(120)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun desiredWorkspaceHorizontalMarginPx() {
|
||||
assertThat(dp.desiredWorkspaceHorizontalMarginPx).isEqualTo(52)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspacePaddingLeft() {
|
||||
assertThat(dp.workspacePadding.left).isEqualTo(33)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspacePaddingTop() {
|
||||
assertThat(dp.workspacePadding.top).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspacePaddingRight() {
|
||||
assertThat(dp.workspacePadding.right).isEqualTo(33)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspacePaddingBottom() {
|
||||
assertThat(dp.workspacePadding.bottom).isEqualTo(291)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun iconScale() {
|
||||
assertThat(dp.iconScale).isEqualTo(1)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellScaleToFit() {
|
||||
assertThat(dp.cellScaleToFit).isEqualTo(1.1976048f)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspaceTopPadding() {
|
||||
assertThat(dp.workspaceTopPadding).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspaceBottomPadding() {
|
||||
assertThat(dp.workspaceBottomPadding).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskMarginPx() {
|
||||
assertThat(dp.overviewTaskMarginPx).isEqualTo(32)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskMarginGridPx() {
|
||||
assertThat(dp.overviewTaskMarginGridPx).isEqualTo(32)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskIconSizePx() {
|
||||
assertThat(dp.overviewTaskIconSizePx).isEqualTo(96)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskIconDrawableSizePx() {
|
||||
assertThat(dp.overviewTaskIconDrawableSizePx).isEqualTo(88)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskIconDrawableSizeGridPx() {
|
||||
assertThat(dp.overviewTaskIconDrawableSizeGridPx).isEqualTo(88)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskThumbnailTopMarginPx() {
|
||||
assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(160)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewActionsTopMarginPx() {
|
||||
assertThat(dp.overviewActionsTopMarginPx).isEqualTo(48)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewActionsHeight() {
|
||||
assertThat(dp.overviewActionsHeight).isEqualTo(96)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewActionsButtonSpacing() {
|
||||
assertThat(dp.overviewActionsButtonSpacing).isEqualTo(72)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewPageSpacing() {
|
||||
assertThat(dp.overviewPageSpacing).isEqualTo(88)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewRowSpacing() {
|
||||
assertThat(dp.overviewRowSpacing).isEqualTo(40)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewGridSideMargin() {
|
||||
assertThat(dp.overviewGridSideMargin).isEqualTo(128)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun dropTargetBarTopMarginPx() {
|
||||
assertThat(dp.dropTargetBarTopMarginPx).isEqualTo(220)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun dropTargetBarSizePx() {
|
||||
assertThat(dp.dropTargetBarSizePx).isEqualTo(144)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun dropTargetBarBottomMarginPx() {
|
||||
assertThat(dp.dropTargetBarBottomMarginPx).isEqualTo(96)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspaceSpringLoadedMinNextPageVisiblePx() {
|
||||
assertThat(dp.workspaceSpringLoadedMinNextPageVisiblePx).isEqualTo(48)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getWorkspaceSpringLoadScale() {
|
||||
assertThat(dp.workspaceSpringLoadScale).isEqualTo(0.69064087f)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellLayoutHeight() {
|
||||
assertThat(dp.cellLayoutHeight).isEqualTo(2169)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellLayoutWidth() {
|
||||
assertThat(dp.cellLayoutWidth).isEqualTo(767)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getPanelCount() {
|
||||
assertThat(dp.panelCount).isEqualTo(2)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isVerticalBarLayout() {
|
||||
assertThat(dp.isVerticalBarLayout).isEqualTo(false)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellLayoutSpringLoadShrunkTop() {
|
||||
assertThat(dp.cellLayoutSpringLoadShrunkTop).isEqualTo(460)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellLayoutSpringLoadShrunkBottom() {
|
||||
assertThat(dp.cellLayoutSpringLoadShrunkBottom).isEqualTo(1958)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getQsbOffsetY() {
|
||||
assertThat(dp.qsbOffsetY).isEqualTo(272)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getTaskbarOffsetY() {
|
||||
assertThat(dp.taskbarOffsetY).isEqualTo(112)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getHotseatLayoutPaddingLeft() {
|
||||
assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(340)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getHotseatLayoutPaddingTop() {
|
||||
assertThat(dp.getHotseatLayoutPadding(context).top).isEqualTo(151)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getHotseatLayoutPaddingRight() {
|
||||
assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(428)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getHotseatLayoutPaddingBottom() {
|
||||
assertThat(dp.getHotseatLayoutPadding(context).bottom).isEqualTo(109)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarEndOffset() {
|
||||
assertThat(dp.hotseatBarEndOffset).isEqualTo(428)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,486 @@
|
||||
/*
|
||||
* 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.DeviceProfile
|
||||
import com.android.launcher3.DeviceProfileBaseTest
|
||||
import com.google.common.truth.Truth.assertThat
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
|
||||
/**
|
||||
* Tests for DeviceProfile for two panel in portrait.
|
||||
*/
|
||||
@SmallTest
|
||||
@RunWith(AndroidJUnit4::class)
|
||||
class DeviceProfileTwoPanelPortraitTest : DeviceProfileBaseTest() {
|
||||
|
||||
lateinit var dp: DeviceProfile
|
||||
|
||||
@Before
|
||||
fun before() {
|
||||
initializeVarsForTablet(isTwoPanel = true)
|
||||
dp = newDP()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isScalableGrid() {
|
||||
assertThat(dp.isScalableGrid).isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellWidthPx() {
|
||||
assertThat(dp.cellWidthPx).isEqualTo(153)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellHeightPx() {
|
||||
assertThat(dp.cellHeightPx).isEqualTo(199)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellSizeX() {
|
||||
assertThat(dp.cellSize.x).isEqualTo(153)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellSizeY() {
|
||||
assertThat(dp.cellSize.y).isEqualTo(509)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutBorderSpacePxX() {
|
||||
assertThat(dp.cellLayoutBorderSpacePx.x).isEqualTo(38)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutBorderSpacePxY() {
|
||||
assertThat(dp.cellLayoutBorderSpacePx.y).isEqualTo(38)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutPaddingPxLeft() {
|
||||
assertThat(dp.cellLayoutPaddingPx.left).isEqualTo(19)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutPaddingPxTop() {
|
||||
assertThat(dp.cellLayoutPaddingPx.top).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutPaddingPxRight() {
|
||||
assertThat(dp.cellLayoutPaddingPx.right).isEqualTo(19)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutPaddingPxBottom() {
|
||||
assertThat(dp.cellLayoutPaddingPx.bottom).isEqualTo(19)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun iconSizePx() {
|
||||
assertThat(dp.iconSizePx).isEqualTo(112)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun iconTextSizePx() {
|
||||
assertThat(dp.iconTextSizePx).isEqualTo(28)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun iconDrawablePaddingPx() {
|
||||
assertThat(dp.iconDrawablePaddingPx).isEqualTo(14)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellWidthPx() {
|
||||
assertThat(dp.folderCellWidthPx).isEqualTo(153)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellHeightPx() {
|
||||
assertThat(dp.folderCellHeightPx).isEqualTo(199)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderChildIconSizePx() {
|
||||
assertThat(dp.folderChildIconSizePx).isEqualTo(112)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderChildTextSizePx() {
|
||||
assertThat(dp.folderChildTextSizePx).isEqualTo(28)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderChildDrawablePaddingPx() {
|
||||
assertThat(dp.folderChildDrawablePaddingPx).isEqualTo(16)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellLayoutBorderSpaceOriginalPx() {
|
||||
assertThat(dp.folderCellLayoutBorderSpaceOriginalPx).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellLayoutBorderSpacePxX() {
|
||||
assertThat(dp.folderCellLayoutBorderSpacePx.x).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellLayoutBorderSpacePxY() {
|
||||
assertThat(dp.folderCellLayoutBorderSpacePx.y).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun bottomSheetTopPadding() {
|
||||
assertThat(dp.bottomSheetTopPadding).isEqualTo(600)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsShiftRange() {
|
||||
assertThat(dp.allAppsShiftRange).isEqualTo(1960)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsTopPadding() {
|
||||
assertThat(dp.allAppsTopPadding).isEqualTo(600)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsIconSizePx() {
|
||||
assertThat(dp.allAppsIconSizePx).isEqualTo(134)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsIconTextSizePx() {
|
||||
assertThat(dp.allAppsIconTextSizePx).isEqualTo(34)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsIconDrawablePaddingPx() {
|
||||
assertThat(dp.allAppsIconDrawablePaddingPx).isEqualTo(14)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsCellHeightPx() {
|
||||
assertThat(dp.allAppsCellHeightPx).isEqualTo(237)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsCellWidthPx() {
|
||||
assertThat(dp.allAppsCellWidthPx).isEqualTo(153)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsBorderSpacePxX() {
|
||||
assertThat(dp.allAppsBorderSpacePx.x).isEqualTo(38)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsBorderSpacePxY() {
|
||||
assertThat(dp.allAppsBorderSpacePx.y).isEqualTo(38)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun numShownAllAppsColumns() {
|
||||
assertThat(dp.numShownAllAppsColumns).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsLeftRightPadding() {
|
||||
assertThat(dp.allAppsLeftRightPadding).isEqualTo(56)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsLeftRightMargin() {
|
||||
assertThat(dp.allAppsLeftRightMargin).isEqualTo(763)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarSizePx() {
|
||||
assertThat(dp.hotseatBarSizePx).isEqualTo(386)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatCellHeightPx() {
|
||||
assertThat(dp.hotseatCellHeightPx).isEqualTo(126)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarBottomSpacePx() {
|
||||
assertThat(dp.hotseatBarBottomSpacePx).isEqualTo(116)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarSidePaddingStartPx() {
|
||||
assertThat(dp.hotseatBarSidePaddingStartPx).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarSidePaddingEndPx() {
|
||||
assertThat(dp.hotseatBarSidePaddingEndPx).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatQsbSpace() {
|
||||
assertThat(dp.hotseatQsbSpace).isEqualTo(56)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatQsbHeight() {
|
||||
assertThat(dp.hotseatQsbHeight).isEqualTo(126)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun springLoadedHotseatBarTopMarginPx() {
|
||||
assertThat(dp.springLoadedHotseatBarTopMarginPx).isEqualTo(216)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun numShownHotseatIcons() {
|
||||
assertThat(dp.numShownHotseatIcons).isEqualTo(6)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBorderSpace() {
|
||||
assertThat(dp.hotseatBorderSpace).isEqualTo(2)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isQsbInline() {
|
||||
assertThat(dp.isQsbInline).isEqualTo(false)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun qsbWidth() {
|
||||
assertThat(dp.qsbWidth).isEqualTo(685)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isTaskbarPresent() {
|
||||
assertThat(dp.isTaskbarPresent).isEqualTo(true)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isTaskbarPresentInApps() {
|
||||
assertThat(dp.isTaskbarPresentInApps).isEqualTo(false)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun taskbarSize() {
|
||||
assertThat(dp.taskbarSize).isEqualTo(120)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun desiredWorkspaceHorizontalMarginPx() {
|
||||
assertThat(dp.desiredWorkspaceHorizontalMarginPx).isEqualTo(52)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspacePaddingLeft() {
|
||||
assertThat(dp.workspacePadding.left).isEqualTo(33)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspacePaddingTop() {
|
||||
assertThat(dp.workspacePadding.top).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspacePaddingRight() {
|
||||
assertThat(dp.workspacePadding.right).isEqualTo(33)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspacePaddingBottom() {
|
||||
assertThat(dp.workspacePadding.bottom).isEqualTo(291)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun iconScale() {
|
||||
assertThat(dp.iconScale).isEqualTo(1)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellScaleToFit() {
|
||||
assertThat(dp.cellScaleToFit).isEqualTo(1.1976048f)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspaceTopPadding() {
|
||||
assertThat(dp.workspaceTopPadding).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspaceBottomPadding() {
|
||||
assertThat(dp.workspaceBottomPadding).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskMarginPx() {
|
||||
assertThat(dp.overviewTaskMarginPx).isEqualTo(32)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskMarginGridPx() {
|
||||
assertThat(dp.overviewTaskMarginGridPx).isEqualTo(32)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskIconSizePx() {
|
||||
assertThat(dp.overviewTaskIconSizePx).isEqualTo(96)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskIconDrawableSizePx() {
|
||||
assertThat(dp.overviewTaskIconDrawableSizePx).isEqualTo(88)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskIconDrawableSizeGridPx() {
|
||||
assertThat(dp.overviewTaskIconDrawableSizeGridPx).isEqualTo(88)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskThumbnailTopMarginPx() {
|
||||
assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(160)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewActionsTopMarginPx() {
|
||||
assertThat(dp.overviewActionsTopMarginPx).isEqualTo(48)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewActionsHeight() {
|
||||
assertThat(dp.overviewActionsHeight).isEqualTo(96)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewActionsButtonSpacing() {
|
||||
assertThat(dp.overviewActionsButtonSpacing).isEqualTo(72)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewPageSpacing() {
|
||||
assertThat(dp.overviewPageSpacing).isEqualTo(88)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewRowSpacing() {
|
||||
assertThat(dp.overviewRowSpacing).isEqualTo(40)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewGridSideMargin() {
|
||||
assertThat(dp.overviewGridSideMargin).isEqualTo(128)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun dropTargetBarTopMarginPx() {
|
||||
assertThat(dp.dropTargetBarTopMarginPx).isEqualTo(220)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun dropTargetBarSizePx() {
|
||||
assertThat(dp.dropTargetBarSizePx).isEqualTo(144)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun dropTargetBarBottomMarginPx() {
|
||||
assertThat(dp.dropTargetBarBottomMarginPx).isEqualTo(96)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspaceSpringLoadedMinNextPageVisiblePx() {
|
||||
assertThat(dp.workspaceSpringLoadedMinNextPageVisiblePx).isEqualTo(48)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getWorkspaceSpringLoadScale() {
|
||||
assertThat(dp.workspaceSpringLoadScale).isEqualTo(0.69064087f)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellLayoutHeight() {
|
||||
assertThat(dp.cellLayoutHeight).isEqualTo(2169)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellLayoutWidth() {
|
||||
assertThat(dp.cellLayoutWidth).isEqualTo(767)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getPanelCount() {
|
||||
assertThat(dp.panelCount).isEqualTo(2)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isVerticalBarLayout() {
|
||||
assertThat(dp.isVerticalBarLayout).isEqualTo(false)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellLayoutSpringLoadShrunkTop() {
|
||||
assertThat(dp.cellLayoutSpringLoadShrunkTop).isEqualTo(460)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellLayoutSpringLoadShrunkBottom() {
|
||||
assertThat(dp.cellLayoutSpringLoadShrunkBottom).isEqualTo(1958)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getQsbOffsetY() {
|
||||
assertThat(dp.qsbOffsetY).isEqualTo(272)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getTaskbarOffsetY() {
|
||||
assertThat(dp.taskbarOffsetY).isEqualTo(112)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getHotseatLayoutPaddingLeft() {
|
||||
assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(459)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getHotseatLayoutPaddingTop() {
|
||||
assertThat(dp.getHotseatLayoutPadding(context).top).isEqualTo(151)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getHotseatLayoutPaddingRight() {
|
||||
assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(459)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getHotseatLayoutPaddingBottom() {
|
||||
assertThat(dp.getHotseatLayoutPadding(context).bottom).isEqualTo(109)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarEndOffset() {
|
||||
assertThat(dp.hotseatBarEndOffset).isEqualTo(0)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,486 @@
|
||||
/*
|
||||
* 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.DeviceProfile
|
||||
import com.android.launcher3.DeviceProfileBaseTest
|
||||
import com.google.common.truth.Truth.assertThat
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
|
||||
/**
|
||||
* Tests for DeviceProfile for landscape phone with vertical bar and 3-Button navigation.
|
||||
*/
|
||||
@SmallTest
|
||||
@RunWith(AndroidJUnit4::class)
|
||||
class DeviceProfileVerticalBar3ButtonTest : DeviceProfileBaseTest() {
|
||||
|
||||
lateinit var dp: DeviceProfile
|
||||
|
||||
@Before
|
||||
fun before() {
|
||||
initializeVarsForPhone(isVerticalBar = true, isGestureMode = false)
|
||||
dp = newDP()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isScalableGrid() {
|
||||
assertThat(dp.isScalableGrid).isFalse()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellWidthPx() {
|
||||
assertThat(dp.cellWidthPx).isEqualTo(210)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellHeightPx() {
|
||||
assertThat(dp.cellHeightPx).isEqualTo(221)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellSizeX() {
|
||||
assertThat(dp.cellSize.x).isEqualTo(675)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellSizeY() {
|
||||
assertThat(dp.cellSize.y).isEqualTo(321)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutBorderSpacePxX() {
|
||||
assertThat(dp.cellLayoutBorderSpacePx.x).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutBorderSpacePxY() {
|
||||
assertThat(dp.cellLayoutBorderSpacePx.y).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutPaddingPxLeft() {
|
||||
assertThat(dp.cellLayoutPaddingPx.left).isEqualTo(70)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutPaddingPxTop() {
|
||||
assertThat(dp.cellLayoutPaddingPx.top).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutPaddingPxRight() {
|
||||
assertThat(dp.cellLayoutPaddingPx.right).isEqualTo(70)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutPaddingPxBottom() {
|
||||
assertThat(dp.cellLayoutPaddingPx.bottom).isEqualTo(53)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun iconSizePx() {
|
||||
assertThat(dp.iconSizePx).isEqualTo(196)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun iconTextSizePx() {
|
||||
assertThat(dp.iconTextSizePx).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun iconDrawablePaddingPx() {
|
||||
assertThat(dp.iconDrawablePaddingPx).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellWidthPx() {
|
||||
assertThat(dp.folderCellWidthPx).isEqualTo(260)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellHeightPx() {
|
||||
assertThat(dp.folderCellHeightPx).isEqualTo(304)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderChildIconSizePx() {
|
||||
assertThat(dp.folderChildIconSizePx).isEqualTo(196)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderChildTextSizePx() {
|
||||
assertThat(dp.folderChildTextSizePx).isEqualTo(49)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderChildDrawablePaddingPx() {
|
||||
assertThat(dp.folderChildDrawablePaddingPx).isEqualTo(14)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellLayoutBorderSpaceOriginalPx() {
|
||||
assertThat(dp.folderCellLayoutBorderSpaceOriginalPx).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellLayoutBorderSpacePxX() {
|
||||
assertThat(dp.folderCellLayoutBorderSpacePx.x).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellLayoutBorderSpacePxY() {
|
||||
assertThat(dp.folderCellLayoutBorderSpacePx.y).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun bottomSheetTopPadding() {
|
||||
assertThat(dp.bottomSheetTopPadding).isEqualTo(53)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsShiftRange() {
|
||||
assertThat(dp.allAppsShiftRange).isEqualTo(1050)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsTopPadding() {
|
||||
assertThat(dp.allAppsTopPadding).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsIconSizePx() {
|
||||
assertThat(dp.allAppsIconSizePx).isEqualTo(196)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsIconTextSizePx() {
|
||||
assertThat(dp.allAppsIconTextSizePx).isEqualTo(49)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsIconDrawablePaddingPx() {
|
||||
assertThat(dp.allAppsIconDrawablePaddingPx).isEqualTo(28)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsCellHeightPx() {
|
||||
assertThat(dp.allAppsCellHeightPx).isEqualTo(422)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsCellWidthPx() {
|
||||
assertThat(dp.allAppsCellWidthPx).isEqualTo(252)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsBorderSpacePxX() {
|
||||
assertThat(dp.allAppsBorderSpacePx.x).isEqualTo(56)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsBorderSpacePxY() {
|
||||
assertThat(dp.allAppsBorderSpacePx.y).isEqualTo(56)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun numShownAllAppsColumns() {
|
||||
assertThat(dp.numShownAllAppsColumns).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsLeftRightPadding() {
|
||||
assertThat(dp.allAppsLeftRightPadding).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsLeftRightMargin() {
|
||||
assertThat(dp.allAppsLeftRightMargin).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarSizePx() {
|
||||
assertThat(dp.hotseatBarSizePx).isEqualTo(336)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatCellHeightPx() {
|
||||
assertThat(dp.hotseatCellHeightPx).isEqualTo(221)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarBottomSpacePx() {
|
||||
assertThat(dp.hotseatBarBottomSpacePx).isEqualTo(168)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarSidePaddingStartPx() {
|
||||
assertThat(dp.hotseatBarSidePaddingStartPx).isEqualTo(84)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarSidePaddingEndPx() {
|
||||
assertThat(dp.hotseatBarSidePaddingEndPx).isEqualTo(56)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatQsbSpace() {
|
||||
assertThat(dp.hotseatQsbSpace).isEqualTo(126)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatQsbHeight() {
|
||||
assertThat(dp.hotseatQsbHeight).isEqualTo(221)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun springLoadedHotseatBarTopMarginPx() {
|
||||
assertThat(dp.springLoadedHotseatBarTopMarginPx).isEqualTo(158)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun numShownHotseatIcons() {
|
||||
assertThat(dp.numShownHotseatIcons).isEqualTo(4)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBorderSpace() {
|
||||
assertThat(dp.hotseatBorderSpace).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isQsbInline() {
|
||||
assertThat(dp.isQsbInline).isEqualTo(false)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun qsbWidth() {
|
||||
assertThat(dp.qsbWidth).isEqualTo(2221)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isTaskbarPresent() {
|
||||
assertThat(dp.isTaskbarPresent).isEqualTo(false)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isTaskbarPresentInApps() {
|
||||
assertThat(dp.isTaskbarPresentInApps).isEqualTo(false)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun taskbarSize() {
|
||||
assertThat(dp.taskbarSize).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun desiredWorkspaceHorizontalMarginPx() {
|
||||
assertThat(dp.desiredWorkspaceHorizontalMarginPx).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspacePaddingLeft() {
|
||||
assertThat(dp.workspacePadding.left).isEqualTo(14)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspacePaddingTop() {
|
||||
assertThat(dp.workspacePadding.top).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspacePaddingRight() {
|
||||
assertThat(dp.workspacePadding.right).isEqualTo(266)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspacePaddingBottom() {
|
||||
assertThat(dp.workspacePadding.bottom).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun iconScale() {
|
||||
assertThat(dp.iconScale).isEqualTo(1)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellScaleToFit() {
|
||||
assertThat(dp.cellScaleToFit).isEqualTo(1.0f)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspaceTopPadding() {
|
||||
assertThat(dp.workspaceTopPadding).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspaceBottomPadding() {
|
||||
assertThat(dp.workspaceBottomPadding).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskMarginPx() {
|
||||
assertThat(dp.overviewTaskMarginPx).isEqualTo(56)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskMarginGridPx() {
|
||||
assertThat(dp.overviewTaskMarginGridPx).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskIconSizePx() {
|
||||
assertThat(dp.overviewTaskIconSizePx).isEqualTo(168)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskIconDrawableSizePx() {
|
||||
assertThat(dp.overviewTaskIconDrawableSizePx).isEqualTo(154)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskIconDrawableSizeGridPx() {
|
||||
assertThat(dp.overviewTaskIconDrawableSizeGridPx).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskThumbnailTopMarginPx() {
|
||||
assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(280)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewActionsTopMarginPx() {
|
||||
assertThat(dp.overviewActionsTopMarginPx).isEqualTo(42)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewActionsHeight() {
|
||||
assertThat(dp.overviewActionsHeight).isEqualTo(168)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewActionsButtonSpacing() {
|
||||
assertThat(dp.overviewActionsButtonSpacing).isEqualTo(126)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewPageSpacing() {
|
||||
assertThat(dp.overviewPageSpacing).isEqualTo(56)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewRowSpacing() {
|
||||
assertThat(dp.overviewRowSpacing).isEqualTo(-112)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewGridSideMargin() {
|
||||
assertThat(dp.overviewGridSideMargin).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun dropTargetBarTopMarginPx() {
|
||||
assertThat(dp.dropTargetBarTopMarginPx).isEqualTo(21)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun dropTargetBarSizePx() {
|
||||
assertThat(dp.dropTargetBarSizePx).isEqualTo(126)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun dropTargetBarBottomMarginPx() {
|
||||
assertThat(dp.dropTargetBarBottomMarginPx).isEqualTo(21)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspaceSpringLoadedMinNextPageVisiblePx() {
|
||||
assertThat(dp.workspaceSpringLoadedMinNextPageVisiblePx).isEqualTo(84)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getWorkspaceSpringLoadScale() {
|
||||
assertThat(dp.workspaceSpringLoadScale).isEqualTo(0.8880597f)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellLayoutHeight() {
|
||||
assertThat(dp.cellLayoutHeight).isEqualTo(1340)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellLayoutWidth() {
|
||||
assertThat(dp.cellLayoutWidth).isEqualTo(2840)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getPanelCount() {
|
||||
assertThat(dp.panelCount).isEqualTo(1)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isVerticalBarLayout() {
|
||||
assertThat(dp.isVerticalBarLayout).isEqualTo(true)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellLayoutSpringLoadShrunkTop() {
|
||||
assertThat(dp.cellLayoutSpringLoadShrunkTop).isEqualTo(168)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellLayoutSpringLoadShrunkBottom() {
|
||||
assertThat(dp.cellLayoutSpringLoadShrunkBottom).isEqualTo(1358)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getQsbOffsetY() {
|
||||
assertThat(dp.qsbOffsetY).isEqualTo(147)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getTaskbarOffsetY() {
|
||||
assertThat(dp.taskbarOffsetY).isEqualTo(225)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getHotseatLayoutPaddingLeft() {
|
||||
assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(56)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getHotseatLayoutPaddingTop() {
|
||||
assertThat(dp.getHotseatLayoutPadding(context).top).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getHotseatLayoutPaddingRight() {
|
||||
assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(84)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getHotseatLayoutPaddingBottom() {
|
||||
assertThat(dp.getHotseatLayoutPadding(context).bottom).isEqualTo(165)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarEndOffset() {
|
||||
assertThat(dp.hotseatBarEndOffset).isEqualTo(0)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,486 @@
|
||||
/*
|
||||
* 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.DeviceProfile
|
||||
import com.android.launcher3.DeviceProfileBaseTest
|
||||
import com.google.common.truth.Truth.assertThat
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
|
||||
/**
|
||||
* Tests for DeviceProfile for landscape phone with vertical bar.
|
||||
*/
|
||||
@SmallTest
|
||||
@RunWith(AndroidJUnit4::class)
|
||||
class DeviceProfileVerticalBarTest : DeviceProfileBaseTest() {
|
||||
|
||||
lateinit var dp: DeviceProfile
|
||||
|
||||
@Before
|
||||
fun before() {
|
||||
initializeVarsForPhone(isVerticalBar = true)
|
||||
dp = newDP()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isScalableGrid() {
|
||||
assertThat(dp.isScalableGrid).isFalse()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellWidthPx() {
|
||||
assertThat(dp.cellWidthPx).isEqualTo(210)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellHeightPx() {
|
||||
assertThat(dp.cellHeightPx).isEqualTo(221)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellSizeX() {
|
||||
assertThat(dp.cellSize.x).isEqualTo(675)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellSizeY() {
|
||||
assertThat(dp.cellSize.y).isEqualTo(321)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutBorderSpacePxX() {
|
||||
assertThat(dp.cellLayoutBorderSpacePx.x).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutBorderSpacePxY() {
|
||||
assertThat(dp.cellLayoutBorderSpacePx.y).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutPaddingPxLeft() {
|
||||
assertThat(dp.cellLayoutPaddingPx.left).isEqualTo(70)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutPaddingPxTop() {
|
||||
assertThat(dp.cellLayoutPaddingPx.top).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutPaddingPxRight() {
|
||||
assertThat(dp.cellLayoutPaddingPx.right).isEqualTo(70)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellLayoutPaddingPxBottom() {
|
||||
assertThat(dp.cellLayoutPaddingPx.bottom).isEqualTo(53)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun iconSizePx() {
|
||||
assertThat(dp.iconSizePx).isEqualTo(196)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun iconTextSizePx() {
|
||||
assertThat(dp.iconTextSizePx).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun iconDrawablePaddingPx() {
|
||||
assertThat(dp.iconDrawablePaddingPx).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellWidthPx() {
|
||||
assertThat(dp.folderCellWidthPx).isEqualTo(260)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellHeightPx() {
|
||||
assertThat(dp.folderCellHeightPx).isEqualTo(304)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderChildIconSizePx() {
|
||||
assertThat(dp.folderChildIconSizePx).isEqualTo(196)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderChildTextSizePx() {
|
||||
assertThat(dp.folderChildTextSizePx).isEqualTo(49)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderChildDrawablePaddingPx() {
|
||||
assertThat(dp.folderChildDrawablePaddingPx).isEqualTo(14)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellLayoutBorderSpaceOriginalPx() {
|
||||
assertThat(dp.folderCellLayoutBorderSpaceOriginalPx).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellLayoutBorderSpacePxX() {
|
||||
assertThat(dp.folderCellLayoutBorderSpacePx.x).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun folderCellLayoutBorderSpacePxY() {
|
||||
assertThat(dp.folderCellLayoutBorderSpacePx.y).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun bottomSheetTopPadding() {
|
||||
assertThat(dp.bottomSheetTopPadding).isEqualTo(53)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsShiftRange() {
|
||||
assertThat(dp.allAppsShiftRange).isEqualTo(1050)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsTopPadding() {
|
||||
assertThat(dp.allAppsTopPadding).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsIconSizePx() {
|
||||
assertThat(dp.allAppsIconSizePx).isEqualTo(196)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsIconTextSizePx() {
|
||||
assertThat(dp.allAppsIconTextSizePx).isEqualTo(49)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsIconDrawablePaddingPx() {
|
||||
assertThat(dp.allAppsIconDrawablePaddingPx).isEqualTo(28)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsCellHeightPx() {
|
||||
assertThat(dp.allAppsCellHeightPx).isEqualTo(422)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsCellWidthPx() {
|
||||
assertThat(dp.allAppsCellWidthPx).isEqualTo(252)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsBorderSpacePxX() {
|
||||
assertThat(dp.allAppsBorderSpacePx.x).isEqualTo(56)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsBorderSpacePxY() {
|
||||
assertThat(dp.allAppsBorderSpacePx.y).isEqualTo(56)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun numShownAllAppsColumns() {
|
||||
assertThat(dp.numShownAllAppsColumns).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsLeftRightPadding() {
|
||||
assertThat(dp.allAppsLeftRightPadding).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppsLeftRightMargin() {
|
||||
assertThat(dp.allAppsLeftRightMargin).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarSizePx() {
|
||||
assertThat(dp.hotseatBarSizePx).isEqualTo(336)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatCellHeightPx() {
|
||||
assertThat(dp.hotseatCellHeightPx).isEqualTo(221)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarBottomSpacePx() {
|
||||
assertThat(dp.hotseatBarBottomSpacePx).isEqualTo(168)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarSidePaddingStartPx() {
|
||||
assertThat(dp.hotseatBarSidePaddingStartPx).isEqualTo(84)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarSidePaddingEndPx() {
|
||||
assertThat(dp.hotseatBarSidePaddingEndPx).isEqualTo(56)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatQsbSpace() {
|
||||
assertThat(dp.hotseatQsbSpace).isEqualTo(126)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatQsbHeight() {
|
||||
assertThat(dp.hotseatQsbHeight).isEqualTo(221)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun springLoadedHotseatBarTopMarginPx() {
|
||||
assertThat(dp.springLoadedHotseatBarTopMarginPx).isEqualTo(158)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun numShownHotseatIcons() {
|
||||
assertThat(dp.numShownHotseatIcons).isEqualTo(4)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBorderSpace() {
|
||||
assertThat(dp.hotseatBorderSpace).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isQsbInline() {
|
||||
assertThat(dp.isQsbInline).isEqualTo(false)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun qsbWidth() {
|
||||
assertThat(dp.qsbWidth).isEqualTo(2221)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isTaskbarPresent() {
|
||||
assertThat(dp.isTaskbarPresent).isEqualTo(false)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isTaskbarPresentInApps() {
|
||||
assertThat(dp.isTaskbarPresentInApps).isEqualTo(false)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun taskbarSize() {
|
||||
assertThat(dp.taskbarSize).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun desiredWorkspaceHorizontalMarginPx() {
|
||||
assertThat(dp.desiredWorkspaceHorizontalMarginPx).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspacePaddingLeft() {
|
||||
assertThat(dp.workspacePadding.left).isEqualTo(14)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspacePaddingTop() {
|
||||
assertThat(dp.workspacePadding.top).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspacePaddingRight() {
|
||||
assertThat(dp.workspacePadding.right).isEqualTo(266)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspacePaddingBottom() {
|
||||
assertThat(dp.workspacePadding.bottom).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun iconScale() {
|
||||
assertThat(dp.iconScale).isEqualTo(1)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cellScaleToFit() {
|
||||
assertThat(dp.cellScaleToFit).isEqualTo(1.0f)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspaceTopPadding() {
|
||||
assertThat(dp.workspaceTopPadding).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspaceBottomPadding() {
|
||||
assertThat(dp.workspaceBottomPadding).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskMarginPx() {
|
||||
assertThat(dp.overviewTaskMarginPx).isEqualTo(56)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskMarginGridPx() {
|
||||
assertThat(dp.overviewTaskMarginGridPx).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskIconSizePx() {
|
||||
assertThat(dp.overviewTaskIconSizePx).isEqualTo(168)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskIconDrawableSizePx() {
|
||||
assertThat(dp.overviewTaskIconDrawableSizePx).isEqualTo(154)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskIconDrawableSizeGridPx() {
|
||||
assertThat(dp.overviewTaskIconDrawableSizeGridPx).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskThumbnailTopMarginPx() {
|
||||
assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(280)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewActionsTopMarginPx() {
|
||||
assertThat(dp.overviewActionsTopMarginPx).isEqualTo(42)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewActionsHeight() {
|
||||
assertThat(dp.overviewActionsHeight).isEqualTo(168)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewActionsButtonSpacing() {
|
||||
assertThat(dp.overviewActionsButtonSpacing).isEqualTo(126)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewPageSpacing() {
|
||||
assertThat(dp.overviewPageSpacing).isEqualTo(56)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewRowSpacing() {
|
||||
assertThat(dp.overviewRowSpacing).isEqualTo(-112)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewGridSideMargin() {
|
||||
assertThat(dp.overviewGridSideMargin).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun dropTargetBarTopMarginPx() {
|
||||
assertThat(dp.dropTargetBarTopMarginPx).isEqualTo(21)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun dropTargetBarSizePx() {
|
||||
assertThat(dp.dropTargetBarSizePx).isEqualTo(126)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun dropTargetBarBottomMarginPx() {
|
||||
assertThat(dp.dropTargetBarBottomMarginPx).isEqualTo(21)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun workspaceSpringLoadedMinNextPageVisiblePx() {
|
||||
assertThat(dp.workspaceSpringLoadedMinNextPageVisiblePx).isEqualTo(84)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getWorkspaceSpringLoadScale() {
|
||||
assertThat(dp.workspaceSpringLoadScale).isEqualTo(0.8880597f)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellLayoutHeight() {
|
||||
assertThat(dp.cellLayoutHeight).isEqualTo(1340)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellLayoutWidth() {
|
||||
assertThat(dp.cellLayoutWidth).isEqualTo(2840)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getPanelCount() {
|
||||
assertThat(dp.panelCount).isEqualTo(1)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isVerticalBarLayout() {
|
||||
assertThat(dp.isVerticalBarLayout).isEqualTo(true)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellLayoutSpringLoadShrunkTop() {
|
||||
assertThat(dp.cellLayoutSpringLoadShrunkTop).isEqualTo(168)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getCellLayoutSpringLoadShrunkBottom() {
|
||||
assertThat(dp.cellLayoutSpringLoadShrunkBottom).isEqualTo(1358)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getQsbOffsetY() {
|
||||
assertThat(dp.qsbOffsetY).isEqualTo(147)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getTaskbarOffsetY() {
|
||||
assertThat(dp.taskbarOffsetY).isEqualTo(225)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getHotseatLayoutPaddingLeft() {
|
||||
assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(56)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getHotseatLayoutPaddingTop() {
|
||||
assertThat(dp.getHotseatLayoutPadding(context).top).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getHotseatLayoutPaddingRight() {
|
||||
assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(84)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getHotseatLayoutPaddingBottom() {
|
||||
assertThat(dp.getHotseatLayoutPadding(context).bottom).isEqualTo(165)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun hotseatBarEndOffset() {
|
||||
assertThat(dp.hotseatBarEndOffset).isEqualTo(0)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user