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
This commit is contained in:
Ats Jenk
2024-02-27 14:52:55 -08:00
parent cd0f35383f
commit 77b6225d91
3 changed files with 105 additions and 4 deletions

View File

@@ -156,6 +156,7 @@ public class BubbleBarController extends IBubblesListener.Stub {
* {@link BubbleBarBubble}s so that it can be used to update the views.
*/
private static class BubbleBarViewUpdate {
final boolean initialState;
boolean expandedChanged;
boolean expanded;
boolean shouldShowEducation;
@@ -172,6 +173,7 @@ public class BubbleBarController extends IBubblesListener.Stub {
List<BubbleBarBubble> currentBubbles;
BubbleBarViewUpdate(BubbleBarUpdate update) {
initialState = update.initialState;
expandedChanged = update.expandedChanged;
expanded = update.expanded;
shouldShowEducation = update.shouldShowEducation;
@@ -405,7 +407,9 @@ public class BubbleBarController extends IBubblesListener.Stub {
}
if (update.bubbleBarLocation != null) {
if (update.bubbleBarLocation != mBubbleBarViewController.getBubbleBarLocation()) {
mBubbleBarViewController.setBubbleBarLocation(update.bubbleBarLocation);
// Animate when receiving updates. Skip it if we received the initial state.
boolean animate = !update.initialState;
mBubbleBarViewController.setBubbleBarLocation(update.bubbleBarLocation, animate);
mBubbleStashController.setBubbleBarLocation(update.bubbleBarLocation);
}
}