diff --git a/components/src/main/kotlin/de/jeanlucmakiola/floret/components/GroupedList.kt b/components/src/main/kotlin/de/jeanlucmakiola/floret/components/GroupedList.kt index 62f206d..a60e628 100644 --- a/components/src/main/kotlin/de/jeanlucmakiola/floret/components/GroupedList.kt +++ b/components/src/main/kotlin/de/jeanlucmakiola/floret/components/GroupedList.kt @@ -127,9 +127,12 @@ fun GroupedSurface( * headline and summary to the M3 disabled emphasis while leaving the [trailing] * control at full opacity — for rows that are present but switched off. * [container] overrides the row's tonal colour (e.g. a category tint); ignored - * when [selected]. [gapBelow] (see [GroupedSurface]) suppresses the inter-row - * gap for a caller that owns its own uniform spacing, e.g. [ReorderableColumn]. - * [onLongClick] (see [GroupedSurface]) adds a long-press to the row. + * when [selected]. [contentColor] is its pair — the `on*` role for that + * container, so a tinted row keeps its contrast in both themes instead of + * leaving the text on `onSurface`. [gapBelow] (see [GroupedSurface]) suppresses + * the inter-row gap for a caller that owns its own uniform spacing, e.g. + * [ReorderableColumn]. [onLongClick] (see [GroupedSurface]) adds a long-press to + * the row. */ @Composable fun GroupedRow( @@ -140,6 +143,7 @@ fun GroupedRow( selected: Boolean = false, dimmed: Boolean = false, container: Color? = null, + contentColor: Color? = null, minHeight: Dp = 72.dp, gapBelow: Boolean = true, leading: @Composable (() -> Unit)? = null, @@ -154,6 +158,7 @@ fun GroupedRow( selected = selected, dimmed = dimmed, container = container, + contentColor = contentColor, minHeight = minHeight, gapBelow = gapBelow, leading = leading, @@ -177,6 +182,7 @@ fun GroupedRow( selected: Boolean = false, dimmed: Boolean = false, container: Color? = null, + contentColor: Color? = null, minHeight: Dp = 72.dp, gapBelow: Boolean = true, leading: @Composable (() -> Unit)? = null, @@ -202,6 +208,14 @@ fun GroupedRow( leadingIconColor = muted, supportingColor = muted, ) + } else if (contentColor != null) { + ListItemDefaults.colors( + containerColor = Color.Transparent, + headlineColor = contentColor, + leadingIconColor = contentColor, + supportingColor = contentColor, + trailingIconColor = contentColor, + ) } else { ListItemDefaults.colors(containerColor = Color.Transparent) }