Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java +6 −8 Original line number Diff line number Diff line Loading @@ -1592,7 +1592,11 @@ public class BubbleController implements ConfigurationChangeListener, mBubbleData.setSelectedBubbleAndExpandStack(b, updateLocation); } else { b.enable(Notification.BubbleMetadata.FLAG_AUTO_EXPAND_BUBBLE); inflateAndAdd(b, /* suppressFlyout= */ true, /* showInShade= */ false, updateLocation); ensureBubbleViewsAndWindowCreated(); mBubbleTransitions.startLaunchIntoOrConvertToBubble(b, mExpandedViewManager, mBubbleTaskViewFactory, mBubblePositioner, mStackView, mLayerView, mBubbleIconFactory, mInflateSynchronously); } } Loading Loading @@ -3363,13 +3367,7 @@ public class BubbleController implements ConfigurationChangeListener, if (tinfo == null) { return; } Bubble bub = null; for (Bubble b : mBubbleData.getBubbles()) { if (b.getTaskId() == tinfo.taskId) { bub = b; break; } } Bubble bub = mBubbleData.getBubbleInStackWithTaskId(tinfo.taskId); if (bub == null) { return; } Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleTransitions.java +457 −44 File changed.Preview size limit exceeded, changes collapsed. Show changes libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarAnimationHelper.java +17 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import static android.view.View.Y; import static com.android.wm.shell.bubbles.bar.BubbleBarExpandedView.CORNER_RADIUS; import static com.android.wm.shell.bubbles.bar.BubbleBarExpandedView.TASK_VIEW_ALPHA; import static com.android.wm.shell.protolog.ShellProtoLogGroup.WM_SHELL_BUBBLES_NOISY; import static com.android.wm.shell.shared.animation.Interpolators.EMPHASIZED; import static com.android.wm.shell.shared.animation.Interpolators.EMPHASIZED_DECELERATE; Loading @@ -48,6 +49,7 @@ import android.widget.FrameLayout; import androidx.annotation.Nullable; import com.android.app.animation.Interpolators; import com.android.internal.protolog.ProtoLog; import com.android.wm.shell.R; import com.android.wm.shell.animation.SizeChangeAnimation; import com.android.wm.shell.bubbles.Bubble; Loading Loading @@ -124,6 +126,7 @@ public class BubbleBarAnimationHelper { */ public void animateExpansion(BubbleViewProvider expandedBubble, @Nullable Runnable afterAnimation) { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "BBAnimationHelper.animateExpansion()"); mExpandedBubble = expandedBubble; final BubbleBarExpandedView bbev = getExpandedView(); if (bbev == null) { Loading @@ -141,6 +144,8 @@ public class BubbleBarAnimationHelper { bbev.setAnimationMatrix(mExpandedViewContainerMatrix); bbev.animateExpansionWhenTaskViewVisible(() -> { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "BBAnimationHelper.animateExpansion(): " + "task view visible"); bbev.getHandleView().setAlpha(1); ObjectAnimator alphaAnim = createAlphaAnimator(bbev, /* visible= */ true); alphaAnim.setDuration(EXPANDED_VIEW_EXPAND_ALPHA_DURATION); Loading Loading @@ -176,6 +181,7 @@ public class BubbleBarAnimationHelper { } private void prepareForAnimateIn(BubbleBarExpandedView bbev) { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "BBAnimationHelper.prepareForAnimateIn()"); bbev.setAnimating(true); updateExpandedView(bbev); // We need to be Z ordered on top in order for taskView alpha to work. Loading @@ -193,6 +199,7 @@ public class BubbleBarAnimationHelper { * @param endRunnable a runnable to run at the end of the animation. */ public void animateCollapse(Runnable endRunnable) { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "BBAnimationHelper.animateCollapse()"); final BubbleBarExpandedView bbev = getExpandedView(); if (bbev == null) { Log.w(TAG, "Trying to animate collapse without a bubble"); Loading Loading @@ -256,6 +263,7 @@ public class BubbleBarAnimationHelper { */ public void animateSwitch(BubbleViewProvider fromBubble, BubbleViewProvider toBubble, @Nullable Runnable afterAnimation) { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "BBAnimationHelper.animateSwitch()"); /* * Switch animation * Loading Loading @@ -307,6 +315,7 @@ public class BubbleBarAnimationHelper { } private Animator switchOutAnimator(BubbleBarExpandedView bbev) { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "BBAnimationHelper.switchOutAnimator()"); setPivotToCenter(bbev); AnimatorSet scaleAnim = new AnimatorSet(); scaleAnim.playTogether( Loading Loading @@ -336,6 +345,7 @@ public class BubbleBarAnimationHelper { } private Animator switchInAnimator(BubbleBarExpandedView bbev, float restingTx) { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "BBAnimationHelper.switchInAnimator(): alpha=1f"); ObjectAnimator positionAnim = ObjectAnimator.ofFloat(bbev, TRANSLATION_X, restingTx); positionAnim.setInterpolator(Interpolators.EMPHASIZED_DECELERATE); positionAnim.setStartDelay(SWITCH_IN_ANIM_DELAY); Loading Loading @@ -387,6 +397,7 @@ public class BubbleBarAnimationHelper { * Animate the expanded bubble when it is being dragged */ public void animateStartDrag() { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "BBAnimationHelper.animateStartDrag()"); final BubbleBarExpandedView bbev = getExpandedView(); if (bbev == null) { Log.w(TAG, "Trying to animate start drag without a bubble"); Loading Loading @@ -420,6 +431,7 @@ public class BubbleBarAnimationHelper { * @param endRunnable a runnable to run at the end of the animation */ public void animateDismiss(Runnable endRunnable) { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "BBAnimationHelper.animateDismiss()"); final BubbleBarExpandedView bbev = getExpandedView(); if (bbev == null) { Log.w(TAG, "Trying to animate dismiss without a bubble"); Loading @@ -442,6 +454,7 @@ public class BubbleBarAnimationHelper { * Animate current expanded bubble back to its rest position */ public void animateToRestPosition() { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "BBAnimationHelper.animateToRestPosition()"); BubbleBarExpandedView bbev = getExpandedView(); if (bbev == null) { Log.w(TAG, "Trying to animate expanded view to rest position without a bubble"); Loading Loading @@ -483,6 +496,7 @@ public class BubbleBarAnimationHelper { * @param endRunnable a runnable to run at the end of the animation */ public void animateIntoTarget(MagneticTarget target, @Nullable Runnable endRunnable) { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "BBAnimationHelper.animateIntoTarget()"); BubbleBarExpandedView bbev = getExpandedView(); if (bbev == null) { Log.w(TAG, "Trying to snap the expanded view to target without a bubble"); Loading Loading @@ -554,6 +568,7 @@ public class BubbleBarAnimationHelper { * Animate currently expanded view when it is released from dismiss view */ public void animateUnstuckFromDismissView(MagneticTarget target) { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "BBAnimationHelper.animateUnstuckFromDismissView()"); BubbleBarExpandedView bbev = getExpandedView(); if (bbev == null) { Log.w(TAG, "Trying to unsnap the expanded view from dismiss without a bubble"); Loading Loading @@ -586,6 +601,7 @@ public class BubbleBarAnimationHelper { @NonNull SurfaceControl snapshot, @NonNull SurfaceControl taskLeash, @Nullable Runnable afterAnimation) { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "BBAnimationHelper.animateConvert()"); mExpandedBubble = expandedBubble; final BubbleBarExpandedView bbev = getExpandedView(); if (bbev == null) { Loading Loading @@ -625,6 +641,7 @@ public class BubbleBarAnimationHelper { * Cancel current animations */ public void cancelAnimations() { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "BBAnimationHelper.cancelAnimations()"); PhysicsAnimator.getInstance(mExpandedViewContainerMatrix).cancel(); BubbleBarExpandedView bbev = getExpandedView(); if (bbev != null) { Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarExpandedView.java +4 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,8 @@ package com.android.wm.shell.bubbles.bar; import static android.view.ViewGroup.LayoutParams.MATCH_PARENT; import static com.android.wm.shell.protolog.ShellProtoLogGroup.WM_SHELL_BUBBLES_NOISY; import android.annotation.Nullable; import android.content.Context; import android.graphics.Insets; Loading @@ -36,6 +38,7 @@ import android.widget.FrameLayout; import androidx.annotation.NonNull; import androidx.annotation.VisibleForTesting; import com.android.internal.protolog.ProtoLog; import com.android.wm.shell.R; import com.android.wm.shell.bubbles.Bubble; import com.android.wm.shell.bubbles.BubbleExpandedViewManager; Loading Loading @@ -441,6 +444,7 @@ public class BubbleBarExpandedView extends FrameLayout implements BubbleTaskView } private void onTaskViewVisible() { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "BBEV.onTaskViewVisible()"); // if we're waiting to be visible, start the expansion animation if it's pending. if (mVisibilityState == TaskViewVisibilityState.PENDING_VISIBLE) { mVisibilityState = TaskViewVisibilityState.VISIBLE; Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarLayerView.java +16 −0 Original line number Diff line number Diff line Loading @@ -397,6 +397,18 @@ public class BubbleBarLayerView extends FrameLayout * bubble is expanded. */ public void animateExpand(BubbleViewProvider previousBubble) { animateExpand(previousBubble, null /* finishCallback */); } /** * Performs an animation to open a bubble with content that is not already visible. * * @param previousBubble If non-null, this is a bubble that is already showing before the new * bubble is expanded. * @param animFinish If non-null, the callback triggered after the expand animation completes */ public void animateExpand(BubbleViewProvider previousBubble, @Nullable Runnable animFinish) { if (!mIsExpanded || mExpandedBubble == null) { throw new IllegalStateException("Can't animateExpand without expnaded state"); } Loading @@ -410,6 +422,10 @@ public class BubbleBarLayerView extends FrameLayout mHandleTouchDelegate = new TouchDelegate(mHandleTouchBounds, mExpandedView.getHandleView()); setTouchDelegate(mHandleTouchDelegate); if (animFinish != null) { animFinish.run(); } }; if (previousBubble != null) { Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java +6 −8 Original line number Diff line number Diff line Loading @@ -1592,7 +1592,11 @@ public class BubbleController implements ConfigurationChangeListener, mBubbleData.setSelectedBubbleAndExpandStack(b, updateLocation); } else { b.enable(Notification.BubbleMetadata.FLAG_AUTO_EXPAND_BUBBLE); inflateAndAdd(b, /* suppressFlyout= */ true, /* showInShade= */ false, updateLocation); ensureBubbleViewsAndWindowCreated(); mBubbleTransitions.startLaunchIntoOrConvertToBubble(b, mExpandedViewManager, mBubbleTaskViewFactory, mBubblePositioner, mStackView, mLayerView, mBubbleIconFactory, mInflateSynchronously); } } Loading Loading @@ -3363,13 +3367,7 @@ public class BubbleController implements ConfigurationChangeListener, if (tinfo == null) { return; } Bubble bub = null; for (Bubble b : mBubbleData.getBubbles()) { if (b.getTaskId() == tinfo.taskId) { bub = b; break; } } Bubble bub = mBubbleData.getBubbleInStackWithTaskId(tinfo.taskId); if (bub == null) { return; } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleTransitions.java +457 −44 File changed.Preview size limit exceeded, changes collapsed. Show changes
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarAnimationHelper.java +17 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import static android.view.View.Y; import static com.android.wm.shell.bubbles.bar.BubbleBarExpandedView.CORNER_RADIUS; import static com.android.wm.shell.bubbles.bar.BubbleBarExpandedView.TASK_VIEW_ALPHA; import static com.android.wm.shell.protolog.ShellProtoLogGroup.WM_SHELL_BUBBLES_NOISY; import static com.android.wm.shell.shared.animation.Interpolators.EMPHASIZED; import static com.android.wm.shell.shared.animation.Interpolators.EMPHASIZED_DECELERATE; Loading @@ -48,6 +49,7 @@ import android.widget.FrameLayout; import androidx.annotation.Nullable; import com.android.app.animation.Interpolators; import com.android.internal.protolog.ProtoLog; import com.android.wm.shell.R; import com.android.wm.shell.animation.SizeChangeAnimation; import com.android.wm.shell.bubbles.Bubble; Loading Loading @@ -124,6 +126,7 @@ public class BubbleBarAnimationHelper { */ public void animateExpansion(BubbleViewProvider expandedBubble, @Nullable Runnable afterAnimation) { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "BBAnimationHelper.animateExpansion()"); mExpandedBubble = expandedBubble; final BubbleBarExpandedView bbev = getExpandedView(); if (bbev == null) { Loading @@ -141,6 +144,8 @@ public class BubbleBarAnimationHelper { bbev.setAnimationMatrix(mExpandedViewContainerMatrix); bbev.animateExpansionWhenTaskViewVisible(() -> { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "BBAnimationHelper.animateExpansion(): " + "task view visible"); bbev.getHandleView().setAlpha(1); ObjectAnimator alphaAnim = createAlphaAnimator(bbev, /* visible= */ true); alphaAnim.setDuration(EXPANDED_VIEW_EXPAND_ALPHA_DURATION); Loading Loading @@ -176,6 +181,7 @@ public class BubbleBarAnimationHelper { } private void prepareForAnimateIn(BubbleBarExpandedView bbev) { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "BBAnimationHelper.prepareForAnimateIn()"); bbev.setAnimating(true); updateExpandedView(bbev); // We need to be Z ordered on top in order for taskView alpha to work. Loading @@ -193,6 +199,7 @@ public class BubbleBarAnimationHelper { * @param endRunnable a runnable to run at the end of the animation. */ public void animateCollapse(Runnable endRunnable) { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "BBAnimationHelper.animateCollapse()"); final BubbleBarExpandedView bbev = getExpandedView(); if (bbev == null) { Log.w(TAG, "Trying to animate collapse without a bubble"); Loading Loading @@ -256,6 +263,7 @@ public class BubbleBarAnimationHelper { */ public void animateSwitch(BubbleViewProvider fromBubble, BubbleViewProvider toBubble, @Nullable Runnable afterAnimation) { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "BBAnimationHelper.animateSwitch()"); /* * Switch animation * Loading Loading @@ -307,6 +315,7 @@ public class BubbleBarAnimationHelper { } private Animator switchOutAnimator(BubbleBarExpandedView bbev) { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "BBAnimationHelper.switchOutAnimator()"); setPivotToCenter(bbev); AnimatorSet scaleAnim = new AnimatorSet(); scaleAnim.playTogether( Loading Loading @@ -336,6 +345,7 @@ public class BubbleBarAnimationHelper { } private Animator switchInAnimator(BubbleBarExpandedView bbev, float restingTx) { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "BBAnimationHelper.switchInAnimator(): alpha=1f"); ObjectAnimator positionAnim = ObjectAnimator.ofFloat(bbev, TRANSLATION_X, restingTx); positionAnim.setInterpolator(Interpolators.EMPHASIZED_DECELERATE); positionAnim.setStartDelay(SWITCH_IN_ANIM_DELAY); Loading Loading @@ -387,6 +397,7 @@ public class BubbleBarAnimationHelper { * Animate the expanded bubble when it is being dragged */ public void animateStartDrag() { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "BBAnimationHelper.animateStartDrag()"); final BubbleBarExpandedView bbev = getExpandedView(); if (bbev == null) { Log.w(TAG, "Trying to animate start drag without a bubble"); Loading Loading @@ -420,6 +431,7 @@ public class BubbleBarAnimationHelper { * @param endRunnable a runnable to run at the end of the animation */ public void animateDismiss(Runnable endRunnable) { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "BBAnimationHelper.animateDismiss()"); final BubbleBarExpandedView bbev = getExpandedView(); if (bbev == null) { Log.w(TAG, "Trying to animate dismiss without a bubble"); Loading @@ -442,6 +454,7 @@ public class BubbleBarAnimationHelper { * Animate current expanded bubble back to its rest position */ public void animateToRestPosition() { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "BBAnimationHelper.animateToRestPosition()"); BubbleBarExpandedView bbev = getExpandedView(); if (bbev == null) { Log.w(TAG, "Trying to animate expanded view to rest position without a bubble"); Loading Loading @@ -483,6 +496,7 @@ public class BubbleBarAnimationHelper { * @param endRunnable a runnable to run at the end of the animation */ public void animateIntoTarget(MagneticTarget target, @Nullable Runnable endRunnable) { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "BBAnimationHelper.animateIntoTarget()"); BubbleBarExpandedView bbev = getExpandedView(); if (bbev == null) { Log.w(TAG, "Trying to snap the expanded view to target without a bubble"); Loading Loading @@ -554,6 +568,7 @@ public class BubbleBarAnimationHelper { * Animate currently expanded view when it is released from dismiss view */ public void animateUnstuckFromDismissView(MagneticTarget target) { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "BBAnimationHelper.animateUnstuckFromDismissView()"); BubbleBarExpandedView bbev = getExpandedView(); if (bbev == null) { Log.w(TAG, "Trying to unsnap the expanded view from dismiss without a bubble"); Loading Loading @@ -586,6 +601,7 @@ public class BubbleBarAnimationHelper { @NonNull SurfaceControl snapshot, @NonNull SurfaceControl taskLeash, @Nullable Runnable afterAnimation) { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "BBAnimationHelper.animateConvert()"); mExpandedBubble = expandedBubble; final BubbleBarExpandedView bbev = getExpandedView(); if (bbev == null) { Loading Loading @@ -625,6 +641,7 @@ public class BubbleBarAnimationHelper { * Cancel current animations */ public void cancelAnimations() { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "BBAnimationHelper.cancelAnimations()"); PhysicsAnimator.getInstance(mExpandedViewContainerMatrix).cancel(); BubbleBarExpandedView bbev = getExpandedView(); if (bbev != null) { Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarExpandedView.java +4 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,8 @@ package com.android.wm.shell.bubbles.bar; import static android.view.ViewGroup.LayoutParams.MATCH_PARENT; import static com.android.wm.shell.protolog.ShellProtoLogGroup.WM_SHELL_BUBBLES_NOISY; import android.annotation.Nullable; import android.content.Context; import android.graphics.Insets; Loading @@ -36,6 +38,7 @@ import android.widget.FrameLayout; import androidx.annotation.NonNull; import androidx.annotation.VisibleForTesting; import com.android.internal.protolog.ProtoLog; import com.android.wm.shell.R; import com.android.wm.shell.bubbles.Bubble; import com.android.wm.shell.bubbles.BubbleExpandedViewManager; Loading Loading @@ -441,6 +444,7 @@ public class BubbleBarExpandedView extends FrameLayout implements BubbleTaskView } private void onTaskViewVisible() { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "BBEV.onTaskViewVisible()"); // if we're waiting to be visible, start the expansion animation if it's pending. if (mVisibilityState == TaskViewVisibilityState.PENDING_VISIBLE) { mVisibilityState = TaskViewVisibilityState.VISIBLE; Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarLayerView.java +16 −0 Original line number Diff line number Diff line Loading @@ -397,6 +397,18 @@ public class BubbleBarLayerView extends FrameLayout * bubble is expanded. */ public void animateExpand(BubbleViewProvider previousBubble) { animateExpand(previousBubble, null /* finishCallback */); } /** * Performs an animation to open a bubble with content that is not already visible. * * @param previousBubble If non-null, this is a bubble that is already showing before the new * bubble is expanded. * @param animFinish If non-null, the callback triggered after the expand animation completes */ public void animateExpand(BubbleViewProvider previousBubble, @Nullable Runnable animFinish) { if (!mIsExpanded || mExpandedBubble == null) { throw new IllegalStateException("Can't animateExpand without expnaded state"); } Loading @@ -410,6 +422,10 @@ public class BubbleBarLayerView extends FrameLayout mHandleTouchDelegate = new TouchDelegate(mHandleTouchBounds, mExpandedView.getHandleView()); setTouchDelegate(mHandleTouchDelegate); if (animFinish != null) { animFinish.run(); } }; if (previousBubble != null) { Loading