Update setting taskbar window height

Updated the logic to set the taskbar window height to accommodate the
bubble bar with its maximum flyout height before the bubble bar
animation begins. The height is reverted to the default value once the
animation is completed.

Fixes: 378400160
Flag: com.android.wm.shell.enable_bubble_bar
Test: Manual. Set 3-button navigation mode and have the QSB placed
above the hotseat. Send a notification that will display a bubble, and
observe the bubble bar animation and final placement aligned with the
QSB.
Next, set gesture navigation mode and repeat the flow above. Observe
that the bubble bar is aligned with the hotseat icons.
Felix video:
http://recall/-/gx8ASgewUeUS3QYohfrd1J/gYMVt0sH4si0KOpaBxIPem
Tangor video:
http://recall/-/gx8ASgewUeUS3QYohfrd1J/fz95MbjcjW3awStnuOl8BJ

Change-Id: I239f935743c3936fed44822c3c62652073ffefe2
This commit is contained in:
mpodolian
2024-11-27 10:19:24 -08:00
parent 28907bcbd6
commit 3111daf2f1
14 changed files with 173 additions and 137 deletions
@@ -171,7 +171,7 @@ public class BubbleBarViewController {
mBubbleBarContainer, createFlyoutPositioner(), createFlyoutCallbacks());
mBubbleBarViewAnimator = new BubbleBarViewAnimator(
mBarView, mBubbleStashController, mBubbleBarFlyoutController,
mBubbleBarController::showExpandedView);
createBubbleBarParentViewController(), mBubbleBarController::showExpandedView);
mTaskbarViewPropertiesProvider = taskbarViewPropertiesProvider;
onBubbleBarConfigurationChanged(/* animate= */ false);
mActivity.addOnDeviceProfileChangeListener(
@@ -318,17 +318,6 @@ public class BubbleBarViewController {
private FlyoutCallbacks createFlyoutCallbacks() {
return new FlyoutCallbacks() {
@Override
public void extendTopBoundary(int space) {
int defaultSize = mActivity.getDefaultTaskbarWindowSize();
mActivity.setTaskbarWindowSize(defaultSize + space);
}
@Override
public void resetTopBoundary() {
mActivity.setTaskbarWindowSize(mActivity.getDefaultTaskbarWindowSize());
}
@Override
public void flyoutClicked() {
interruptAnimationForTouch();
@@ -337,6 +326,15 @@ public class BubbleBarViewController {
};
}
private BubbleBarParentViewHeightUpdateNotifier createBubbleBarParentViewController() {
return new BubbleBarParentViewHeightUpdateNotifier() {
@Override
public void updateTopBoundary() {
mActivity.setTaskbarWindowSize(mActivity.getDefaultTaskbarWindowSize());
}
};
}
private void onBubbleClicked(BubbleView bubbleView) {
if (mBubbleBarPinning.isAnimating()) return;
bubbleView.markSeen();
@@ -585,6 +583,19 @@ public class BubbleBarViewController {
return mHiddenForNoBubbles;
}
/** Returns maximum height of the bubble bar with the flyout view. */
public int getBubbleBarWithFlyoutMaximumHeight() {
if (!isBubbleBarVisible()) return 0;
int bubbleBarTopOnHome = (int) (mBubbleStashController.getBubbleBarVerticalCenterForHome()
+ mBarView.getBubbleBarCollapsedHeight() / 2);
int result = (int) (bubbleBarTopOnHome + mBarView.getArrowHeight());
if (isAnimatingNewBubble()) {
// when animating new bubble add the maximum height of the flyout view
result += mBubbleBarFlyoutController.getMaximumFlyoutHeight();
}
return result;
}
/**
* Sets whether the bubble bar should be hidden because there are no bubbles.
*/