Commit Graph

20 Commits

Author SHA1 Message Date
Liran Binyamin
90d3a422f8 Cap the width of the bubble bar when collapsed
When the bubble bar is collapsed we now show at most 2 bubbles.

Fixes: 295020145
Test: Manual
      - Add 1 bubble to the bubble bar
      - Collapse bubble bar
      -- Observe that only that bubble is visible
      - Expand the bubble bar
      -- Observe that both that bubble and the overflow are visible
      - Add another bubble
      -- Observe that 2 bubbles are visible when collapsed
      - Add another bubble
      -- Observe that only the first 2 bubbles are visible when collapsed
Change-Id: I5f534f53eefe9a920b8b3258813d67d021c5f2a8
2023-08-23 07:40:56 +00:00
Ivan Tkachenko
90a769d1d3 Bubble bar dismiss interaction
A single bubble and the bubble stack dismiss functionality is implemented using `BubbleDragController`. It attaches a touch listener to the corresponding views and handles gesture interactions.
* When the view is long clicked the dragging to dismiss interaction starts. It scales up the dragged view and presents the dismiss view in the bottom of the window.
* When the bubble or the bubble stack is dragged close to the dismiss target area, it gets pulled towards it and sticks to it. The `MagnetizedObject` and `MagneticTarget` classes are used for it.
* When the dragged view is released outside of the dismiss area, it moves back to the initial position with animation.
* When the dragged bubble is released inside of the dismiss area, it will dismiss the bubble with animation and remove it from the stack.
* When the dragged bubble bar stack is released inside the dismiss area, all the bubbles will get dismissed and the bubble bar will dissapear.

Bug: 271466616
Test: manual, TBD
Flag: WM_BUBBLE_BAR
Change-Id: I83393898be61ec522db92688ac2e111ef7d72fe6
2023-07-28 18:17:09 +00:00
Liran Binyamin
36325fd9d7 Check that a bubble exists before reordering it
This avoids re-adding bubbles that have already been removed
after dismissing multiple bubbles at once.

Fixes: 291738088
Test: Manual
      - Add 2 bubbles A and B to the bubble bar
      - Expand the bubble bar
      - Tap 3 dot menu and dismiss
      - Repeat for the next bubble
      - Observe that bubble bar is gone
      - Add a new bubble C
      - Observe that the bubble bar contains only bubble C
Change-Id: Id53811a103d245647489ab8d442cbb2004e0e700
2023-07-18 15:42:56 -04:00
Mady Mellor
d76c9cbcd7 Merge "Revert "Bubble bar drag to dismiss"" into udc-qpr-dev 2023-07-13 01:38:05 +00:00
Mady Mellor
e7cc3997d0 Revert "Bubble bar drag to dismiss"
Revert submission 23879277-bubble_bar_dismiss

Reason for revert: issues with touch

Reverted changes: /q/submissionid:23879277-bubble_bar_dismiss

Change-Id: I4311abff0e542907b09b0aa865d68257b47f6af1
2023-07-12 22:27:17 +00:00
Ivan Tkachenko
e3d4a69749 Merge "Bubble bar drag to dismiss" into udc-qpr-dev 2023-07-12 17:13:50 +00:00
Liran Binyamin
2c1e84b3a1 Merge "Pass bubble bar offsets instead of position to WMShell" into udc-qpr-dev 2023-07-12 14:41:32 +00:00
Ivan Tkachenko
eceb797d2f Bubble bar drag to dismiss
* Added dismiss view to the taskbar
* Bubble drag to dismiss of:
  * A single bubble when the bubble bar stack is expanded
  * All bubbles when the bubble bar stack is colapsed
* Added dismiss related calls to WMShell in SystemUI through SystemUIProxy

Bug: 271466616
Test: manual, TBD
Flag: WM_BUBBLE_BAR
Change-Id: Ibb62a0b1ab9fafa8a3acf07450ce2132ed605adc
2023-07-12 07:13:12 +01:00
Mady Mellor
c299ad645a Show / hide the "update" dot on bubbles in bubble bar
Updates BubbleView to include logic to render the update dot on a
bubble. This only shows for BubbleBarBubbles, not the overflow.

We only show the dot (and the badge) when:
- the bubble has new content / appropriate flags set
- AND the bubbles are expanded
  OR on the first bubble when bubbles are collapsed
- AND when the flyout is not animating (this bit doesn't exist yet)

If a bubble has a dot and is opened, the dot will animate away.
To do this, we update the flags set on a bubble.

The flag needs to be set on WMShell side as well as Launcher side.
When a bubble is shown by WMShell, it automatically updates the flag.
This CL adds code to update the flag on Launcher side when we call
into WMShell to show the bubble.

Test: manual
Bug: 269670235
Change-Id: I32f652effa9a73c567981aa5a2a5864e9c3c0c66
2023-07-11 15:09:29 -07:00
Liran Binyamin
1c03ed001d Pass bubble bar offsets instead of position to WMShell
This allows WMShell to calculate the position of the expanded view
correctly when the bubble bar is being expanded from stashed.

Test: See ag/24012908
Change-Id: I7b917e761c827135942d918917c920b06650f496
2023-07-11 17:08:09 -04:00
Liran Binyamin
7fedde35ad Merge changes I93c2232d,I00daff83 into udc-qpr-dev
* changes:
  Align the bubble bar with the taskbar in overview and app
  Update the bubble bar offset on Home
2023-07-06 18:40:27 +00:00
Liran Binyamin
c06c7ff6fa Update the bubble bar offset on Home
This is an initial change that positions the bubble bar aligning it
with the center of the hotseat icons. We still need to center it
with the taskbar when in overview.

This change also fixes the touch issues where sometimes the hotseat
icons don't respond to taps. The fix is twofold:

1. Make sure that taskbar insets are always updated when
   BubbleStashController#setBubblesShowingOnHome is called.
2. Update the touchable region in TaskbarInsetsController to account
   for the Y translation of the bubble bar bounds when the bubble
   bar is visible.

Demo: https://screenshot.googleplex.com/6NRyu2CR7Bjs32x

Bug: 286247080
Test: Manual on a physical device
Change-Id: I00daff8341e4d8f5d141b5e0220726f6c03b437c
2023-07-05 17:29:52 -04:00
Liran Binyamin
16b05e251b Ensure overflow isn't selected when bar is collapsed
After the bubble bar collapsing animation completes, and reordering
is finished, if the bubble overflow is selected, update the selected
bubble to be the first bubble. This ensures that the overflow
is not selected the next time the bubble bar is expanded.

This is done through a callback from the BubbleBarView to the
BubbleBarController with the key of the first bubble. Ideally the view
would just notify that the selected bubble needs to be updated, but
the controller doesn't hold ordering info.

Fixes: 289280431
Test: manual
       - Add 2 bubbles to the bubble bar
       - Expand the bubble bar. The first bubble A should be selected
       - Select the second bubble B
       - Select the overflow
       - Tap on the overflow again to collapse the bubble bar
       - Tap on the bubble bar to expand it
       - Observe that bubble B is first and selected
Change-Id: I0f9c2d628cfaf3a80da55ff634284687425e949a
2023-07-05 12:20:46 -04:00
Mady Mellor
d8cb90f010 Merge changes Iaee9aeb0,I76587cf6 into udc-qpr-dev
* changes:
  Fade the bubble bar arrow in and out when the bubble bar expands and collapses.
  Animate the bubble bar width and the bubbles within it as it expands and collapses.
2023-06-27 17:35:58 +00:00
Liran Binyamin
cd5591a773 Don't remove the overflow from the bubble bar
When a new bubble is added to the bar and we're over the limit
remove the second to last bubble instead of the overflow.

This change also updates the key of the overflow bubble to
match the one in wmshell.

Bug: 287121592
Test: manual - Add 6 bubbles to the bubble bar
             - The overflow bubble should still be there
Change-Id: Ibd3ab73be5d3afb49f771a1925ebda2c45b55136
2023-06-16 14:51:33 -04:00
Liran Binyamin
3e94d52732 Fade the bubble bar arrow in and out when the bubble bar expands and collapses.
Demo: http://recall/-/bJtug1HhvXkkeA4MQvIaiP/hKhpM98JZe1gT8bwtYkNeW

Bug: 280604480
Test: Tested on a physical device
Change-Id: Iaee9aeb0a8c1e2bd61816964e4cae5f7bea926ff
2023-06-15 18:07:54 +00:00
Liran Binyamin
35b1f38403 Animate the bubble bar width and the bubbles within it as it expands and collapses.
Fixes: 280604480
Test: Tested on a physical device
Change-Id: I76587cf6ba97700b49c902d42cf4db5f7f3a7152
2023-06-15 17:39:20 +00:00
Liran Binyamin
4e909d07ac Animate the position of the selected bubble arrow in the expanded bubble bar.
Fixes: 280605070
Test: Tested on a physical device
Change-Id: I961254527ba9a26d211c2c348a937a424fa2fb4d
2023-05-09 16:35:30 -04:00
Mady Mellor
a088308343 Creates BubbleBarController
Creates BubbleBarController which is responsible for registering
a listener to hear about bubble state changes and propagates those
changes to BubbleBarViewController.

Additionally, it loads the data and creates the individual BubbleViews
that are added to BubbleBarView.

Bug: 253318833
Test: manual, with other CLs, see go/bubble-bar-tests
Flag: WM_BUBBLE_BAR
Change-Id: I45b0d3a764cd14b2fc5d34aec2b81c7fecb541cf
2023-04-20 09:12:12 -07:00
Mady Mellor
55913d53c6 Creates BubbleBarView & BubbleBarViewController & friends
BubbleBarView shows BubbleViews in a bar similar to transient
taskbar. BubbleBarView can be collapsed (bubbles in a stack) or
expanded (bubbles all visible). When expanded, WMShell will be
notified to show the appropriate expanded bubble view (not part of
this CL).

Also creates BubbleControllers which contains BubbleBarViewController
and will eventually contain other controllers related to stashing
for the bubble bar.

Bug: 253318833
Test: manual, with other CLs, see go/bubble-bar-tests
Flag: WM_BUBBLE_BAR
Change-Id: I990ab3da6614db90ffff8c40281dc7f16b3957f6
2023-04-17 16:36:28 -07:00