ListItemColors
Class
Common
class ListItemColors
constructor(
val containerColor: Color,
val headlineColor: Color,
val leadingIconColor: Color,
val overlineColor: Color,
val supportingTextColor: Color,
val trailingIconColor: Color,
val disabledHeadlineColor: Color,
val disabledLeadingIconColor: Color,
val disabledTrailingIconColor: Color,
)
Represents the container and content colors used in a list item in different states.
Parameters
containerColor | the container color of this list item when enabled. |
headlineColor | the headline text content color of this list item when enabled. |
leadingIconColor | the color of this list item's leading content when enabled. |
overlineColor | the overline text color of this list item |
supportingTextColor | the supporting text color of this list item |
trailingIconColor | the color of this list item's trailing content when enabled. |
disabledHeadlineColor | the content color of this list item when not enabled. |
disabledLeadingIconColor | the color of this list item's leading content when not enabled. |
disabledTrailingIconColor | the color of this list item's trailing content when not enabled. |
Functions
fun copy(
containerColor: Color = this.containerColor,
headlineColor: Color = this.headlineColor,
leadingIconColor: Color = this.leadingIconColor,
overlineColor: Color = this.overlineColor,
supportingTextColor: Color = this.supportingTextColor,
trailingIconColor: Color = this.trailingIconColor,
disabledHeadlineColor: Color = this.disabledHeadlineColor,
disabledLeadingIconColor: Color = this.disabledLeadingIconColor,
disabledTrailingIconColor: Color = this.disabledTrailingIconColor,
) =
ListItemColors(
containerColor = containerColor.takeOrElse { this.containerColor },
headlineColor = headlineColor.takeOrElse { this.headlineColor },
leadingIconColor = leadingIconColor.takeOrElse { this.leadingIconColor },
overlineColor = overlineColor.takeOrElse { this.overlineColor },
supportingTextColor = supportingTextColor.takeOrElse { this.supportingTextColor },
trailingIconColor = trailingIconColor.takeOrElse { this.trailingIconColor },
disabledHeadlineColor = disabledHeadlineColor.takeOrElse { this.disabledHeadlineColor },
disabledLeadingIconColor =
disabledLeadingIconColor.takeOrElse { this.disabledLeadingIconColor },
disabledTrailingIconColor =
disabledTrailingIconColor.takeOrElse { this.disabledTrailingIconColor },
)
Returns a copy of this ListItemColors, optionally overriding some of the values. This uses the Color.Unspecified to mean “use the value from the source”