Account for bubble bar bounds for taskbar overflow
When caculating number of icons to show in taskbar, account for bubble bar size (the max size when in collapsed state) when bubble bar has bubbles (even if the bubble bar is stashed). Note that the bubble bar visibility may change, so max number of icons in the taskbar may change during the taskbar view lieftime. TaskbarViewController already had a method called when the bubble bar visibility changed - adapt it to also reclaculate max number of icons to show in the taskbar, and update the list of icons shown in the UI if necessary (if the change in the bubble bar visibility would also cause a change in number of icons shown in the taskbar). Bug: 368119679 Test: Launch enough apps for taskbar to enter overflow, open an app that supports bubbles, and trigger 2 or more bubbles so bubble bar shows up. Verify that the buble bar does not overlap with taskbar bounds, both in transient and persistent taskbar. Remove bubbles, and verify the taskbar bounds expand, allowing more icons to be shown. Flag: com.android.launcher3.taskbar_overflow Change-Id: Ifed4e5e5dd64df5256090f5ba55f24203c09e839
This commit is contained in:
@@ -137,6 +137,17 @@ public class TaskbarViewCallbacks {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the max bubble bar collapsed width for the current bubble bar visibility state. Used to
|
||||
* reserve space for the bubble bar when transitioning taskbar view into overflow.
|
||||
*/
|
||||
public float getBubbleBarMaxCollapsedWidthIfVisible() {
|
||||
return mControllers.bubbleControllers
|
||||
.filter(c -> !c.bubbleBarViewController.isHiddenForNoBubbles())
|
||||
.map(c -> c.bubbleBarViewController.getCollapsedWidthWithMaxVisibleBubbles())
|
||||
.orElse(0f);
|
||||
}
|
||||
|
||||
/** Returns true if bubble bar controllers present and enabled in persistent taskbar. */
|
||||
public boolean isBubbleBarEnabledInPersistentTaskbar() {
|
||||
return Flags.enableBubbleBarInPersistentTaskBar()
|
||||
|
||||
Reference in New Issue
Block a user