Fix contrast tile measurement calculation for folders

When creating a folder, the element name begins empty. Because of this,
while layout is happening, the paddings for the text and the bubble are
not considered. Fix the condition within onMeasure to add the respective
paddings when the bubble could be drawn.

Bug: 341217082
Flag: com.android.launcher3.enable_contrast_tiles
Test: Manual, visual change
Change-Id: Ie707102fa3d4827568a9db247ea5ebf5f8e1ae0d
This commit is contained in:
Ana Salazar Maldonado
2025-02-12 11:03:41 -08:00
parent 4425ab3062
commit 4ff68edea9
2 changed files with 5 additions and 3 deletions
@@ -964,7 +964,8 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
@Override
public void setTextColor(ColorStateList colors) {
mTextColor = shouldDrawAppContrastTile() ? PillColorProvider.getInstance(
mTextColor = (shouldDrawAppContrastTile() && !TextUtils.isEmpty(getText()))
? PillColorProvider.getInstance(
getContext()).getAppTitleTextPaint().getColor()
: colors.getDefaultColor();
mTextColorStateList = colors;
@@ -989,7 +990,7 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
public boolean shouldDrawAppContrastTile() {
return mDisplay == DISPLAY_WORKSPACE && shouldTextBeVisible()
&& PillColorProvider.getInstance(getContext()).isMatchaEnabled()
&& enableContrastTiles() && !TextUtils.isEmpty(getText());
&& enableContrastTiles();
}
public void setTextVisibility(boolean visible) {