Merge "Fix tokens for App Contrast Pill" into main
This commit is contained in:
committed by
Android (Google) Code Review
commit
0a128474db
@@ -983,11 +983,14 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
|
||||
|
||||
@Override
|
||||
public void setTextColor(ColorStateList colors) {
|
||||
mTextColor = (shouldDrawAppContrastTile() && !TextUtils.isEmpty(getText()))
|
||||
? PillColorProvider.getInstance(
|
||||
getContext()).getAppTitleTextPaint().getColor()
|
||||
: colors.getDefaultColor();
|
||||
mTextColorStateList = colors;
|
||||
if (shouldDrawAppContrastTile()) {
|
||||
mTextColor = PillColorProvider.getInstance(
|
||||
getContext()).getAppTitleTextPaint().getColor();
|
||||
} else {
|
||||
mTextColor = colors.getDefaultColor();
|
||||
mTextColorStateList = colors;
|
||||
}
|
||||
|
||||
if (Float.compare(mTextAlpha, 1) == 0) {
|
||||
super.setTextColor(colors);
|
||||
} else {
|
||||
|
||||
@@ -58,13 +58,8 @@ class PillColorProvider private constructor(c: Context) {
|
||||
}
|
||||
|
||||
fun setup() {
|
||||
appTitlePillPaint.color =
|
||||
context.resources.getColor(
|
||||
R.color.material_color_surface_container_lowest,
|
||||
context.theme,
|
||||
)
|
||||
appTitleTextPaint.color =
|
||||
context.resources.getColor(R.color.material_color_on_surface, context.theme)
|
||||
appTitlePillPaint.color = context.getColor(R.color.materialColorSurfaceContainer)
|
||||
appTitleTextPaint.color = context.getColor(R.color.materialColorOnSurface)
|
||||
isMatchaEnabledInternal = Settings.Secure.getInt(context.contentResolver, MATCHA_SETTING, 0)
|
||||
isMatchaEnabled = isMatchaEnabledInternal != 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user