Implement API to animate bubble bar position

Create a new API to animate bubble bar position.
Animating it will not update its laid out location.
To update bubble bar laid out location, BubbleBarUpdate can be used.
Applying a location change from BubbleBarUpdate no longer animates the
change.

Bug: 330585402
Flag: ACONFIG com.android.wm.shell.enable_bubble_bar DEVELOPMENT
Test: long press bubble bar and drag it to left and right
Change-Id: I2572da4c063fc8e07cf07c4303778d343baa4ec4
This commit is contained in:
Ats Jenk
2024-04-09 16:24:41 -07:00
parent 5a8e719b4c
commit d7fe32ab8e
5 changed files with 135 additions and 98 deletions

View File

@@ -419,9 +419,7 @@ public class BubbleBarController extends IBubblesListener.Stub {
}
if (update.bubbleBarLocation != null) {
if (update.bubbleBarLocation != mBubbleBarViewController.getBubbleBarLocation()) {
// Animate when receiving updates. Skip it if we received the initial state.
boolean animate = !update.initialState;
updateBubbleBarLocationInternal(update.bubbleBarLocation, animate);
updateBubbleBarLocationInternal(update.bubbleBarLocation);
}
}
}
@@ -483,15 +481,21 @@ public class BubbleBarController extends IBubblesListener.Stub {
* Updates the value locally in Launcher and in WMShell.
*/
public void updateBubbleBarLocation(BubbleBarLocation location) {
updateBubbleBarLocationInternal(location, false /* animate */);
updateBubbleBarLocationInternal(location);
mSystemUiProxy.setBubbleBarLocation(location);
}
private void updateBubbleBarLocationInternal(BubbleBarLocation location, boolean animate) {
mBubbleBarViewController.setBubbleBarLocation(location, animate);
private void updateBubbleBarLocationInternal(BubbleBarLocation location) {
mBubbleBarViewController.setBubbleBarLocation(location);
mBubbleStashController.setBubbleBarLocation(location);
}
@Override
public void animateBubbleBarLocation(BubbleBarLocation bubbleBarLocation) {
mMainExecutor.execute(
() -> mBubbleBarViewController.animateBubbleBarLocation(bubbleBarLocation));
}
//
// Loading data for the bubbles
//