Loading quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarController.java +7 −0 Original line number Diff line number Diff line Loading @@ -445,6 +445,13 @@ public class BubbleBarController extends IBubblesListener.Stub { } } /** * Removes the given bubble from the backing list of bubbles after it was dismissed by the user. */ public void onBubbleDismissed(BubbleView bubble) { mBubbles.remove(bubble.getBubble().getKey()); } /** Tells WMShell to show the currently selected bubble. */ public void showSelectedBubble() { if (getSelectedBubbleKey() != null) { Loading quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarView.java +15 −3 Original line number Diff line number Diff line Loading @@ -182,6 +182,8 @@ public class BubbleBarView extends FrameLayout { @Nullable private BubbleView mDraggedBubbleView; @Nullable private BubbleView mDismissedByDragBubbleView; private float mAlphaDuringDrag = 1f; private Controller mController; Loading Loading @@ -767,6 +769,10 @@ public class BubbleBarView extends FrameLayout { public void removeBubble(View bubble) { if (isExpanded()) { // TODO b/347062801 - animate the bubble bar if the last bubble is removed final boolean dismissedByDrag = mDraggedBubbleView == bubble; if (dismissedByDrag) { mDismissedByDragBubbleView = mDraggedBubbleView; } int bubbleCount = getChildCount(); mBubbleAnimator = new BubbleAnimator(mIconSize, mExpandedBarIconsSpacing, bubbleCount, mBubbleBarLocation.isOnLeft(isLayoutRtl())); Loading @@ -786,8 +792,11 @@ public class BubbleBarView extends FrameLayout { @Override public void onAnimationUpdate(float animatedFraction) { // don't update the scale if this bubble was dismissed by drag if (!dismissedByDrag) { bubble.setScaleX(1 - animatedFraction); bubble.setScaleY(1 - animatedFraction); } updateBubblesLayoutProperties(mBubbleBarLocation); invalidate(); } Loading Loading @@ -818,6 +827,7 @@ public class BubbleBarView extends FrameLayout { updateWidth(); updateBubbleAccessibilityStates(); updateContentDescription(); mDismissedByDragBubbleView = null; } private void updateWidth() { Loading Loading @@ -864,7 +874,7 @@ public class BubbleBarView extends FrameLayout { float elevationState = (1 - widthState); for (int i = 0; i < bubbleCount; i++) { BubbleView bv = (BubbleView) getChildAt(i); if (bv == mDraggedBubbleView) { if (bv == mDraggedBubbleView || bv == mDismissedByDragBubbleView) { // Skip the dragged bubble. Its translation is managed by the drag controller. continue; } Loading Loading @@ -1048,6 +1058,8 @@ public class BubbleBarView extends FrameLayout { mDraggedBubbleView = view; if (view != null) { view.setZ(mDragElevation); // we started dragging a bubble. reset the bubble that was previously dismissed by drag mDismissedByDragBubbleView = null; } setIsDragging(view != null); } Loading quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java +6 −0 Original line number Diff line number Diff line Loading @@ -526,6 +526,12 @@ public class BubbleBarViewController { mSystemUiProxy.stopBubbleDrag(location, mBarView.getRestingTopPositionOnScreen()); } /** Notifies {@link BubbleBarView} that the dragged bubble was dismissed. */ public void onBubbleDragDismissed(BubbleView bubble) { mBubbleBarController.onBubbleDismissed(bubble); mBarView.removeBubble(bubble); } /** * Notifies {@link BubbleBarView} that drag and all animations are finished. */ Loading quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleDragController.java +1 −0 Original line number Diff line number Diff line Loading @@ -153,6 +153,7 @@ public class BubbleDragController { @Override protected void onDragDismiss() { mBubblePinController.onDragEnd(); mBubbleBarViewController.onBubbleDragDismissed(bubbleView); mBubbleBarViewController.onBubbleDragEnd(); } Loading Loading
quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarController.java +7 −0 Original line number Diff line number Diff line Loading @@ -445,6 +445,13 @@ public class BubbleBarController extends IBubblesListener.Stub { } } /** * Removes the given bubble from the backing list of bubbles after it was dismissed by the user. */ public void onBubbleDismissed(BubbleView bubble) { mBubbles.remove(bubble.getBubble().getKey()); } /** Tells WMShell to show the currently selected bubble. */ public void showSelectedBubble() { if (getSelectedBubbleKey() != null) { Loading
quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarView.java +15 −3 Original line number Diff line number Diff line Loading @@ -182,6 +182,8 @@ public class BubbleBarView extends FrameLayout { @Nullable private BubbleView mDraggedBubbleView; @Nullable private BubbleView mDismissedByDragBubbleView; private float mAlphaDuringDrag = 1f; private Controller mController; Loading Loading @@ -767,6 +769,10 @@ public class BubbleBarView extends FrameLayout { public void removeBubble(View bubble) { if (isExpanded()) { // TODO b/347062801 - animate the bubble bar if the last bubble is removed final boolean dismissedByDrag = mDraggedBubbleView == bubble; if (dismissedByDrag) { mDismissedByDragBubbleView = mDraggedBubbleView; } int bubbleCount = getChildCount(); mBubbleAnimator = new BubbleAnimator(mIconSize, mExpandedBarIconsSpacing, bubbleCount, mBubbleBarLocation.isOnLeft(isLayoutRtl())); Loading @@ -786,8 +792,11 @@ public class BubbleBarView extends FrameLayout { @Override public void onAnimationUpdate(float animatedFraction) { // don't update the scale if this bubble was dismissed by drag if (!dismissedByDrag) { bubble.setScaleX(1 - animatedFraction); bubble.setScaleY(1 - animatedFraction); } updateBubblesLayoutProperties(mBubbleBarLocation); invalidate(); } Loading Loading @@ -818,6 +827,7 @@ public class BubbleBarView extends FrameLayout { updateWidth(); updateBubbleAccessibilityStates(); updateContentDescription(); mDismissedByDragBubbleView = null; } private void updateWidth() { Loading Loading @@ -864,7 +874,7 @@ public class BubbleBarView extends FrameLayout { float elevationState = (1 - widthState); for (int i = 0; i < bubbleCount; i++) { BubbleView bv = (BubbleView) getChildAt(i); if (bv == mDraggedBubbleView) { if (bv == mDraggedBubbleView || bv == mDismissedByDragBubbleView) { // Skip the dragged bubble. Its translation is managed by the drag controller. continue; } Loading Loading @@ -1048,6 +1058,8 @@ public class BubbleBarView extends FrameLayout { mDraggedBubbleView = view; if (view != null) { view.setZ(mDragElevation); // we started dragging a bubble. reset the bubble that was previously dismissed by drag mDismissedByDragBubbleView = null; } setIsDragging(view != null); } Loading
quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java +6 −0 Original line number Diff line number Diff line Loading @@ -526,6 +526,12 @@ public class BubbleBarViewController { mSystemUiProxy.stopBubbleDrag(location, mBarView.getRestingTopPositionOnScreen()); } /** Notifies {@link BubbleBarView} that the dragged bubble was dismissed. */ public void onBubbleDragDismissed(BubbleView bubble) { mBubbleBarController.onBubbleDismissed(bubble); mBarView.removeBubble(bubble); } /** * Notifies {@link BubbleBarView} that drag and all animations are finished. */ Loading
quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleDragController.java +1 −0 Original line number Diff line number Diff line Loading @@ -153,6 +153,7 @@ public class BubbleDragController { @Override protected void onDragDismiss() { mBubblePinController.onDragEnd(); mBubbleBarViewController.onBubbleDragDismissed(bubbleView); mBubbleBarViewController.onBubbleDragEnd(); } Loading