Merge "Update shape for all bubbles" into qt-dev
am: 7fddea0e29
Change-Id: Iba31c97cee184c1156d91f34dcb5654fe0966524
This commit is contained in:
@@ -303,6 +303,7 @@ public class BubbleStackView extends FrameLayout {
|
|||||||
*/
|
*/
|
||||||
public void onConfigChanged() {
|
public void onConfigChanged() {
|
||||||
for (Bubble b: mBubbleData.getBubbles()) {
|
for (Bubble b: mBubbleData.getBubbles()) {
|
||||||
|
b.iconView.updateViews();
|
||||||
b.expandedView.updateHeaderColor();
|
b.expandedView.updateHeaderColor();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ public class BubbleView extends FrameLayout {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateViews() {
|
void updateViews() {
|
||||||
if (mEntry == null) {
|
if (mEntry == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -186,6 +186,13 @@ public class BubbleView extends FrameLayout {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Drawable buildIconWithTint(Drawable iconDrawable, int backgroundColor) {
|
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 */);
|
backgroundColor = ColorUtils.setAlphaComponent(backgroundColor, 255 /* alpha */);
|
||||||
if (backgroundColor == Color.TRANSPARENT) {
|
if (backgroundColor == Color.TRANSPARENT) {
|
||||||
// ColorUtils throws exception when background is translucent.
|
// 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);
|
int dark = ColorUtils.setAlphaComponent(Color.BLACK, DARK_ICON_ALPHA);
|
||||||
iconDrawable.setTint(dark);
|
iconDrawable.setTint(dark);
|
||||||
}
|
}
|
||||||
InsetDrawable foreground = new InsetDrawable(iconDrawable, mIconInset);
|
return iconDrawable;
|
||||||
ColorDrawable background = new ColorDrawable(backgroundColor);
|
|
||||||
return new AdaptiveIconDrawable(background, foreground);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private int determineDominateColor(Drawable d, int defaultTint) {
|
private int determineDominateColor(Drawable d, int defaultTint) {
|
||||||
|
|||||||
Reference in New Issue
Block a user