diff --git a/libs/WindowManager/Shell/res/drawable/bubble_manage_btn_bg.xml b/libs/WindowManager/Shell/res/drawable/bubble_manage_btn_bg.xml index 8710fb8ac69b2..96d2d7c954d83 100644 --- a/libs/WindowManager/Shell/res/drawable/bubble_manage_btn_bg.xml +++ b/libs/WindowManager/Shell/res/drawable/bubble_manage_btn_bg.xml @@ -18,7 +18,7 @@ diff --git a/libs/WindowManager/Shell/res/layout/bubble_manage_button.xml b/libs/WindowManager/Shell/res/layout/bubble_manage_button.xml index b333e33a7a5f2..7658fca588221 100644 --- a/libs/WindowManager/Shell/res/layout/bubble_manage_button.xml +++ b/libs/WindowManager/Shell/res/layout/bubble_manage_button.xml @@ -20,9 +20,10 @@ android:id="@+id/settings_button" android:layout_gravity="start" android:layout_width="wrap_content" - android:layout_height="40dp" - android:layout_marginTop="8dp" - android:layout_marginBottom="8dp" + android:layout_height="@dimen/bubble_manage_button_height" + android:layout_marginStart="@dimen/bubble_manage_button_margin" + android:layout_marginTop="@dimen/bubble_manage_button_margin" + android:layout_marginBottom="@dimen/bubble_manage_button_margin" android:focusable="true" android:text="@string/manage_bubbles_text" android:textSize="@*android:dimen/text_size_body_2_material" diff --git a/libs/WindowManager/Shell/res/values/dimen.xml b/libs/WindowManager/Shell/res/values/dimen.xml index 07bb890879419..95899a63b72e8 100644 --- a/libs/WindowManager/Shell/res/values/dimen.xml +++ b/libs/WindowManager/Shell/res/values/dimen.xml @@ -149,7 +149,11 @@ 16dp - 56dp + 36dp + + 68dp + + 16dp 60dp diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java index a02fa9b18e49e..252b588ec63f9 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java @@ -735,6 +735,10 @@ public class BubbleExpandedView extends LinearLayout { mManageButton.getBoundsOnScreen(rect); } + public int getManageButtonMargin() { + return ((LinearLayout.LayoutParams) mManageButton.getLayoutParams()).getMarginStart(); + } + /** * Cleans up anything related to the task and {@code TaskView}. If this view should be reused * after this method is called, then diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubblePositioner.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubblePositioner.java index 0a856a8231a05..27e20120a0e5d 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubblePositioner.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubblePositioner.java @@ -77,7 +77,6 @@ public class BubblePositioner { private int mPointerMargin; private int mPointerWidth; private int mPointerHeight; - private int mPointerOverlap; private int mManageButtonHeight; private int mExpandedViewMinHeight; private int mOverflowHeight; @@ -166,8 +165,7 @@ public class BubblePositioner { mPointerWidth = res.getDimensionPixelSize(R.dimen.bubble_pointer_width); mPointerHeight = res.getDimensionPixelSize(R.dimen.bubble_pointer_height); mPointerMargin = res.getDimensionPixelSize(R.dimen.bubble_pointer_margin); - mPointerOverlap = res.getDimensionPixelSize(R.dimen.bubble_pointer_overlap); - mManageButtonHeight = res.getDimensionPixelSize(R.dimen.bubble_manage_button_height); + mManageButtonHeight = res.getDimensionPixelSize(R.dimen.bubble_manage_button_total_height); mExpandedViewMinHeight = res.getDimensionPixelSize(R.dimen.bubble_expanded_default_height); mOverflowHeight = res.getDimensionPixelSize(R.dimen.bubble_overflow_height); 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 126d7358925ef..9ca107e92654b 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 @@ -2548,7 +2548,6 @@ public class BubbleStackView extends FrameLayout R.string.bubbles_app_settings, bubble.getAppName())); } - mExpandedBubble.getExpandedView().getManageButtonBoundsOnScreen(mTempRect); if (mExpandedBubble.getExpandedView().getTaskView() != null) { mExpandedBubble.getExpandedView().getTaskView().setObscuredTouchRect(mShowingManage ? new Rect(0, 0, getWidth(), getHeight()) @@ -2560,7 +2559,11 @@ public class BubbleStackView extends FrameLayout // When the menu is open, it should be at these coordinates. The menu pops out to the right // in LTR and to the left in RTL. - final float targetX = isLtr ? mTempRect.left : mTempRect.right - mManageMenu.getWidth(); + mExpandedBubble.getExpandedView().getManageButtonBoundsOnScreen(mTempRect); + final float margin = mExpandedBubble.getExpandedView().getManageButtonMargin(); + final float targetX = isLtr + ? mTempRect.left - margin + : mTempRect.right + margin - mManageMenu.getWidth(); final float targetY = mTempRect.bottom - mManageMenu.getHeight(); final float xOffsetForAnimation = (isLtr ? 1 : -1) * mManageMenu.getWidth() / 4f;