Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java +22 −3 Original line number Original line Diff line number Diff line Loading @@ -300,6 +300,9 @@ public class BubbleStackView extends FrameLayout */ */ private int mPointerIndexDown = -1; private int mPointerIndexDown = -1; /** Indicates whether bubbles should be reordered at the end of a gesture. */ private boolean mShouldReorderBubblesAfterGestureCompletes = false; @Nullable @Nullable private BubblesNavBarGestureTracker mBubblesNavBarGestureTracker; private BubblesNavBarGestureTracker mBubblesNavBarGestureTracker; Loading Loading @@ -708,6 +711,11 @@ public class BubbleStackView extends FrameLayout // Hide the stack after a delay, if needed. // Hide the stack after a delay, if needed. updateTemporarilyInvisibleAnimation(false /* hideImmediately */); updateTemporarilyInvisibleAnimation(false /* hideImmediately */); if (mShouldReorderBubblesAfterGestureCompletes) { mShouldReorderBubblesAfterGestureCompletes = false; updateBubbleOrderInternal(mBubbleData.getBubbles(), true); } } } }; }; Loading Loading @@ -1928,7 +1936,18 @@ public class BubbleStackView extends FrameLayout /** /** * Update bubble order and pointer position. * Update bubble order and pointer position. */ */ public void updateBubbleOrder(List<Bubble> bubbles, boolean updatePointerPositoion) { public void updateBubbleOrder(List<Bubble> bubbles, boolean updatePointerPosition) { // Don't reorder bubbles in the middle of a gesture because that would remove bubbles from // view hierarchy and will cancel all touch events. Instead wait until the gesture is // finished and then reorder. if (mIsGestureInProgress) { mShouldReorderBubblesAfterGestureCompletes = true; return; } updateBubbleOrderInternal(bubbles, updatePointerPosition); } private void updateBubbleOrderInternal(List<Bubble> bubbles, boolean updatePointerPosition) { final Runnable reorder = () -> { final Runnable reorder = () -> { for (int i = 0; i < bubbles.size(); i++) { for (int i = 0; i < bubbles.size(); i++) { Bubble bubble = bubbles.get(i); Bubble bubble = bubbles.get(i); Loading @@ -1939,13 +1958,13 @@ public class BubbleStackView extends FrameLayout reorder.run(); reorder.run(); updateBadges(false /* setBadgeForCollapsedStack */); updateBadges(false /* setBadgeForCollapsedStack */); updateZOrder(); updateZOrder(); } else if (!isExpansionAnimating()) { } else { List<View> bubbleViews = bubbles.stream() List<View> bubbleViews = bubbles.stream() .map(b -> b.getIconView()).collect(Collectors.toList()); .map(b -> b.getIconView()).collect(Collectors.toList()); mStackAnimationController.animateReorder(bubbleViews, reorder); mStackAnimationController.animateReorder(bubbleViews, reorder); } } if (updatePointerPositoion) { if (updatePointerPosition) { updatePointerPosition(false /* forIme */); updatePointerPosition(false /* forIme */); } } } } Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java +22 −3 Original line number Original line Diff line number Diff line Loading @@ -300,6 +300,9 @@ public class BubbleStackView extends FrameLayout */ */ private int mPointerIndexDown = -1; private int mPointerIndexDown = -1; /** Indicates whether bubbles should be reordered at the end of a gesture. */ private boolean mShouldReorderBubblesAfterGestureCompletes = false; @Nullable @Nullable private BubblesNavBarGestureTracker mBubblesNavBarGestureTracker; private BubblesNavBarGestureTracker mBubblesNavBarGestureTracker; Loading Loading @@ -708,6 +711,11 @@ public class BubbleStackView extends FrameLayout // Hide the stack after a delay, if needed. // Hide the stack after a delay, if needed. updateTemporarilyInvisibleAnimation(false /* hideImmediately */); updateTemporarilyInvisibleAnimation(false /* hideImmediately */); if (mShouldReorderBubblesAfterGestureCompletes) { mShouldReorderBubblesAfterGestureCompletes = false; updateBubbleOrderInternal(mBubbleData.getBubbles(), true); } } } }; }; Loading Loading @@ -1928,7 +1936,18 @@ public class BubbleStackView extends FrameLayout /** /** * Update bubble order and pointer position. * Update bubble order and pointer position. */ */ public void updateBubbleOrder(List<Bubble> bubbles, boolean updatePointerPositoion) { public void updateBubbleOrder(List<Bubble> bubbles, boolean updatePointerPosition) { // Don't reorder bubbles in the middle of a gesture because that would remove bubbles from // view hierarchy and will cancel all touch events. Instead wait until the gesture is // finished and then reorder. if (mIsGestureInProgress) { mShouldReorderBubblesAfterGestureCompletes = true; return; } updateBubbleOrderInternal(bubbles, updatePointerPosition); } private void updateBubbleOrderInternal(List<Bubble> bubbles, boolean updatePointerPosition) { final Runnable reorder = () -> { final Runnable reorder = () -> { for (int i = 0; i < bubbles.size(); i++) { for (int i = 0; i < bubbles.size(); i++) { Bubble bubble = bubbles.get(i); Bubble bubble = bubbles.get(i); Loading @@ -1939,13 +1958,13 @@ public class BubbleStackView extends FrameLayout reorder.run(); reorder.run(); updateBadges(false /* setBadgeForCollapsedStack */); updateBadges(false /* setBadgeForCollapsedStack */); updateZOrder(); updateZOrder(); } else if (!isExpansionAnimating()) { } else { List<View> bubbleViews = bubbles.stream() List<View> bubbleViews = bubbles.stream() .map(b -> b.getIconView()).collect(Collectors.toList()); .map(b -> b.getIconView()).collect(Collectors.toList()); mStackAnimationController.animateReorder(bubbleViews, reorder); mStackAnimationController.animateReorder(bubbleViews, reorder); } } if (updatePointerPositoion) { if (updatePointerPosition) { updatePointerPosition(false /* forIme */); updatePointerPosition(false /* forIme */); } } } } Loading