Added taskbar in/out animation when the bubble bar is expanded/collapsed

Added taskbar icon animation when the bubble bar expansion changes.

If there is enough space to accommodate both bars with spacing in
between, the taskbar remains. If there is not enough space, the taskbar
is animated out and then animated in when the bubble bar is collapsed.

Bug: 346391377
Flag: com.android.wm.shell.enable_bubble_bar
Test: Manual. Set taskbar to persistent mode via 3-button navigation or
through the taskbar itself. Have enough bubbles to cover the taskbar
when the bubble bar is extended. Expand the bubble bar and observe the
taskbar icons animating out. Remove a few bubbles so there is enough
space to accommodate both bars. Expand the bubble bar and observe that
both bars are visible.

Change-Id: I0b03a010c1e49ab39a17934f6629d5496fd66978
This commit is contained in:
mpodolian committed 2024-08-09 11:10:28 -07:00
1 parent eeb98c8e75
commit 6ba789a98f
7 files changed
+117 -14

No files matched your search

@@ -661,13 +661,25 @@ public class BubbleBarView extends FrameLayout {
return displayHeight - bubbleBarHeight + (int) mController.getBubbleBarTranslationY();
}
/**
* Updates the bounds with translation that may have been applied and returns the result.
*/
/** Returns the bounds with translation that may have been applied. */
public Rect getBubbleBarBounds() {
mBubbleBarBounds.top = getTop() + (int) getTranslationY() + mPointerSize;
mBubbleBarBounds.bottom = getBottom() + (int) getTranslationY();
return mBubbleBarBounds;
Rect bounds = new Rect(mBubbleBarBounds);
bounds.top = getTop() + (int) getTranslationY() + mPointerSize;
bounds.bottom = getBottom() + (int) getTranslationY();
return bounds;
}
/** Returns the expanded bounds with translation that may have been applied. */
public Rect getBubbleBarExpandedBounds() {
Rect expandedBounds = getBubbleBarBounds();
if (!isExpanded() || isExpanding()) {
if (mBubbleBarLocation.isOnLeft(isLayoutRtl())) {
expandedBounds.right = expandedBounds.left + (int) expandedWidth();
} else {
expandedBounds.left = expandedBounds.right - (int) expandedWidth();
}
}
return expandedBounds;
}
/**
@@ -1279,6 +1291,13 @@ public class BubbleBarView extends FrameLayout {
return mIsBarExpanded;
}
/**
* Returns whether the bubble bar is expanding.
*/
public boolean isExpanding() {
return mWidthAnimator.isRunning() && mIsBarExpanded;
}
/**
* Get width of the bubble bar as if it would be expanded.
*