Add separate background colors to each popup container child.

- Colors interpolate between the primary and secondary popup colors
- Removed condensed height and icon scale

Bug: 175329686
Test: visual, manual checking apps with different shortcut options
Change-Id: I064c329dc8ad3ae6f408056c74372cca3ce20b68
This commit is contained in:
Jon Miranda
2021-03-19 11:44:04 -04:00
parent c79316740b
commit 2a58d13b9b
5 changed files with 76 additions and 18 deletions
@@ -97,15 +97,24 @@ public class NotificationMainView extends FrameLayout implements SingleAxisSwipe
super.onFinishInflate();
mTextAndBackground = findViewById(R.id.text_and_background);
ColorDrawable colorBackground = (ColorDrawable) mTextAndBackground.getBackground();
mBackgroundColor = colorBackground.getColor();
RippleDrawable rippleBackground = new RippleDrawable(ColorStateList.valueOf(
Themes.getAttrColor(getContext(), android.R.attr.colorControlHighlight)),
colorBackground, null);
mTextAndBackground.setBackground(rippleBackground);
mTitleView = mTextAndBackground.findViewById(R.id.title);
mTextView = mTextAndBackground.findViewById(R.id.text);
mIconView = findViewById(R.id.popup_item_icon);
ColorDrawable colorBackground = (ColorDrawable) mTextAndBackground.getBackground();
updateBackgroundColor(colorBackground.getColor());
}
public void updateBackgroundColor(int color) {
mBackgroundColor = color;
RippleDrawable rippleBackground = new RippleDrawable(ColorStateList.valueOf(
Themes.getAttrColor(getContext(), android.R.attr.colorControlHighlight)),
new ColorDrawable(color), null);
mTextAndBackground.setBackground(rippleBackground);
if (mNotificationInfo != null) {
mIconView.setBackground(mNotificationInfo.getIconForBackground(getContext(),
mBackgroundColor));
}
}
public void setSwipeDetector(SingleAxisSwipeDetector swipeDetector) {