Class

ListItemColors

Represents the colors of a list item in different states.

Source set: Common

Added in 1.5.0-alpha17

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

containerColor the container color of the list item.
contentColor the content color of the list item.
leadingContentColor the color of the leading content of the list item.
trailingContentColor the color of the trailing content of the list item.
overlineContentColor the color of the overline content of the list item.
supportingContentColor the color of the supporting content of the list item.
disabledContainerColor the container color of the list item when disabled.
disabledContentColor the content color of the list item when disabled.
disabledLeadingContentColor the color of the leading content of the list item when disabled.
disabledTrailingContentColor the color of the trailing content of the list item when disabled.
disabledOverlineContentColor the color of the overline content of the list item when disabled.
disabledSupportingContentColor the color of the supporting content of the list item when disabled.
selectedContainerColor the container color of the list item when selected.
selectedContentColor the content color of the list item when selected.
selectedLeadingContentColor the color of the leading content of the list item when selected.
selectedTrailingContentColor the color of the trailing content of the list item when selected.
selectedOverlineContentColor the color of the overline content of the list item when selected.
selectedSupportingContentColor the color of the supporting content of the list item when selected.
draggedContainerColor the container color of the list item when dragged.
draggedContentColor the content color of the list item when dragged.
draggedLeadingContentColor the color of the leading content of the list item when dragged.
draggedTrailingContentColor the color of the trailing content of the list item when dragged.
draggedOverlineContentColor the color of the overline content of the list item when dragged.
draggedSupportingContentColor the color of the supporting content of the list item when dragged.

Secondary Constructors

Added in 1.5.0-alpha17

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

headlineColor

Deprecated

Renamed to contentColor

Source set: Common

Added in 1.5.0-alpha17

Deprecated in 1.5.0-alpha17

val headlineColor: Color

leadingIconColor

Deprecated

Renamed to leadingContentColor

Source set: Common

Added in 1.5.0-alpha17

Deprecated in 1.5.0-alpha17

val leadingIconColor: Color

overlineColor

Deprecated

Renamed to overlineContentColor

Source set: Common

Added in 1.5.0-alpha17

Deprecated in 1.5.0-alpha17

val overlineColor: Color

supportingTextColor

Deprecated

Renamed to supportingContentColor

Source set: Common

Added in 1.5.0-alpha17

Deprecated in 1.5.0-alpha17

val supportingTextColor: Color

trailingIconColor

Deprecated

Renamed to trailingContentColor

Source set: Common

Added in 1.5.0-alpha17

Deprecated in 1.5.0-alpha17

val trailingIconColor: Color

disabledHeadlineColor

Deprecated

Renamed to disabledContentColor

Source set: Common

Added in 1.5.0-alpha17

Deprecated in 1.5.0-alpha17

val disabledHeadlineColor: Color

disabledLeadingIconColor

Deprecated

Renamed to disabledLeadingContentColor

Source set: Common

Added in 1.5.0-alpha17

Deprecated in 1.5.0-alpha17

val disabledLeadingIconColor: Color

disabledTrailingIconColor

Deprecated

Renamed to disabledTrailingContentColor

Source set: Common

Added in 1.5.0-alpha17

Deprecated in 1.5.0-alpha17

val disabledTrailingIconColor: Color

Functions

containerColor

Added in 1.5.0-alpha17

Deprecated in 1.5.0-alpha17

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

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

Parameters

enabled whether the list item is enabled.
selected whether the list item is selected.
dragged whether the list item is dragged.

contentColor

Added in 1.5.0-alpha17

Deprecated in 1.5.0-alpha17

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

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

Parameters

enabled whether the list item is enabled.
selected whether the list item is selected.
dragged whether the list item is dragged.

leadingContentColor

Added in 1.5.0-alpha17

Deprecated in 1.5.0-alpha17

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

enabled whether the list item is enabled.
selected whether the list item is selected.
dragged whether the list item is dragged.

trailingContentColor

Added in 1.5.0-alpha17

Deprecated in 1.5.0-alpha17

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

enabled whether the list item is enabled.
selected whether the list item is selected.
dragged whether the list item is dragged.

overlineContentColor

Added in 1.5.0-alpha17

Deprecated in 1.5.0-alpha17

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

enabled whether the list item is enabled.
selected whether the list item is selected.
dragged whether the list item is dragged.

supportingContentColor

Added in 1.5.0-alpha17

Deprecated in 1.5.0-alpha17

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

enabled whether the list item is enabled.
selected whether the list item is selected.
dragged whether the list item is dragged.

copy

Added in 1.5.0-alpha17

Deprecated in 1.5.0-alpha17

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”.

copy

Added in 1.5.0-alpha17

Deprecated in 1.5.0-alpha17

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