Commit Graph

99 Commits

Author SHA1 Message Date
Mady Mellor bd446142ae Fix the overflow not being added sometimes
The runnable to add the overflow was only being run when the view
was animated (i.e. while expanded); not when it was collapsed.

Flag: com.android.wm.shell.enable_bubble_bar
Bug: 358304168
Test: manual - add more than 5 bubbles while collapsed
Change-Id: Ibdea61eaf8ecb1d2e3f9ea4fced679b2826d3f9b
2024-09-11 10:24:31 -07:00
Ats Jenk 332828b340 Animate alpha for bubbles and background (3/n)
Use separate timings for bubble icons and bubble bar background when
stashing and unstashing.
Follows alpha timings applied to taskbar background and icons.

Bug: 345488489
Test: TransientBubbleStashControllerTest
Test: stash and unstash bubble bar in app by swiping up from taskbar
Test: expand and collapse bubble bar in app by swiping up on bar
Test: expand and collapse bubble bar on home screen by tapping on it
Flag: com.android.wm.shell.enable_bubble_bar
Change-Id: I485f6346539cb6c8ea6dd4d15f25a6421021fec1
2024-09-09 15:23:51 -07:00
Ats Jenk 9eadd68e01 Align bubble bar stash anim with taskbar (1/n)
Only scale bubble bar background during stash and unstash animation.
Follows the logic used for taskbar. We scale only the background and
clip the icons separately.

Bug: 345488489
Test: PersistentBubbleStashControllerTest
Test: TransientBubbleStashControllerTest
Test: BubbleBarViewAnimatorTest
Test: stash and unstash bubble bar in app by swiping up from taskbar
Test: expand and collapse bubble bar in app by swiping up on bar
Test: expand and collapse bubble bar on home screen by tapping on it

Flag: com.android.wm.shell.enable_bubble_bar
Change-Id: Ifc7922c444f2179fc49643424815e5e7dde519cc
2024-09-09 15:23:48 -07:00
Luca Zuccarini d75eacf30d 3/3 Move some Shell utils to the Shared package.
Bug: 322791067
Flag: EXEMPT move only
Test: NA
Change-Id: Iabc42e4c1d9c13667e9d91be5789cf295f3332e1
2024-09-02 09:23:34 +00:00
Ats Jenk ba6c9f06ed Merge "Scale bubble bar to the width of the handle" into main 2024-08-30 23:06:43 +00:00
Ats Jenk da9e36e4e7 Scale bubble bar to the width of the handle
When animating bubble bar from the stash handle, scale the width to the
handle.
Bubble bar is already almost the size of the handle, but a small scale
is still added.

Bug: 345488489
Flag: com.android.wm.shell.enable_bubble_bar
Test: atest TransientBubbleStashControllerTest
Test: slow animations down and unstash and stash bubble bar, observe
  that the width of the bubble bar scales down to the handle
Change-Id: I54dc228fa41d4d494bfb15e191d2ba563c0970c7
2024-08-30 10:17:29 -07:00
Mady Mellor cc843823a6 Add some info about the overflow in bubble bar dump
Flag: com.android.wm.shell.enable_bubble_bar
Test: manual - add some bubbles to bubble bar, take a BR and look
               at the dump
Bug: 358304168
Change-Id: I91e50591df166e928d06ba9a29f69f923218de71
2024-08-29 14:20:38 -07:00
Liran Binyamin b0801dcc3c Merge "Update both width and height in BubbleBarView" into main 2024-08-26 11:28:19 +00:00
Liran Binyamin b93e454737 Update both width and height in BubbleBarView
We currently only update the width of the bubble bar but the
height is only updated when the icon size changes, so it's often
inaccurate. This affects screenshot testing where the bubble bar
isn't fully visible in the screenshot.

Flag: com.android.wm.shell.enable_bubble_bar
Bug: 355454021
Test: manual
       - used the bar normally to make sure it's not broken
Change-Id: If780308e10e7478a3651654e5fc2b3f9c4e36c14
2024-08-21 05:18:20 -04:00
Liran Binyamin 873fbaaebf Merge "Check bubble count for initial state animation" into main 2024-08-20 14:08:14 +00:00
Treehugger Robot 1d94ee8627 Merge "If we're adding / removing a bubble, don't forget to add the overflow" into main 2024-08-15 16:49:46 +00:00
Mady Mellor a7f2d83b61 If we're adding / removing a bubble, don't forget to add the overflow
One case I missed was a bubble being added/removed AND the overflow
showing... this isn't the nicest, but when the add/remove animation
is done, animate the overflow in.

Flag: com.android.wm.shell.enable_bubble_bar
Fixes: 358304168
Test: manual - don't have the overflow showing, add a 6th bubble,
               observe that the overflow appears
Change-Id: I1a9cec3970f5535e935f3404fa6dbd6de2f69fa5
2024-08-14 16:23:07 -07:00
Liran Binyamin afdad57bdf Don't reset alpha after dragging to dismiss
After dragging the bubble bar to dismiss, don't reset its alpha
value.

Flag: com.android.wm.shell.enable_bubble_bar
Fixes: 359804931
Test: manual
      - Create a bubble in the bubble bar
      - Drag bubble bar to dismiss
      - Create another bubble
      - Observe the new bubble does not flicker
Change-Id: I8d56f71d38ec33acda8efade50735b59254d77d4
2024-08-14 08:08:40 -04:00
Liran Binyamin 229696a0e4 Check bubble count for initial state animation
With optional overflow, we need to check for actual bubble count
before animating the bubble bar to its initial state.

Flag: com.android.wm.shell.enable_bubble_bar
Fixes: 359403793
Test: manual
       - create first bubble on home
       - observe bubble bar animates correctly to initial state
       - add second bubble
       - observe bubble bar bounces correctly and does not slide
         in from the bottom of the screen
Change-Id: I53a34bc00b24e8a6504bcca0532054755554b9ac
2024-08-14 03:47:35 -04:00
Liran Binyamin de9b1df642 Merge "Remove BubbleBarView.mIsAnimatingNewBubble" into main 2024-08-11 08:25:29 +00:00
mpodolian 6ba789a98f 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
2024-08-09 11:10:28 -07:00
Liran Binyamin 09c2ad248b Remove BubbleBarView.mIsAnimatingNewBubble
We now use BubbleBarViewAnimator directly to check if there's a new
bubble animation.

Flag: com.android.wm.shell.enable_bubble_bar
Bug: 339683389
Test: presubmit
Change-Id: I5f884095125e6226338aee14d9d08e46b87ff2ec
2024-08-08 07:49:04 -04:00
Ats Jenk a5fa9bc911 Merge "Update bubble a11y nav order in bubble bar" into main 2024-08-07 16:39:33 +00:00
Ats Jenk cfb4e22996 Update bubble a11y nav order in bubble bar
When swiping left, a11y focus should move to the bubble shown on left.
Same for swiping right. This should happen regardless of the side bubble
bar is placed on.

Bubble views get added to the container based on recency. The most
recent bubble is placed as child at index 0.
For example if we have bubbles (1)(2)(3)(+) and (1) is the most recent,
then the child index for (1) is 0. This is always the same, regardless
of bubble bar location.

Bubble bar location does affect how bubbles appear on screen. If the bar
is on the left, most recent bubble is shown on the right.
The on screen order for the above bubbles would be: (+)(3)(2)(1).
If the same bubble bar is on the right, bubble order would be:
(1)(2)(3)(+).

For a11y navigation we want to follow the order that bubbles are shown
on the screen. Default navigation order follows how the child views are
added to the parent container. For bubbles the child view order may not
match what is shown on screen. Due to this, we override the default
navigation order. And set up the previous and next elements to navigate
to based on bubble bar location and bubble order.

Bug: 344674605
Flag: com.android.wm.shell.enable_bubble_bar
Test: have bubble bar expanded on the right, swipe left and check that
  bubble on the left is selected, swipe right and check that bubble on
  the right is selected
Test: have bubble bar expanded on the left, swipe left and check that
  bubble on the left is selected, swipe right and check that bubble on
  the right is selected
Change-Id: Iae63ac13d5477883952b836f6872e4c7c7fb88c1
2024-08-06 14:07:13 -07:00
Mady Mellor 8c629fd8b5 Support optional bubble overflow in bubble bar
This is similar to the animations that add / remove a bubble at the
same time -- the overflow is generally added when a bubble is removed.
The overflow is generally removed when a bubble is added (i.e. user
promotes a bubble out of the overflow).

There are a couple of additional cases:
- when bubbles are first added to the bar -- if there were saved
  bubbles in the overflow, the view should be added
- an app could cancel its bubbles / remove its shortcuts and not have
  any in the stack but could have some in the overflow & it could
  become empty without an addition.

Flag: com.android.wm.shell.enable_optional_bubble_overflow
Flag: com.android.wm.shell.enable_bubble_bar
Test: manual - add bubbles to the bubble bar for first time
             => observe there is no overflow
             - dismiss a bubble
             => observe the overflow is added, tap on it, tap on the
                bubble in it
             => observe that bubble is added & the overflow disappears
             - dismiss all the bubbles
             - add a bubble
             => observe the overflow is there & has the previously
                dismissed bubbles
             - cancel all the bubbles that are in the overflow via
               adb
             => observe the overflow is remvoed
Bug: 334175587
Change-Id: I2b6e855e65520b4b2b1fde7757d46f00a468b4a6
2024-08-05 12:25:33 -07:00
Mykola Podolian 0211d2e168 Merge "Change shadow drawing for bubble bar icons." into main 2024-07-30 17:16:51 +00:00
mpodolian c10de368a2 Change shadow drawing for bubble bar icons.
Removed an outline provider for the BubbleView, so framework shadows are
not drawn. Use BubbleBarBubbleIconsFactory to generate icon with the
shadow so it looks consistent with the taskbar and the hotseat bar.

Fixes: 345490679
Flag: com.android.wm.shell.enable_bubble_bar
Test: manual, screenshot before fix:
https://screenshot.googleplex.com/86ZhQENANboZK87
screenshot after fix:
https://screenshot.googleplex.com/3hNboaSaS9tZ9DS

Change-Id: I9ae3624e652e4f609b29ae0f57a47d4a6d01e94b
2024-07-29 16:25:54 -07:00
Liran Binyamin 612263104b Animate the bubble badge
The bubble badge now scales together with the expand and collapse
animation of the bubble bar. The badge for the selected bubble is
always kept at full scale.

Flag: com.android.wm.shell.enable_bubble_bar
Fixes: 349826874
Test: manual
       - create some bubbles in the bubble bar
       - expand and collapse the bar
       - observe badge icons scale accordingly
Change-Id: I04e9174f4a921e404cb3162337f594c16478b16c
2024-07-29 08:06:55 -04:00
mpodolian 6ba541642e Improvement for the Bubble Bar Bubbles' Shadows
The issue was caused by the alpha animation applied to the bubble bar.
Added code to check if the alpha applied to the bubble bar is less than
1 and instruct child bubble views not to provide a shadow outline in
such cases. While this is not a full fix, but rather an improvement,
b/345490679 should introduce a proper fix.

Bug: 345484712
Test: visual - go to any application and stash/unstash bubble bar
Flag: com.android.wm.shell.enable_bubble_bar
Change-Id: Icb6bdb009f4d5998ec1638f97de89f7a4c9feccf
2024-07-25 05:31:55 +01:00
Ats Jenk 8034c414c3 Announce when bubble bar expands or collapses
Add a talkback announcement that tells the user when bubble bar expands
or collapses. The announcement includes the bubble name.

Bug: 344670486
Flag: com.android.wm.shell.enable_bubble_bar
Test: expand bubble bar by tapping on it, hear the announcement
Test: collapse bubble bar by tapping on it, hear the announcement
Test: expand/collapse bubble bar from action menu, hear the announcement
Test: use action menu to move expanded bubble bar from one side to the
    other, make sure there is no announcement

Change-Id: I3908bda3eb9e3eb201067fb2c465c3a883ce73d4
2024-07-23 11:01:43 -07:00
Ats Jenk 496e56e4f5 Remove TODO for animating bubble bar view
The animation is added and the linked bug is fixed.
Removing obsolete TODO.

Bug: 280605790
Change-Id: I54ab56f93794afb7f7c23de4df1a348d30cbbf42
Test: NA
Flag: DOCS_ONLY
2024-07-20 00:06:34 +00:00
Ats Jenk 7f3b6c030b Create accessibility menu for bubble bar
Bug: 344670180
Test: open accessibility action menu on bubble bar. use menu to
  - expand bubble bar
  - dismiss bubble bar
Test: when bubble bar is on the right, the action menu has an option to
  move bubble bar to the left only, use menu to move bar to the left
Test: when bubble bar is on the left, the action menu has an option to
  move bubble bar to the right only, use menu to move bar to the right
Flag: com.android.wm.shell.enable_bubble_bar
Change-Id: Id875a43927bc3410a83d1342b9456330c9521085
2024-07-19 13:59:35 -07:00
Liran Binyamin 5013028596 Update bubble notification dot drawing
The notification dot drawing state depends on changes in the bubble
bar, so the bubble bar now directly requests updates to the dot at
specific states.

Flag: com.android.wm.shell.enable_bubble_bar
Fixes: 351904597
Fixes: 350782375
Test: atest BubbleViewTest
Test: manual basically just hammering on it trying to break it
       1. Dot appears for new bubble in all states of the bar
       2. Expand bubble bar
          - Dot is removed for selected and shows for others
            that have a dot
       3. After removing bubble while expanded
          - Dot is removed from newly selected bubble
       4. Collapse bubble bar
          - Dot is hidden for all bubbles
       5. Dot removed after tapping on a bubble when expanded

Change-Id: I4a940d38a8c77bddaf058b7ef882bab06886bcf4
2024-07-18 10:38:29 -04:00
Mykola Podolian 103191c589 Merge "Shadow for bubble icons fixed." into main 2024-07-10 19:38:23 +00:00
mpodolian a3921ddb67 Shadow for bubble icons fixed.
The bubble's outline was hardcoded with a fixed size. This caused a
shadow to be drawn using the hardcoded outline size, regardless of the
actual bubble view size. The BubbleView logic has been updated to use
the actual bubble size for the outline. The guarding flag has been
removed.

Bug: 340445019
Flag: com.android.wm.shell.enable_bubble_bar
Test: http://recall/-/gx8ASgewUeUS3QYohfrd1J/hqFtAZJnX0tCRONoFpSK3i
Change-Id: Iaa2c2d0bfeee2af9840acbcf11daaf8be2e0b7af
2024-07-10 16:36:22 +00:00
Liran Binyamin 4cebffa209 Merge "Fix missing bubble update dot" into main 2024-07-10 14:23:16 +00:00
Liran Binyamin e3eaacdcb2 Fix missing bubble update dot
Don't update the dot scale if the bubble bar is not collapsing or
expanding.

Flag: com.android.wm.shell.enable_bubble_bar
Bug: 351904597
Test: manual
       - Create 2 bubbles in the bubble bar
       - Select both bubbles to clear the dot
       - Launch an app to stash the bar
       - Send updates to both bubbles
       - Observe dot appears during each animation
       - Swipe up on the bubble bar
       - Observe dot disappears for the selected bubble but remains
         for the unselected bubble
Change-Id: I2cb6dd7ded261686ae73e497bd5d4841ebde35ef
2024-07-09 17:58:41 -04:00
Liran Binyamin e1d5ce2fda Merge "Dump some bubble data to dumpsys" into main 2024-07-09 21:41:46 +00:00
Liran Binyamin 0f08377436 Fix bubble translation x when bar is collapsed
Previously the translation x value for bubbles when the bar is
collapsed and on the right was 0 for the first bubble and some
fixed value for the rest of the bubbles. But if only 1 bubble
is visible when the bar is collapsed, as in the case when there
is only 1 bubble and the overflow, this ends up pushing the
overflow too far to the right.

This change updates the translation x value for bubbles when the
bar is collapsed and on the right, so that if only 1 bubble is
visible when collapsed, all bubbles have tx 0, otherwise if 2
bubbles are visible, the first has tx 0 and the rest have the same
tx value.

Flag: com.android.wm.shell.enable_bubble_bar
Fixes: 350962159
Test: manual
       - Add 1 bubble to the bubble bar
       - Make sure bubble bar is on the right
       - Expand and collapse the bar
       - Observe the overflow tx value is correct during the animation
Change-Id: I8401d70fa6f374ace58d9cdbe3302e39e7aedc70
2024-07-09 13:10:12 -04:00
Liran Binyamin fad57132d3 Dump some bubble data to dumpsys
Flag: NONE added dump logs
Bug: 350753857
Test: manual
       - adb shell dumpsys activity service com.android.quickstep
Change-Id: I19d328f99e5ba887aa508ea9ab16e9778f13698b
2024-07-09 10:34:19 -04:00
Liran Binyamin 13895f1be2 Don't animate the bubble that was dismissed by drag
This change stores the bubble that was dismissed by drag temporarily
in BubbleBarView so that when we remove the bubble, we can avoid
updating it as part of the animation.

This is step 1 in this change. Next I'll look into removing the
bubble immediately after dismissing it from the menu, and lastly
update sysui to not send the removal event back to launcher.

Flag: com.android.wm.shell.enable_bubble_bar
Bug: 349826879
Test: manual
       - have bubbles in the bubble bar and expand it
       - drag a bubble to dismiss it
       - observe the bubble does not reappear in the bar during
         the animation
Change-Id: I6628ce779db4aac8d82edd4ecf2a25dedf8feef9
2024-07-02 10:48:22 -04:00
Liran Binyamin b15dce1ec3 Merge "Animate the dot with the bubble bar" into main 2024-06-28 22:31:27 +00:00
Liran Binyamin 78cf7c1745 Animate the dot with the bubble bar
The previous behavior relied on a BEHIND_STACK suppression flag to
determine whether the dot should be drawn or not. setBehindStack was
called as part of updating bubble layout properties in BubbleBarView,
which happens at each animation frame of the bubble bar collapsing
and expanding.

Instead of using the suppression flag, we now directly set the dot
scale based on the progress of the collapse and expand animation.

This change also sets the badge visibility directly from BubbleBarView
and cleans up the BEHIND_STACK suppression flag.

Flag: com.android.wm.shell.enable_bubble_bar
Fixes: 349822532
Test: manual
       - have some bubbles and expand bar
       - trigger a new bubble X
       - observe bubble added with notification dot
       - tap on the selected bubble to collapse
       - observe the notification dot animates for bubble X
       - expand the bar
       - observe notification dot animates for bubble X
       - tap on bubble X
       - observe notification dot animates out
       - tap on a different bubble
       - observe notification dot does not reappear
Change-Id: I6efe0dfa8b4f73064cee8b45556ff0928f6f7c08
2024-06-27 12:55:04 -04:00
Liran Binyamin 2e1dd4644b Add a new bubble at limit while expanded
Handles adding a new bubble and removing an old bubble when the bar
is expanded and at the limit.

Demo when bar is on right: http://recall/-/bJtug1HhvXkkeA4MQvIaiP/dxhFKrctdR5I2F6Pvho6u8
Demo when bar is on left: http://recall/-/bJtug1HhvXkkeA4MQvIaiP/er4ZGQfg8OKHZ2aTi9OJ9N

Flag: com.android.wm.shell.enable_bubble_bar
Test: demos
Test: atest BubbleViewAnimatorTest
Fixes: 345795791
Change-Id: I4e75d61c8afdb81340823a1d77e55b15e3fd6bc0
2024-06-27 10:36:16 -04:00
Liran Binyamin 8af78f19a3 Merge "Animate bubble removal from the bar" into main 2024-06-20 20:57:34 +00:00
Liran Binyamin 7b426af15f Animate bubble removal from the bar
This change creates a BubbleAnimator class that handles animating
both new bubbles in and removed bubbles out.

Demo: http://recall/-/bJtug1HhvXkkeA4MQvIaiP/dMHGANplWjGC5HZT6MXyA4

Flag: com.android.wm.shell.enable_bubble_bar
Fixes: 345687290
Test: atest BubbleAnimatorTest
Test: see demo

Change-Id: Ie060495f4b1421d1c8af48a861cd3e12dd0adbe8
2024-06-20 14:57:03 -04:00
mpodolian ccd4b7efdd Added return before the animation is started.
Added return statement if flag is set to false.

Bug: 335575529
Flag: com.android.wm.shell.animate_bubble_size_change
Test: BubbleBarViewAnimatorTest
Change-Id: I21aaee7b802ace87f68ba6ae84565f925010d673
2024-06-14 19:37:25 +01:00
mpodolian 563c2101cf Animate bubble bar icon sizes and padding
Added animation for the updates of bubble bar icon sizes and padding

Fixes: 335575529
Flag: com.android.wm.shell.enable_bubble_bar DEVELOPMENT
Test: BubbleBarViewAnimatorTest
Change-Id: I07d66b3a9d565f4fa6040c3c4bf4866e4d81a3a6
2024-06-14 01:25:05 +01:00
Mykola Podolian 590e662d70 Merge "Add outline to the bubble bar background view." into main 2024-06-12 16:46:55 +00:00
mpodolian 84f9cfabb9 Add outline to the bubble bar background view.
Added outline to the bubble bar background. Updated pointer
appearing/disappearing animation - now pointer moves into the bubble
bar background.
Demo: http://recall/-/gx8ASgewUeUS3QYohfrd1J/e1wZMrFZTILq73ik8wwrwx

Fixes: 345489039
Flag: ACONFIG com.android.wm.shell.enable_bubble_bar DEVELOPMENT
Test: Manual. Expand and collapse bubble bar with the light and the
dark theme.

Change-Id: I095fdc12337955aa21ee0eb622a924ad424ef186
2024-06-11 19:03:24 +01:00
Liran Binyamin 48811c385c Animate new bubble when the bar is expanded
When a new bubble is added when the bubble bar is expanded,
we now scale in the new bubble.

This change only handles the case where we're not at the limit.

Demo: http://recall/-/bJtug1HhvXkkeA4MQvIaiP/hW4pwqpAttscedRMxnu5BN

Flag: com.android.wm.shell.enable_bubble_bar
Bug: 345795791
Test: manual
      - Expand bubble bar
      - Push a new bubble and verify it scales in
Change-Id: Iafae1d0c8feb8e5a8853d54e7299db261df4ebf4
2024-06-10 16:45:22 -04:00
Treehugger Robot c09cb9e345 Merge "Fix bubble visibility issue when collapsed" into main 2024-06-06 22:42:05 +00:00
Liran Binyamin 87e579ea2d Fix bubble visibility issue when collapsed
When the bubble bar collapses, explicitly set the alpha to 1
for bubbles that should not be hidden.

Flag: com.android.wm.shell.enable_bubble_bar
Fixes: 345283193
Test: manual
       - create 3 bubbles in the bar
       - tap to expand
       - select the last bubble
       - tap it again to collapse
       - observe it is visible
Change-Id: I1aed310b66433b88b08ccaf760fc8e82923b1b64
2024-06-06 16:35:22 -04:00
Ats Jenk cd4c9d153d Add content description to bubble bar and bubbles
Set content description on the bubble bar when it is collapsed. Only
allow focus on the bar itself. In collapsed mode, bubbles in the bar
can't be focused.
Content description for the bar matches what we have in floating mode.
We include the text for the first bubble and then how many bubbles are
there more.

Set content description on bubbles in bubble bar. When bubble bar is
expanded, only the bubbles are focusable.
Bubble content description matches the floating bubbles content
description. Includes the notification title and app name.

Bug: 344670947
Flag: com.android.wm.shell.enable_bubble_bar
Test: enable talkback, focus on bubble bar when it is collapsed, check
  that only bubble bar receives focus
Test: enable talkback and expand bubble bar, check that only the bubbles
  receive focus
Change-Id: Id931f0360b9ebadd01dd16b05b75546fcc4df803
2024-06-05 10:13:22 -07:00
Ats Jenk 38ad424a17 Merge "Only send bubble bar top coordinate to shell" into main 2024-05-20 17:36:23 +00:00