Update EmptyStateCta with solid background color
Update EmptyStateCta component to improve text visibility by:
- Replace transparent Card with solid primary color background
- Remove border stroke from Card
- Update text color to use onPrimary for better contrast
- Update button colors to use primaryContainer/onPrimaryContainer
- Maintain existing layout, spacing, and accessibility features
Bug: 378418098
Test: Device tested
Flag: NONE Accessibility fix
Change-Id: I0587a8a452a74481985c6f85d44f214946360661
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalHub.kt b/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalHub.kt
index a55b6d7..5c80809 100644
--- a/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalHub.kt
+++ b/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalHub.kt
@@ -973,8 +973,11 @@
val colors = MaterialTheme.colorScheme
Card(
modifier = Modifier.height(hubDimensions.GridHeight).padding(contentPadding),
- colors = CardDefaults.cardColors(containerColor = Color.Transparent),
- border = BorderStroke(3.adjustedDp, colors.secondary),
+ colors =
+ CardDefaults.cardColors(
+ containerColor = colors.primary,
+ contentColor = colors.onPrimary,
+ ),
shape = RoundedCornerShape(size = 80.adjustedDp),
) {
Column(
@@ -988,20 +991,21 @@
text = titleForEmptyStateCTA,
style = MaterialTheme.typography.displaySmall,
textAlign = TextAlign.Center,
- color = colors.primary,
+ color = colors.onPrimary,
modifier =
Modifier.focusable().semantics(mergeDescendants = true) {
contentDescription = titleForEmptyStateCTA
heading()
},
)
+
Row(modifier = Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.Center) {
Button(
modifier = Modifier.height(56.dp),
colors =
ButtonDefaults.buttonColors(
- containerColor = colors.primary,
- contentColor = colors.onPrimary,
+ containerColor = colors.primaryContainer,
+ contentColor = colors.onPrimaryContainer,
),
onClick = { viewModel.onOpenWidgetEditor(shouldOpenWidgetPickerOnStart = true) },
) {