diff options
| author | 2019-04-04 14:03:40 -0700 | |
|---|---|---|
| committer | 2019-04-04 21:07:52 +0000 | |
| commit | 80b8011dce14625be838ccdb4d89af0a6775e10c (patch) | |
| tree | ab48a07020621b1c40959426c53d1915e3d812cb | |
| parent | dd07ae579c291a2b6ffe09bd576fd908eb9e5ddd (diff) | |
Update shape for all bubbles
After theme change.
Test: manual
Bug: 123829494
Change-Id: I9eca25f19646607d85957f5113178619b7927dfe
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java | 1 | ||||
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/bubbles/BubbleView.java | 13 |
2 files changed, 10 insertions, 4 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java index de4605b55272..6f2ad1da713b 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java +++ b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java @@ -303,6 +303,7 @@ public class BubbleStackView extends FrameLayout { */ public void onConfigChanged() { for (Bubble b: mBubbleData.getBubbles()) { + b.iconView.updateViews(); b.expandedView.updateHeaderColor(); } } diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleView.java b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleView.java index 84b86bf9b69f..2681b6d0c891 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleView.java +++ b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleView.java @@ -159,7 +159,7 @@ public class BubbleView extends FrameLayout { } } - private void updateViews() { + void updateViews() { if (mEntry == null) { return; } @@ -186,6 +186,13 @@ public class BubbleView extends FrameLayout { } private Drawable buildIconWithTint(Drawable iconDrawable, int backgroundColor) { + iconDrawable = checkTint(iconDrawable, backgroundColor); + InsetDrawable foreground = new InsetDrawable(iconDrawable, mIconInset); + ColorDrawable background = new ColorDrawable(backgroundColor); + return new AdaptiveIconDrawable(background, foreground); + } + + private Drawable checkTint(Drawable iconDrawable, int backgroundColor) { backgroundColor = ColorUtils.setAlphaComponent(backgroundColor, 255 /* alpha */); if (backgroundColor == Color.TRANSPARENT) { // ColorUtils throws exception when background is translucent. @@ -197,9 +204,7 @@ public class BubbleView extends FrameLayout { int dark = ColorUtils.setAlphaComponent(Color.BLACK, DARK_ICON_ALPHA); iconDrawable.setTint(dark); } - InsetDrawable foreground = new InsetDrawable(iconDrawable, mIconInset); - ColorDrawable background = new ColorDrawable(backgroundColor); - return new AdaptiveIconDrawable(background, foreground); + return iconDrawable; } private int determineDominateColor(Drawable d, int defaultTint) { |