ListItemColors

Represents the colors of a list item in different states.

ListItemColors

Class

Common
class ListItemColors(
    val containerColor: Color,
    val contentColor: Color,
    val leadingContentColor: Color,
    val trailingContentColor: Color,
    val overlineContentColor: Color,
    val supportingContentColor: Color,
    val disabledContainerColor: Color,
    val disabledContentColor: Color,
    val disabledLeadingContentColor: Color,
    val disabledTrailingContentColor: Color,
    val disabledOverlineContentColor: Color,
    val disabledSupportingContentColor: Color,
    val selectedContainerColor: Color,
    val selectedContentColor: Color,
    val selectedLeadingContentColor: Color,
    val selectedTrailingContentColor: Color,
    val selectedOverlineContentColor: Color,
    val selectedSupportingContentColor: Color,
    val draggedContainerColor: Color,
    val draggedContentColor: Color,
    val draggedLeadingContentColor: Color,
    val draggedTrailingContentColor: Color,
    val draggedOverlineContentColor: Color,
    val draggedSupportingContentColor: Color,
)

Represents the colors of a list item in different states.

Parameters

containerColorthe container color of the list item.
contentColorthe content color of the list item.
leadingContentColorthe color of the leading content of the list item.
trailingContentColorthe color of the trailing content of the list item.
overlineContentColorthe color of the overline content of the list item.
supportingContentColorthe color of the supporting content of the list item.
disabledContainerColorthe container color of the list item when disabled.
disabledContentColorthe content color of the list item when disabled.
disabledLeadingContentColorthe color of the leading content of the list item when disabled.
disabledTrailingContentColorthe color of the trailing content of the list item when disabled.
disabledOverlineContentColorthe color of the overline content of the list item when disabled.
disabledSupportingContentColorthe color of the supporting content of the list item when disabled.
selectedContainerColorthe container color of the list item when selected.
selectedContentColorthe content color of the list item when selected.
selectedLeadingContentColorthe color of the leading content of the list item when selected.
selectedTrailingContentColorthe color of the trailing content of the list item when selected.
selectedOverlineContentColorthe color of the overline content of the list item when selected.
selectedSupportingContentColorthe color of the supporting content of the list item when selected.
draggedContainerColorthe container color of the list item when dragged.
draggedContentColorthe content color of the list item when dragged.
draggedLeadingContentColorthe color of the leading content of the list item when dragged.
draggedTrailingContentColorthe color of the trailing content of the list item when dragged.
draggedOverlineContentColorthe color of the overline content of the list item when dragged.
draggedSupportingContentColorthe color of the supporting content of the list item when dragged.

Secondary Constructors

constructor(
    containerColor: Color,
    headlineColor: Color,
    leadingIconColor: Color,
    overlineColor: Color,
    supportingTextColor: Color,
    trailingIconColor: Color,
    disabledHeadlineColor: Color,
    disabledLeadingIconColor: Color,
    disabledTrailingIconColor: Color,
) : this(
    // default
    containerColor = containerColor,
    contentColor = headlineColor,
    leadingContentColor = leadingIconColor,
    trailingContentColor = trailingIconColor,
    overlineContentColor = overlineColor,
    supportingContentColor = supportingTextColor,
    // disabled
    disabledContainerColor = Color.Unspecified,
    disabledContentColor = disabledHeadlineColor,
    disabledLeadingContentColor = disabledLeadingIconColor,
    disabledTrailingContentColor = disabledTrailingIconColor,
    disabledOverlineContentColor = Color.Unspecified,
    disabledSupportingContentColor = Color.Unspecified,
    // selected
    selectedContainerColor = Color.Unspecified,
    selectedContentColor = Color.Unspecified,
    selectedLeadingContentColor = Color.Unspecified,
    selectedTrailingContentColor = Color.Unspecified,
    selectedOverlineContentColor = Color.Unspecified,
    selectedSupportingContentColor = Color.Unspecified,
    // dragged
    draggedContainerColor = Color.Unspecified,
    draggedContentColor = Color.Unspecified,
    draggedLeadingContentColor = Color.Unspecified,
    draggedTrailingContentColor = Color.Unspecified,
    draggedOverlineContentColor = Color.Unspecified,
    draggedSupportingContentColor = Color.Unspecified,
)

Properties

Common

Deprecated Renamed to contentColor

val headlineColor: Color
Common

Deprecated Renamed to leadingContentColor

val leadingIconColor: Color
Common

Deprecated Renamed to overlineContentColor

val overlineColor: Color
Common

Deprecated Renamed to supportingContentColor

val supportingTextColor: Color
Common

Deprecated Renamed to trailingContentColor

val trailingIconColor: Color
Common

Deprecated Renamed to disabledContentColor

val disabledHeadlineColor: Color
Common

Deprecated Renamed to disabledLeadingContentColor

val disabledLeadingIconColor: Color
Common

Deprecated Renamed to disabledTrailingContentColor

val disabledTrailingIconColor: Color

Functions

fun containerColor(enabled: Boolean, selected: Boolean, dragged: Boolean): Color

Returns the container color of the list item based on the current state.

Parameters

enabledwhether the list item is enabled.
selectedwhether the list item is selected.
draggedwhether the list item is dragged.
fun contentColor(enabled: Boolean, selected: Boolean, dragged: Boolean): Color

Returns the content color of the list item based on the current state.

Parameters

enabledwhether the list item is enabled.
selectedwhether the list item is selected.
draggedwhether the list item is dragged.
fun leadingContentColor(enabled: Boolean, selected: Boolean, dragged: Boolean): Color

Returns the color of the leading content of the list item based on the current state.

Parameters

enabledwhether the list item is enabled.
selectedwhether the list item is selected.
draggedwhether the list item is dragged.
fun trailingContentColor(enabled: Boolean, selected: Boolean, dragged: Boolean): Color

Returns the color of the trailing content of the list item based on the current state.

Parameters

enabledwhether the list item is enabled.
selectedwhether the list item is selected.
draggedwhether the list item is dragged.
fun overlineContentColor(enabled: Boolean, selected: Boolean, dragged: Boolean): Color

Returns the color of the overline content of the list item based on the current state.

Parameters

enabledwhether the list item is enabled.
selectedwhether the list item is selected.
draggedwhether the list item is dragged.
fun supportingContentColor(enabled: Boolean, selected: Boolean, dragged: Boolean): Color

Returns the color of the supporting content of the list item based on the current state.

Parameters

enabledwhether the list item is enabled.
selectedwhether the list item is selected.
draggedwhether the list item is dragged.
fun copy(
        containerColor: Color = this.containerColor,
        contentColor: Color = this.contentColor,
        leadingContentColor: Color = this.leadingContentColor,
        trailingContentColor: Color = this.trailingContentColor,
        overlineContentColor: Color = this.overlineContentColor,
        supportingContentColor: Color = this.supportingContentColor,
        disabledContainerColor: Color = this.disabledContainerColor,
        disabledContentColor: Color = this.disabledContentColor,
        disabledLeadingContentColor: Color = this.disabledLeadingContentColor,
        disabledTrailingContentColor: Color = this.disabledTrailingContentColor,
        disabledOverlineContentColor: Color = this.disabledOverlineContentColor,
        disabledSupportingContentColor: Color = this.disabledSupportingContentColor,
        selectedContainerColor: Color = this.selectedContainerColor,
        selectedContentColor: Color = this.selectedContentColor,
        selectedLeadingContentColor: Color = this.selectedLeadingContentColor,
        selectedTrailingContentColor: Color = this.selectedTrailingContentColor,
        selectedOverlineContentColor: Color = this.selectedOverlineContentColor,
        selectedSupportingContentColor: Color = this.selectedSupportingContentColor,
        draggedContainerColor: Color = this.draggedContainerColor,
        draggedContentColor: Color = this.draggedContentColor,
        draggedLeadingContentColor: Color = this.draggedLeadingContentColor,
        draggedTrailingContentColor: Color = this.draggedTrailingContentColor,
        draggedOverlineContentColor: Color = this.draggedOverlineContentColor,
        draggedSupportingContentColor: Color = this.draggedSupportingContentColor,
    ): ListItemColors

Returns a copy of this ListItemColors, optionally overriding some of the values. This uses Color.Unspecified to mean “use the value from the source”.

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 },
        )