Updated bubble bar position to be center aligned with the hotseat

Added a method to the device profile to calculate the vertical center of
the hotseat icons. Simplified the logic for positioning the bubble bar.

Test: TransientBubbleStashControllerTest
Test: PersistentBubbleStashControllerTest
Test: Visual. Go to home page, check that bubble bar is vertically
center aligned with the hotseat
Bug: 345491493
Flag: com.android.wm.shell.enable_bubble_bar

Change-Id: I52f1b94de79f6c912f43a88fcc5c884e20e56310
This commit is contained in:
mpodolian
2024-10-15 17:14:06 -07:00
parent bea43b0c03
commit f230eee2ff
9 changed files with 46 additions and 35 deletions

View File

@@ -48,6 +48,7 @@ class PersistentBubbleStashControllerTest {
companion object {
const val BUBBLE_BAR_HEIGHT = 100f
const val HOTSEAT_VERTICAL_CENTER = 95
const val HOTSEAT_TRANSLATION_Y = -45f
const val TASK_BAR_TRANSLATION_Y = -5f
}
@@ -74,11 +75,12 @@ class PersistentBubbleStashControllerTest {
PersistentBubbleStashController(DefaultDimensionsProvider())
setUpBubbleBarView()
setUpBubbleBarController()
persistentTaskBarStashController.setHotseatVerticalCenter(HOTSEAT_VERTICAL_CENTER)
persistentTaskBarStashController.init(
taskbarInsetsController,
bubbleBarViewController,
null,
ImmediateAction()
ImmediateAction(),
)
}

View File

@@ -23,21 +23,13 @@ class ImmediateAction : BubbleStashController.ControllersAfterInitAction {
class DefaultDimensionsProvider(
private val taskBarBottomSpace: Int = TASKBAR_BOTTOM_SPACE,
private val taskBarHeight: Int = TASKBAR_HEIGHT,
private val hotseatBottomSpace: Int = HOTSEAT_BOTTOM_SPACE,
private val hotseatHeight: Int = HOTSEAT_HEIGHT
) : BubbleStashController.TaskbarHotseatDimensionsProvider {
override fun getTaskbarBottomSpace(): Int = taskBarBottomSpace
override fun getTaskbarHeight(): Int = taskBarHeight
override fun getHotseatBottomSpace(): Int = hotseatBottomSpace
override fun getHotseatHeight(): Int = hotseatHeight
companion object {
const val TASKBAR_BOTTOM_SPACE = 0
const val TASKBAR_HEIGHT = 110
const val HOTSEAT_BOTTOM_SPACE = 20
const val HOTSEAT_HEIGHT = 150
}
}

View File

@@ -60,6 +60,7 @@ class TransientBubbleStashControllerTest {
companion object {
const val TASKBAR_BOTTOM_SPACE = 5
const val HOTSEAT_VERTICAL_CENTER = 95
const val BUBBLE_BAR_WIDTH = 200
const val BUBBLE_BAR_HEIGHT = 100
const val HOTSEAT_TRANSLATION_Y = -45f
@@ -108,6 +109,7 @@ class TransientBubbleStashControllerTest {
setUpStashedHandleView()
setUpBubbleStashedHandleViewController()
PhysicsAnimatorTestUtils.prepareForTest()
mTransientBubbleStashController.setHotseatVerticalCenter(HOTSEAT_VERTICAL_CENTER)
mTransientBubbleStashController.init(
taskbarInsetsController,
bubbleBarViewController,