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
2024-08-07 15:52:16 -07:00
parent eeb98c8e75
commit 6ba789a98f
7 changed files with 117 additions and 14 deletions
@@ -15,8 +15,15 @@
*/
package com.android.launcher3.taskbar.bubbles;
import static com.android.launcher3.taskbar.TaskbarViewController.ALPHA_INDEX_BUBBLE_BAR;
import android.graphics.Rect;
import android.view.View;
import com.android.launcher3.taskbar.TaskbarControllers;
import com.android.launcher3.taskbar.bubbles.BubbleBarViewController.TaskbarViewPropertiesProvider;
import com.android.launcher3.taskbar.bubbles.stashing.BubbleStashController;
import com.android.launcher3.util.MultiPropertyFactory;
import com.android.launcher3.util.RunnableList;
import java.io.PrintWriter;
@@ -79,7 +86,20 @@ public class BubbleControllers {
bubbleStashedHandleViewController.orElse(null),
taskbarControllers::runAfterInit
);
bubbleBarViewController.init(taskbarControllers, /* bubbleControllers = */ this);
bubbleBarViewController.init(taskbarControllers, /* bubbleControllers = */ this,
new TaskbarViewPropertiesProvider() {
@Override
public Rect getTaskbarViewBounds() {
return taskbarControllers.taskbarViewController.getIconLayoutBounds();
}
@Override
public MultiPropertyFactory<View>.MultiProperty getIconsAlpha() {
return taskbarControllers.taskbarViewController
.getTaskbarIconAlpha()
.get(ALPHA_INDEX_BUBBLE_BAR);
}
});
bubbleDragController.init(/* bubbleControllers = */ this);
bubbleDismissController.init(/* bubbleControllers = */ this);
bubbleBarPinController.init(this);