Commit Graph

24 Commits

Author SHA1 Message Date
Ats Jenk
f628796fc6 Update bubble bar bounds in shell
Shell keeps track of bubble bar bounds for positioning and animating the
expanded view.
Bubble bar location can be changed when dragging the expanded view or
bubble bar itself.
Previously bounds were only reported when expanding a bubble. But after
adding drag support, bounds can change outside of expand action.
Implement a new bubbles API to report bubble bar bounds to shell
whenever they change in launcher.
Keep track of last reported bounds to ensure that we only send bounds
over when they change and when expand API has not already reported the
bounds.

Bug: 332423960
Flag: ACONFIG com.android.wm.shell.enable_bubble_bar DEVELOPMENT
Test: drag expanded bubble from one side to the other, collapse it,
  observe that collapse animation collapses the view into the bar
Change-Id: If1bf31a04b8f134a1b055fddccd276e924ed98b6
2024-04-03 09:07:10 -07:00
Ats Jenk
2ae49c6cab Update bubble bar location in shell
Send wmshell updates about bubble bar position when it is dragged
across the center divide.

Bug: 330585397
Flag: ACONFIG com.android.wm.shell.enable_bubble_bar DEVELOPMENT
Test: manual
  - with bubble bar on home screen
      - long press and drag bubble bar around on same side, no drop
        target
      - release the bubble bar, it snaps back to the original position
      - long press and drag bubble bar to other side, see drop target at
        the corner
      - release bubble bar, it snaps to the new side
      - long press and drag bubble bar to other side and back, see the
        drop target visible, release, snaps back to the original
        position
  - repeat above steps from an app, swipe up taskbar for bubble bar
Change-Id: I88faf641b9c07a19cfbb7a1feb8170a64269ac1f
2024-04-02 13:38:29 -07:00
Ats Jenk
4186cf1b96 Fix bubble bar arrow visibility during animation
Bubble bar pointer arrow was being drawn outside of BubbleBarView
bounds.
This caused issues when alpha was applied to the BubbleBarView. With
alpha, BubbleBarView draw was clipped to its bounds and arrow was no
longer visible. This led to the arrow flickering during move animations.
Move animation updates alpha.
Move the pointer arrow inside the bounds of the bar view. Update the bar
height to include the arrow.
Update callers who rely on bubble bar content height to take into
account extra height for the arrow.

Bug: 313661121
Flag: ACONFIG com.android.wm.shell.enable_bubble_bar DEVELOPMENT
Test: move bubble bar left and right, observe arrow is visible
Change-Id: I05866b5c944361b2f10437c3641527ed3c594047
2024-03-06 15:06:05 -08:00
Ats Jenk
77b6225d91 Animate bubble bar location changes
When it is not the initial bubble data, animate bubble bar location
change.

Bug: 313661121
Flag: ACONFIG com.android.wm.shell.enable_bubble_bar DEVELOPMENT
Test: manual, move expanded view from one side to the other, observe the
  location change animates

Change-Id: I52117a31d02e7160ca1d3dc3e724bda2e38f6cbf
2024-03-06 15:03:57 -08:00
Ats Jenk
cd0f35383f Introduce bubble bar location that is driven by shell
Adds bubble bar location to the update object that is sent by shell.
Allows repositioning the bubble bar if the location changes.

Bug: 313661121
Flag: ACONFIG com.android.wm.shell.enable_bubble_bar DEVELOPMENT

Test: manually sending the update to reposition, dragging coming soon
Change-Id: Id430a98116d860a7badcf607edc166c751e12cf8
2024-03-06 10:17:11 -08:00
Mady Mellor
cc138663ca Launcher: use aconfig flag for bubble bar
Flag: ACONFIG com.android.wm.shell.enable_bubble_bar DISABLED
Test: make & enable / disable flag to check if it works:
      adb shell device_config put multitasking
         com.android.wm.shell.enable_bubble_bar true
Test: PlatformScenarioTests:
      android.platform.test.scenario.sysui.bubble.BubbleBarTest
Bug: 286246694
Change-Id: I0820973848675e8596e0e1605c7e43158d870382
2024-02-01 23:18:53 +00:00
Ats Jenk
d22d73a08c Send bubble bar bounds in display coordinates to wmshell
Bubble bar can be positioned to the left or right side of the screen.
Instead of sending offsets to wmshell, send the bounds of the bar, in
screen coordinates. WMShell can choose how to use that information.

Flag: LEGACY persist.wm.debug.bubble_bar DEVELOPMENT
Bug: 273310265
Test: repeat with LTR and RTL system languages:
  - have some bubbles, open an app, expand the bubbles by swiping up
    from bubble bar handle
  - have some bubbles, open an app, expand bubble bar by swiping up on
    navbar handle, tap on bubble bar to expand bubbles
  - have some bubbles, be on home screen, tap on bubble bar to expand a
    bubble

Change-Id: Id2d24831e567171b442ae7f34f055b7195a3e060
2024-01-29 11:32:20 -08:00
Liran Binyamin
e41e6185e4 Make the bubble bar flag dynamic in Launcher.
Changing the flag currently requires a reboot, because it is read once when the process starts and never changes.
This change triggers a re-read of the flag value from SystemProperties whenever Taskbar is recreated.
This allows setting the flag as part of integration tests for bubble bar.

Bug: 273994695
Test: Manual:
       - turn flag off
       - create bubbles
       - observe floating bubbles are added
       - turn flag on
       - change navigation mode to gesture navigation
       - observe bubble bar becomes visible
Change-Id: I277ea6aa2c8d3ab04094537bf4cd31630310dfec
2023-10-03 10:49:30 -04:00
Liran Binyamin
a833af316b Adjust the hotseat when the bubble bar becomes visible
When the bubble bar becomes visible the space between icons in the
hotseat is now adjusted. This change only does it when the QSB is
above the icons, but this will be changed in the future to be based
on the amount of space between the hotseat and the edge of the screen.

When the hotseat is adjusted, the new width is smaller by the size of
2 icons. The icons are then translated to be evenly spaced within the
boundaries of the new width.

Since the adjustment is only applied when the QSB is above the icons,
it is resized accordingly to the new width.

All visual updates currently snap to the new position, but will be animated
in a follow up.

Demo: https://recall.googleplex.com/projects/3391fc5c-599d-4827-b6f8-d2deb160aa99/sessions/fad1a5c5-e9cf-4586-92e4-1e92df3b002e

Bug: 280494203
Test: Manual (on tangor)
      - Set device to landscape
      - Make the bubble bar visible by adding a bubble
      - Rotate to portrait mode
      - Observe that the hotseat is adjusted
      - Rotate to landscape
      - Observe that the hotseat adjustment is removed
      - Rotate back to portrait
      - Observe that the hotseat is adjusted again
      - Dismiss the bubble to hide he bubble bar
      - Observe the hotseat adjustment is removed

Change-Id: I5b02a60b6cb301ffa2507a6d825c748a782cca18
2023-09-13 17:08:42 -04:00
Ivan Tkachenko
72597e32cb Bubble bar user education
Launcher support for the user education logic described in ag/24587530.

Bug: 275077944
Test: TBD
Flag: WM_BUBBLE_BAR
Change-Id: I2b9a6ecde332de6305ad574c41d8322d8bb5d7ad
2023-09-06 14:19:31 +00:00
Liran Binyamin
95d84f5e06 Don't animate in the bubble bar unless there are bubbles
Fixes: 290608658
Test: Manual:
      - Remove all bubbles
      - Lock and unlock device
      - Observe that bubble bar is not displayed

      - Remove all bubbles
      - Restart launcher process
      - Observe that bubble bar is not displayed

Change-Id: I850d307394230968f86abc23ba0b4e94f55e10f0
2023-07-26 15:38:47 -04:00
Liran Binyamin
60240207bb Handle the event of first bubble added.
When the first bubble is added we set the visibility of the bubble bar
to VISIBLE if the stash controller is unstashed. The issue is that once
bubbles are gone we no longer update the stash state in the controller,
so it becomes stale and can't be used when the first bubble is added.

This change introduces a new method for handling the transition from
the state where both bar and handle are invisible into the state where
one of them becomes visible. We can't use the existing stashBubbleBar
and showBubbleBar methods because those transition from one to the other.
Using them when both are invisible results in one of them becoming visible
and then invisible again.

Fixes: 290992144
Fixes: 291074646

Test: Manual:
       - Add bubble in the test app by double-tapping on a chat (non expanding notification)
       - Observe that the handle becomes visible and the bar is invisible
       - Dismiss bubble
       - Add bubble in the test app by tapping on the button on the right (auto expanding)
       - Observe that the bar becomes visible and expanded
Change-Id: I61334c67c255a6ed074fa8c834f4a5a1547539bf
2023-07-19 17:02:57 -04: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
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
Mady Mellor
1812924a53 Handle any image / label changes for bubble updates in bubble bar
When we get an update to a bubble it could mean that there's a new
message OR that something about the visual representation changed.

This CL modifies BubbleBarController to handle any visual changes
that might have occurred to an updated bubble (e.g. bubble image
changed).

It does this by updating the bubbleInfo on the existing bubble.

Test: manual
Bug: 269670235
Change-Id: I03d2510aef335dafccb32d6adcd4c6adf8b3297d
2023-07-11 13:34:46 -07:00
Mady Mellor
4e0ec1e458 Unify calls to sysuiProxy#showBubble into one method
This will make it easier to note that a bubble has been "visited"
so that we can hide the update dot (coming in future CL).

Test: manual
Bug: 269670235
Change-Id: Ie2dbbc478198ece65c05927295d3c3031a7be82e
2023-07-10 13:38:15 -07: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
Liran Binyamin
26daeace30 Ensure the overflow is added first to the bubble bar
Previously there was a race between initializing the bubble bar
which creates the overflow and sending an initial bubble state
update event from WMShell. If the event is processed first then
bubbles are added before the overflow.

This change ensures that the overflow is created if needed when
the initial event is sent from WMShell.

Fixes: 288414998
Test: - manual
        - Enable 3 button navigation
        - Create some bubbles
        - Switch to gesture navigation
        - Overflow should be added first (below other bubbles)
Change-Id: Ie001c76a3f587d95021f4b7202492b3071706fd0
2023-06-22 14:09:04 -04:00
Liran Binyamin
f78d55ba76 Adds an overflow bubble to the bubble bar.
Bug: 271468319
Test: Tested on a physical device
Change-Id: Ib4ad62779173ab8010e5e5d25bf5415fee1b1d41
2023-05-17 16:37:48 +00:00
Liran Binyamin
a72094ad66 Merge "Wire up the important conversation bit in BubbleBarController." into udc-dev 2023-05-09 18:02:53 +00:00
Mady Mellor
50e8d0ff60 Add Bubbles and BubblesListener to SystemUiProxy and use it
Adds a method to call into WMShell to set the listener and
indicate when a bubble is shown or when the expanded state
changes.

BubbleBarController sets or clears out the listener.

BubbleBarViewController calls SystemUiProxy when bubbles are shown
or when the expanded state changes.

Bug: 253318833
Test: manual, with other CLs, see go/bubble-bar-tests
Flag: WM_BUBBLE_BAR
Change-Id: I2364b9bbdea237fc268b0999d9c896585c194a86
2023-05-05 14:18:00 -07:00
Liran Binyamin
481da63b39 Wire up the important conversation bit in BubbleBarController.
Fixes: 269671451
Test: Tested on a physical device
Change-Id: Ice0bb081e19a817bd163141f38614ea7ecc21be9
2023-05-04 16:45:49 -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