From cf28768606889c8fa6471728e1f1331d68bbb7a0 Mon Sep 17 00:00:00 2001 From: Mady Mellor Date: Tue, 18 Apr 2023 14:10:51 -0700 Subject: [PATCH] Fix the bubbles expansion animation Not quite certain why this regressed in udc since we haven't changed this code. animateExpansion calls updateExpandedView and sets the expanded view container visible right before the animation started, this resulted in a flash of the expanded view before it faded in from alpha 0. This CL fixes the issue by moving the setVisibility call into when the alpha animation starts. Additionally, it modifies one of the calls to set this view 'gone' to 'invisible' which removes some jank in the switching bubbles animation. Test: manual - verify these animations look correct on phone & tablet: - expand a bubble for the first time - expand a bubble for the 2nd time - switch between multiple bubbles - create a bubble via bubble button - open a bubble via the notification Bug: 271319404 Change-Id: Ia316df546b7cf81d6f3d06e7c451c8c603d22c55 --- .../src/com/android/wm/shell/bubbles/BubbleStackView.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java index 1b20f67e42abf..9e0681a3af499 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java @@ -1068,6 +1068,7 @@ public class BubbleStackView extends FrameLayout // We need to be Z ordered on top in order for alpha animations to work. mExpandedBubble.getExpandedView().setSurfaceZOrderedOnTop(true); mExpandedBubble.getExpandedView().setAnimating(true); + mExpandedViewContainer.setVisibility(VISIBLE); } } @@ -3115,7 +3116,7 @@ public class BubbleStackView extends FrameLayout mAnimatingOutBubbleBuffer.getColorSpace()); mAnimatingOutSurfaceView.setAlpha(1f); - mExpandedViewContainer.setVisibility(View.GONE); + mExpandedViewContainer.setVisibility(View.INVISIBLE); mSurfaceSynchronizer.syncSurfaceAndRun(() -> { post(() -> { @@ -3145,9 +3146,6 @@ public class BubbleStackView extends FrameLayout int[] paddings = mPositioner.getExpandedViewContainerPadding( mStackAnimationController.isStackOnLeftSide(), isOverflowExpanded); mExpandedViewContainer.setPadding(paddings[0], paddings[1], paddings[2], paddings[3]); - if (mIsExpansionAnimating) { - mExpandedViewContainer.setVisibility(mIsExpanded ? VISIBLE : GONE); - } if (mExpandedBubble != null && mExpandedBubble.getExpandedView() != null) { PointF p = mPositioner.getExpandedBubbleXY(getBubbleIndex(mExpandedBubble), getState());