From edb55e25b77c066da78787c3b36d1f310b42d599 Mon Sep 17 00:00:00 2001 From: Lyn Han Date: Wed, 12 Feb 2020 18:55:39 -0800 Subject: [PATCH] Update overflow button on theme change Bug: 149146374 Fixes: 149176394 Test: change theme - overflow button changes with theme Test: atest SystemUITests Change-Id: I04d5e59f0451cac2010519477770add46aa727ee --- .../android/systemui/bubbles/BubbleExpandedView.java | 3 ++- .../com/android/systemui/bubbles/BubbleStackView.java | 11 +++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleExpandedView.java b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleExpandedView.java index 0d5261dcb7f33..fe191f40d31fb 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleExpandedView.java +++ b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleExpandedView.java @@ -294,7 +294,8 @@ public class BubbleExpandedView extends LinearLayout implements View.OnClickList ta.recycle(); mPointerDrawable.setTint(bgColor); - if (ScreenDecorationsUtils.supportsRoundedCornersOnWindows(mContext.getResources())) { + if (mActivityView != null && ScreenDecorationsUtils.supportsRoundedCornersOnWindows( + mContext.getResources())) { mActivityView.setCornerRadius(cornerRadius); } } diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java index bce172b891872..557d1bb0ae52d 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java +++ b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java @@ -528,6 +528,12 @@ public class BubbleStackView extends FrameLayout { mBubbleContainer.addView(mOverflowBtn, 0, new FrameLayout.LayoutParams(WRAP_CONTENT, WRAP_CONTENT)); + setOverflowBtnTheme(); + mOverflowBtn.setVisibility(GONE); + } + + // TODO(b/149146374) Propagate theme change to bubbles in overflow. + private void setOverflowBtnTheme() { TypedArray ta = mContext.obtainStyledAttributes( new int[]{android.R.attr.colorBackgroundFloating}); int bgColor = ta.getColor(0, Color.WHITE /* default */); @@ -537,8 +543,6 @@ public class BubbleStackView extends FrameLayout { ColorDrawable bg = new ColorDrawable(bgColor); AdaptiveIconDrawable adaptiveIcon = new AdaptiveIconDrawable(bg, fg); mOverflowBtn.setImageDrawable(adaptiveIcon); - - mOverflowBtn.setVisibility(GONE); } void showExpandedViewContents(int displayId) { @@ -568,6 +572,9 @@ public class BubbleStackView extends FrameLayout { */ public void onThemeChanged() { setUpFlyout(); + if (BubbleExperimentConfig.allowBubbleOverflow(mContext)) { + setOverflowBtnTheme(); + } } /** Respond to the phone being rotated by repositioning the stack and hiding any flyouts. */