Update taskbar window size for flyout

This change updates the taskbar window size after the flyout view
has measured itself. This ensure that the taskbar window is tall
enough to display the entire flyout.

When the flyout is removed we reset the taskbar window size.

Flag: com.android.wm.shell.enable_bubble_bar
Bug: 277815200
Test: builds successfully and tested manually -- code is not wired up
Change-Id: I5e8618e57443212e1c4f19ab20d1542ae2d1b865
This commit is contained in:
Liran Binyamin committed 2024-10-14 19:59:59 -04:00
1 parent 9777937d41
commit c33fe5bd56
5 files changed
+206 -34

No files matched your search

@@ -43,6 +43,7 @@ import com.android.launcher3.taskbar.TaskbarControllers;
import com.android.launcher3.taskbar.TaskbarInsetsController;
import com.android.launcher3.taskbar.TaskbarStashController;
import com.android.launcher3.taskbar.bubbles.animation.BubbleBarViewAnimator;
import com.android.launcher3.taskbar.bubbles.flyout.BubbleBarFlyoutController;
import com.android.launcher3.taskbar.bubbles.flyout.BubbleBarFlyoutPositioner;
import com.android.launcher3.taskbar.bubbles.stashing.BubbleStashController;
import com.android.launcher3.util.MultiPropertyFactory;
@@ -117,6 +118,8 @@ public class BubbleBarViewController {
public boolean mOverflowAdded;
private BubbleBarViewAnimator mBubbleBarViewAnimator;
private final FrameLayout mBubbleBarContainer;
private BubbleBarFlyoutController mBubbleBarFlyoutController;
private final TimeSource mTimeSource = System::currentTimeMillis;
@@ -127,6 +130,7 @@ public class BubbleBarViewController {
FrameLayout bubbleBarContainer) {
mActivity = activity;
mBarView = barView;
mBubbleBarContainer = bubbleBarContainer;
mSystemUiProxy = SystemUiProxy.INSTANCE.get(mActivity);
mBubbleBarAlpha = new MultiValueAlpha(mBarView, 1 /* num alpha channels */);
mIconSize = activity.getResources().getDimensionPixelSize(
@@ -141,6 +145,8 @@ public class BubbleBarViewController {
mBubbleDragController = bubbleControllers.bubbleDragController;
mTaskbarStashController = controllers.taskbarStashController;
mTaskbarInsetsController = controllers.taskbarInsetsController;
mBubbleBarFlyoutController = new BubbleBarFlyoutController(
mBubbleBarContainer, createFlyoutPositioner(), createFlyoutTopBoundaryListener());
mBubbleBarViewAnimator = new BubbleBarViewAnimator(
mBarView, mBubbleStashController, mBubbleBarController::showExpandedView);
mTaskbarViewPropertiesProvider = taskbarViewPropertiesProvider;
@@ -266,6 +272,21 @@ public class BubbleBarViewController {
};
}
private BubbleBarFlyoutController.TopBoundaryListener createFlyoutTopBoundaryListener() {
return new BubbleBarFlyoutController.TopBoundaryListener() {
@Override
public void extendTopBoundary(int space) {
int defaultSize = mActivity.getDefaultTaskbarWindowSize();
mActivity.setTaskbarWindowSize(defaultSize + space);
}
@Override
public void resetTopBoundary() {
mActivity.setTaskbarWindowSize(mActivity.getDefaultTaskbarWindowSize());
}
};
}
private void onBubbleClicked(BubbleView bubbleView) {
bubbleView.markSeen();
BubbleBarItem bubble = bubbleView.getBubble();