Fix cropped bubble flyout when animating in app
When animating the bubble bar in an app with a stashed handle,
the flyout might not be displayed entirely.
Fix the calculation of the amount of space needed to fully display
the bubble bar and flyout views.
Flag: com.android.wm.shell.enable_bubble_bar
Fixes: 382513856
Test: manual
- remove all bubbles
- launch app
- send a bubble with a 2-line message
- observe flyout is fully visible
Change-Id: I7953cb7f619f2c00b04bb4cb08c57a8195ff79fe
This commit is contained in:
@@ -580,15 +580,23 @@ public class BubbleBarViewController {
|
||||
|
||||
/** Returns maximum height of the bubble bar with the flyout view. */
|
||||
public int getBubbleBarWithFlyoutMaximumHeight() {
|
||||
if (!isBubbleBarVisible()) return 0;
|
||||
if (!isBubbleBarVisible() && !isAnimatingNewBubble()) return 0;
|
||||
int bubbleBarTopOnHome = (int) (mBubbleStashController.getBubbleBarVerticalCenterForHome()
|
||||
+ mBarView.getBubbleBarCollapsedHeight() / 2);
|
||||
int result = (int) (bubbleBarTopOnHome + mBarView.getArrowHeight());
|
||||
+ mBarView.getBubbleBarCollapsedHeight() / 2 + mBarView.getArrowHeight());
|
||||
if (isAnimatingNewBubble()) {
|
||||
// when animating new bubble add the maximum height of the flyout view
|
||||
result += mBubbleBarFlyoutController.getMaximumFlyoutHeight();
|
||||
if (mTaskbarStashController.isInApp() && mBubbleStashController.getHasHandleView()) {
|
||||
// when animating a bubble in an app, the bubble bar will be higher than its
|
||||
// position on home
|
||||
float bubbleBarTopDistanceFromBottom =
|
||||
-mBubbleStashController.getBubbleBarTranslationYForTaskbar()
|
||||
+ mBarView.getHeight();
|
||||
return (int) bubbleBarTopDistanceFromBottom
|
||||
+ mBubbleBarFlyoutController.getMaximumFlyoutHeight();
|
||||
}
|
||||
return bubbleBarTopOnHome + mBubbleBarFlyoutController.getMaximumFlyoutHeight();
|
||||
} else {
|
||||
return bubbleBarTopOnHome;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user