From a74ed727dfafd7e44447acac094bb40e7df13b3b Mon Sep 17 00:00:00 2001 From: Mady Mellor Date: Wed, 13 Apr 2022 18:29:36 +0000 Subject: [PATCH] Fix bubble overflow position after rotating on larger screen The code was passing the index of the bubble rather than the actual position onscreen so the resulting translation was incorrect. Test: manual - be on a large screen / tablet - expand bubbles, select the overflow - rotate the device => observe that the overflow container remains with the rest of the bubbles and doesn't jump around Bug: 223911182 Change-Id: I95403f57e40e8c428ea9694e6fb93b0b0478c530 --- .../src/com/android/wm/shell/bubbles/BubbleStackView.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 f60b6599e3505..322c0bf808162 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 @@ -913,8 +913,10 @@ public class BubbleStackView extends FrameLayout afterExpandedViewAnimation(); showManageMenu(mShowingManage); } /* after */); + PointF p = mPositioner.getExpandedBubbleXY(getBubbleIndex(mExpandedBubble), + getState()); final float translationY = mPositioner.getExpandedViewY(mExpandedBubble, - getBubbleIndex(mExpandedBubble)); + mPositioner.showBubblesVertically() ? p.y : p.x); mExpandedViewContainer.setTranslationX(0f); mExpandedViewContainer.setTranslationY(translationY); mExpandedViewContainer.setAlpha(1f);