Update expanded view drop target size based on value from shell

When a bubble drag starts, shell sends the current expanded view size
over as part of BubbleBarData. Update the size stored in
BubblePinController based on latest value.
Update drop target visual to match the spec. It should have 24dp insets
compared to expanded view and 28dp corner radius.

Bug: 330585402
Test: drag bubble in landscape, check that drop target for expanded view
  matches with what is shown when expanded view is dragged
Test: drag bubble in portrait, check that the drop target for expanded
  view, matches with what is shown when expanded view is dragged
Flag: ACONFIG com.android.wm.shell.enable_bubble_bar DEVELOPMENT
Change-Id: Ic11c4c5c675107543ba08f24a4138cda422d24c1
This commit is contained in:
Ats Jenk
2024-05-08 14:05:03 -07:00
parent ef8872bb01
commit f3224cf847
5 changed files with 39 additions and 13 deletions

View File

@@ -150,6 +150,7 @@ public class BubbleBarController extends IBubblesListener.Stub {
private BubbleBarViewController mBubbleBarViewController;
private BubbleStashController mBubbleStashController;
private BubbleStashedHandleViewController mBubbleStashedHandleViewController;
private BubblePinController mBubblePinController;
// Keep track of bubble bar bounds sent to shell to avoid sending duplicate updates
private final Rect mLastSentBubbleBarBounds = new Rect();
@@ -169,6 +170,7 @@ public class BubbleBarController extends IBubblesListener.Stub {
BubbleBarLocation bubbleBarLocation;
List<RemovedBubble> removedBubbles;
List<String> bubbleKeysInOrder;
Point expandedViewDropTargetSize;
// These need to be loaded in the background
BubbleBarBubble addedBubble;
@@ -186,6 +188,7 @@ public class BubbleBarController extends IBubblesListener.Stub {
bubbleBarLocation = update.bubbleBarLocation;
removedBubbles = update.removedBubbles;
bubbleKeysInOrder = update.bubbleKeysInOrder;
expandedViewDropTargetSize = update.expandedViewDropTargetSize;
}
}
@@ -216,6 +219,7 @@ public class BubbleBarController extends IBubblesListener.Stub {
mBubbleBarViewController = bubbleControllers.bubbleBarViewController;
mBubbleStashController = bubbleControllers.bubbleStashController;
mBubbleStashedHandleViewController = bubbleControllers.bubbleStashedHandleViewController;
mBubblePinController = bubbleControllers.bubblePinController;
bubbleControllers.runAfterInit(() -> {
mBubbleBarViewController.setHiddenForBubbles(
@@ -419,6 +423,9 @@ public class BubbleBarController extends IBubblesListener.Stub {
updateBubbleBarLocationInternal(update.bubbleBarLocation);
}
}
if (update.expandedViewDropTargetSize != null) {
mBubblePinController.setDropTargetSize(update.expandedViewDropTargetSize);
}
}
/** Tells WMShell to show the currently selected bubble. */