Merge "Allow 5 hotseat icons in tablet 3 button" into tm-dev am: bfa953b230

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/17523009

Change-Id: I72b3ac14faa37ee6e8591e74be6657cf76f356da
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Alex Chau
2022-04-01 10:25:44 +00:00
committed by Automerger Merge Worker
2 changed files with 44 additions and 16 deletions
@@ -88,11 +88,11 @@ abstract class DeviceProfileBaseTest {
protected fun newScalableInvariantDeviceProfile(): InvariantDeviceProfile =
InvariantDeviceProfile().apply {
isScalable = true
numColumns = 5
numRows = 5
numShownHotseatIcons = 5
numColumns = 4
numRows = 4
numShownHotseatIcons = 4
numDatabaseHotseatIcons = 6
numShrunkenHotseatIcons = 4
numShrunkenHotseatIcons = 5
horizontalMargin = FloatArray(4) { 22f }
borderSpaces = listOf(
PointF(16f, 16f),
@@ -43,11 +43,11 @@ class HotseatSizeTest : DeviceProfileBaseTest() {
val dp = newDP()
assertThat(dp.isQsbInline).isFalse()
assertThat(dp.numShownHotseatIcons).isEqualTo(5)
assertThat(dp.numShownHotseatIcons).isEqualTo(4)
}
@Test
fun hotseat_size_is_max_for_foldables() {
fun hotseat_size_is_max_when_large_screen() {
initializeVarsForTablet(isLandscape = true)
inv = newScalableInvariantDeviceProfile().apply {
deviceType = TYPE_MULTI_DISPLAY
@@ -61,7 +61,7 @@ class HotseatSizeTest : DeviceProfileBaseTest() {
}
@Test
fun hotseat_size_is_shrunk_if_needed() {
fun hotseat_size_is_shrunk_if_needed_when_large_screen() {
initializeVarsForTablet(isLandscape = true)
inv = newScalableInvariantDeviceProfile().apply {
deviceType = TYPE_MULTI_DISPLAY
@@ -79,7 +79,7 @@ class HotseatSizeTest : DeviceProfileBaseTest() {
if (dp.hotseatQsbHeight > 0) {
assertThat(dp.isQsbInline).isTrue()
assertThat(dp.numShownHotseatIcons).isEqualTo(4)
assertThat(dp.numShownHotseatIcons).isEqualTo(5)
} else { // Launcher3 doesn't have QSB height
assertThat(dp.isQsbInline).isFalse()
assertThat(dp.numShownHotseatIcons).isEqualTo(6)
@@ -91,7 +91,7 @@ class HotseatSizeTest : DeviceProfileBaseTest() {
* inline qsb
*/
@Test
fun hotseat_size_is_shrunk_even_in_portrait() {
fun hotseat_size_is_shrunk_even_in_portrait_when_large_screen() {
initializeVarsForTablet()
inv = newScalableInvariantDeviceProfile().apply {
deviceType = TYPE_MULTI_DISPLAY
@@ -109,7 +109,7 @@ class HotseatSizeTest : DeviceProfileBaseTest() {
if (dp.hotseatQsbHeight > 0) {
assertThat(dp.isQsbInline).isFalse()
assertThat(dp.numShownHotseatIcons).isEqualTo(4)
assertThat(dp.numShownHotseatIcons).isEqualTo(5)
} else { // Launcher3 doesn't have QSB height
assertThat(dp.isQsbInline).isFalse()
assertThat(dp.numShownHotseatIcons).isEqualTo(6)
@@ -117,7 +117,7 @@ class HotseatSizeTest : DeviceProfileBaseTest() {
}
@Test
fun hotseat_size_is_default_when_folded() {
fun hotseat_size_is_default_when_small_screen() {
initializeVarsForPhone()
inv = newScalableInvariantDeviceProfile().apply {
deviceType = TYPE_MULTI_DISPLAY
@@ -126,7 +126,33 @@ class HotseatSizeTest : DeviceProfileBaseTest() {
val dp = newDP()
assertThat(dp.numShownHotseatIcons).isEqualTo(5)
assertThat(dp.numShownHotseatIcons).isEqualTo(4)
}
@Test
fun hotseat_size_is_not_shrunk_on_gesture_tablet() {
initializeVarsForTablet(isLandscape = true)
inv = newScalableInvariantDeviceProfile().apply {
deviceType = TYPE_TABLET
inlineQsb = booleanArrayOf(
false,
true, // landscape
false,
false
)
numShownHotseatIcons = 6
}
isGestureMode = true
val dp = newDP()
if (dp.hotseatQsbHeight > 0) {
assertThat(dp.isQsbInline).isTrue()
assertThat(dp.numShownHotseatIcons).isEqualTo(6)
} else { // Launcher3 doesn't have QSB height
assertThat(dp.isQsbInline).isFalse()
assertThat(dp.numShownHotseatIcons).isEqualTo(6)
}
}
@Test
@@ -140,6 +166,7 @@ class HotseatSizeTest : DeviceProfileBaseTest() {
false,
false
)
numShownHotseatIcons = 6
}
isGestureMode = false
@@ -147,10 +174,10 @@ class HotseatSizeTest : DeviceProfileBaseTest() {
if (dp.hotseatQsbHeight > 0) {
assertThat(dp.isQsbInline).isTrue()
assertThat(dp.numShownHotseatIcons).isEqualTo(4)
assertThat(dp.numShownHotseatIcons).isEqualTo(5)
} else { // Launcher3 doesn't have QSB height
assertThat(dp.isQsbInline).isFalse()
assertThat(dp.numShownHotseatIcons).isEqualTo(5)
assertThat(dp.numShownHotseatIcons).isEqualTo(6)
}
}
@@ -169,6 +196,7 @@ class HotseatSizeTest : DeviceProfileBaseTest() {
false,
false
)
numShownHotseatIcons = 6
}
isGestureMode = false
@@ -176,10 +204,10 @@ class HotseatSizeTest : DeviceProfileBaseTest() {
if (dp.hotseatQsbHeight > 0) {
assertThat(dp.isQsbInline).isFalse()
assertThat(dp.numShownHotseatIcons).isEqualTo(4)
assertThat(dp.numShownHotseatIcons).isEqualTo(5)
} else { // Launcher3 doesn't have QSB height
assertThat(dp.isQsbInline).isFalse()
assertThat(dp.numShownHotseatIcons).isEqualTo(5)
assertThat(dp.numShownHotseatIcons).isEqualTo(6)
}
}