Stash the taskbar on every bubble bar expansion

Added logic to enable BubbleBarView to  notify BubbleBarViewController
of expanded state change. Also updated all the test that uses
BubbleBarView to pass empty Controller.

Fixes: 411304392
Flag: com.android.wm.shell.enable_bubble_bar
Test: Manual. Go to any app. Swipe up to show the taskbar. Trigger any
bubble. Observe taskbar is stashed on bubble bar expanded.

Change-Id: I88ad167eb0ed444629716df3672bbb06ca8adcc4
This commit is contained in:
mpodolian
2025-04-18 11:16:40 -07:00
parent a582c90fa1
commit 04bd5b49ea
6 changed files with 99 additions and 4 deletions
@@ -29,6 +29,7 @@ import com.android.launcher3.taskbar.bubbles.BubbleBarView
import com.android.launcher3.taskbar.bubbles.BubbleBarViewController
import com.android.launcher3.taskbar.bubbles.stashing.BubbleStashController.BubbleLauncherState
import com.android.launcher3.util.MultiValueAlpha
import com.android.wm.shell.shared.bubbles.BubbleBarLocation
import com.google.common.truth.Truth.assertThat
import org.junit.Before
import org.junit.Rule
@@ -391,6 +392,28 @@ class PersistentBubbleStashControllerTest {
getInstrumentation().runOnMainSync {
bubbleBarView = BubbleBarView(context)
bubbleBarView.layoutParams = FrameLayout.LayoutParams(0, 0)
bubbleBarView.setController(
object : BubbleBarView.Controller {
override fun getScreenHeight(): Int = 0
override fun getBubbleBarTranslationY(): Float = 0f
override fun onBubbleBarTouched() {}
override fun expandBubbleBar() {}
override fun dismissBubbleBar() {}
override fun updateBubbleBarLocation(
location: BubbleBarLocation?,
source: Int,
) {}
override fun setIsDragging(dragging: Boolean) {}
override fun onBubbleBarExpandedStateChanged(expanded: Boolean) {}
}
)
}
}
@@ -38,6 +38,7 @@ import com.android.launcher3.taskbar.bubbles.stashing.BubbleStashController.Bubb
import com.android.launcher3.util.MultiValueAlpha
import com.android.wm.shell.shared.animation.PhysicsAnimator
import com.android.wm.shell.shared.animation.PhysicsAnimatorTestUtils
import com.android.wm.shell.shared.bubbles.BubbleBarLocation
import com.google.common.collect.Range
import com.google.common.truth.Truth.assertThat
import org.junit.Before
@@ -556,6 +557,28 @@ class TransientBubbleStashControllerTest {
bubbleBarView = BubbleBarView(context)
bubbleBarView.layoutParams =
FrameLayout.LayoutParams(BUBBLE_BAR_WIDTH, BUBBLE_BAR_HEIGHT)
bubbleBarView.setController(
object : BubbleBarView.Controller {
override fun getScreenHeight(): Int = 0
override fun getBubbleBarTranslationY(): Float = 0f
override fun onBubbleBarTouched() {}
override fun expandBubbleBar() {}
override fun dismissBubbleBar() {}
override fun updateBubbleBarLocation(
location: BubbleBarLocation?,
source: Int,
) {}
override fun setIsDragging(dragging: Boolean) {}
override fun onBubbleBarExpandedStateChanged(expanded: Boolean) {}
}
)
bubbleView = BubbleView(context)
bubbleBarView.addBubble(bubbleView)
bubbleBarView.layout(0, 0, BUBBLE_BAR_WIDTH, BUBBLE_BAR_HEIGHT)