From 328f956961976b4dc94c0fb067c49ace28938654 Mon Sep 17 00:00:00 2001 From: Sergey Serokurov Date: Mon, 16 May 2022 19:36:53 -0700 Subject: [PATCH] Fix clipping of an app badge on bubbles in overflow Also, calculate overflow column number from the overflow view width Bug: 229581218 Test: Manual, video at https://drive.google.com/file/d/1Q3AQOiHIdOtKgzLcjHd8BiqJuk36Ka_o/view?usp=sharing Change-Id: I5f6580d86168e5914c069d017ae7c5095e0f5bd3 --- .../Shell/res/layout/bubble_overflow_container.xml | 3 ++- .../src/com/android/wm/shell/bubbles/BubbleExpandedView.java | 4 +++- .../wm/shell/bubbles/BubbleOverflowContainerView.java | 5 ++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/libs/WindowManager/Shell/res/layout/bubble_overflow_container.xml b/libs/WindowManager/Shell/res/layout/bubble_overflow_container.xml index cb516cdbe49b0..df5985c605d1a 100644 --- a/libs/WindowManager/Shell/res/layout/bubble_overflow_container.xml +++ b/libs/WindowManager/Shell/res/layout/bubble_overflow_container.xml @@ -30,7 +30,8 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="center_horizontal" - android:gravity="center"/> + android:gravity="center" + android:clipChildren="false"/> { + mOverflowView.show(); + }); } } diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleOverflowContainerView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleOverflowContainerView.java index fcd0ed7308eff..9aa285fff19ce 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleOverflowContainerView.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleOverflowContainerView.java @@ -167,7 +167,10 @@ public class BubbleOverflowContainerView extends LinearLayout { void updateOverflow() { Resources res = getResources(); - final int columns = res.getInteger(R.integer.bubbles_overflow_columns); + int columns = (int) Math.round(getWidth() + / (res.getDimension(R.dimen.bubble_name_width))); + columns = columns > 0 ? columns : res.getInteger(R.integer.bubbles_overflow_columns); + mRecyclerView.setLayoutManager( new OverflowGridLayoutManager(getContext(), columns)); if (mRecyclerView.getItemDecorationCount() == 0) {