{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

ChipColors

public final class ChipColors


Represents the container and content colors used in a clickable chip in different states.

Summary

Public constructors

ChipColors(
    @NonNull Color containerColor,
    @NonNull Color labelColor,
    @NonNull Color leadingIconContentColor,
    @NonNull Color trailingIconContentColor,
    @NonNull Color disabledContainerColor,
    @NonNull Color disabledLabelColor,
    @NonNull Color disabledLeadingIconContentColor,
    @NonNull Color disabledTrailingIconContentColor
)

create an instance with arbitrary colors, see AssistChipDefaults, InputChipDefaults, and SuggestionChipDefaults for the default colors used in the various Chip configurations.

Public methods

final @NonNull ChipColors
copy(
    @NonNull Color containerColor,
    @NonNull Color labelColor,
    @NonNull Color leadingIconContentColor,
    @NonNull Color trailingIconContentColor,
    @NonNull Color disabledContainerColor,
    @NonNull Color disabledLabelColor,
    @NonNull Color disabledLeadingIconContentColor,
    @NonNull Color disabledTrailingIconContentColor
)

Returns a copy of this ChipColors, optionally overriding some of the values.

boolean
equals(Object other)
final @NonNull Color

the container color of this chip when enabled

final @NonNull Color

the container color of this chip when not enabled

final @NonNull Color

the label color of this chip when not enabled

final @NonNull Color

the color of this chip's start icon when not enabled

final @NonNull Color

the color of this chip's end icon when not enabled

final @NonNull Color

the label color of this chip when enabled

final @NonNull Color

the color of this chip's start icon when enabled

final @NonNull Color

the color of this chip's end icon when enabled

int

Public constructors

ChipColors

public ChipColors(
    @NonNull Color containerColor,
    @NonNull Color labelColor,
    @NonNull Color leadingIconContentColor,
    @NonNull Color trailingIconContentColor,
    @NonNull Color disabledContainerColor,
    @NonNull Color disabledLabelColor,
    @NonNull Color disabledLeadingIconContentColor,
    @NonNull Color disabledTrailingIconContentColor
)

create an instance with arbitrary colors, see AssistChipDefaults, InputChipDefaults, and SuggestionChipDefaults for the default colors used in the various Chip configurations.

Parameters
@NonNull Color containerColor

the container color of this chip when enabled

@NonNull Color labelColor

the label color of this chip when enabled

@NonNull Color leadingIconContentColor

the color of this chip's start icon when enabled

@NonNull Color trailingIconContentColor

the color of this chip's end icon when enabled

@NonNull Color disabledContainerColor

the container color of this chip when not enabled

@NonNull Color disabledLabelColor

the label color of this chip when not enabled

@NonNull Color disabledLeadingIconContentColor

the color of this chip's start icon when not enabled

@NonNull Color disabledTrailingIconContentColor

the color of this chip's end icon when not enabled

Public methods

copy

public final @NonNull ChipColors copy(
    @NonNull Color containerColor,
    @NonNull Color labelColor,
    @NonNull Color leadingIconContentColor,
    @NonNull Color trailingIconContentColor,
    @NonNull Color disabledContainerColor,
    @NonNull Color disabledLabelColor,
    @NonNull Color disabledLeadingIconContentColor,
    @NonNull Color disabledTrailingIconContentColor
)

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

equals

public boolean equals(Object other)

getContainerColor

public final @NonNull Color getContainerColor()

the container color of this chip when enabled

getDisabledContainerColor

public final @NonNull Color getDisabledContainerColor()

the container color of this chip when not enabled

getDisabledLabelColor

public final @NonNull Color getDisabledLabelColor()

the label color of this chip when not enabled

getDisabledLeadingIconContentColor

public final @NonNull Color getDisabledLeadingIconContentColor()

the color of this chip's start icon when not enabled

getDisabledTrailingIconContentColor

public final @NonNull Color getDisabledTrailingIconContentColor()

the color of this chip's end icon when not enabled

getLabelColor

public final @NonNull Color getLabelColor()

the label color of this chip when enabled

getLeadingIconContentColor

public final @NonNull Color getLeadingIconContentColor()

the color of this chip's start icon when enabled

getTrailingIconContentColor

public final @NonNull Color getTrailingIconContentColor()

the color of this chip's end icon when enabled

hashCode

public int hashCode()