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

CheckboxColors

public final class CheckboxColors


Represents the colors used by the three different sections (checkmark, box, and border) of a Checkbox or TriStateCheckbox in different states.

Summary

Public constructors

CheckboxColors(
    @NonNull Color checkedCheckmarkColor,
    @NonNull Color uncheckedCheckmarkColor,
    @NonNull Color checkedBoxColor,
    @NonNull Color uncheckedBoxColor,
    @NonNull Color disabledCheckedBoxColor,
    @NonNull Color disabledUncheckedBoxColor,
    @NonNull Color disabledIndeterminateBoxColor,
    @NonNull Color checkedBorderColor,
    @NonNull Color uncheckedBorderColor,
    @NonNull Color disabledBorderColor,
    @NonNull Color disabledUncheckedBorderColor,
    @NonNull Color disabledIndeterminateBorderColor
)

create an instance with arbitrary colors, see CheckboxDefaults.colors for the default implementation that follows Material specifications.

Public methods

final @NonNull CheckboxColors
copy(
    @NonNull Color checkedCheckmarkColor,
    @NonNull Color uncheckedCheckmarkColor,
    @NonNull Color checkedBoxColor,
    @NonNull Color uncheckedBoxColor,
    @NonNull Color disabledCheckedBoxColor,
    @NonNull Color disabledUncheckedBoxColor,
    @NonNull Color disabledIndeterminateBoxColor,
    @NonNull Color checkedBorderColor,
    @NonNull Color uncheckedBorderColor,
    @NonNull Color disabledBorderColor,
    @NonNull Color disabledUncheckedBorderColor,
    @NonNull Color disabledIndeterminateBorderColor
)

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

boolean
equals(Object other)
final @NonNull Color

color that will be used for the border when checked

final @NonNull Color

the color that will be used for the box when checked

final @NonNull Color

color that will be used for the checkmark when checked

final @NonNull Color

color that will be used for the border when disabled and checked

final @NonNull Color

color that will be used for the box when disabled and checked

final @NonNull Color

color that will be used for the border when disabled and in an ToggleableState.Indeterminate state.

final @NonNull Color

color that will be used for the box and border in a TriStateCheckbox when disabled AND in an ToggleableState.Indeterminate state.

final @NonNull Color

color that will be used for the border when disabled and unchecked

final @NonNull Color

color that will be used for the box when disabled and unchecked

final @NonNull Color

color that will be used for the border when unchecked

final @NonNull Color

color that will be used for the box when unchecked

final @NonNull Color

color that will be used for the checkmark when unchecked

int

Public constructors

CheckboxColors

public CheckboxColors(
    @NonNull Color checkedCheckmarkColor,
    @NonNull Color uncheckedCheckmarkColor,
    @NonNull Color checkedBoxColor,
    @NonNull Color uncheckedBoxColor,
    @NonNull Color disabledCheckedBoxColor,
    @NonNull Color disabledUncheckedBoxColor,
    @NonNull Color disabledIndeterminateBoxColor,
    @NonNull Color checkedBorderColor,
    @NonNull Color uncheckedBorderColor,
    @NonNull Color disabledBorderColor,
    @NonNull Color disabledUncheckedBorderColor,
    @NonNull Color disabledIndeterminateBorderColor
)

create an instance with arbitrary colors, see CheckboxDefaults.colors for the default implementation that follows Material specifications.

Parameters
@NonNull Color checkedCheckmarkColor

color that will be used for the checkmark when checked

@NonNull Color uncheckedCheckmarkColor

color that will be used for the checkmark when unchecked

@NonNull Color checkedBoxColor

the color that will be used for the box when checked

@NonNull Color uncheckedBoxColor

color that will be used for the box when unchecked

@NonNull Color disabledCheckedBoxColor

color that will be used for the box when disabled and checked

@NonNull Color disabledUncheckedBoxColor

color that will be used for the box when disabled and unchecked

@NonNull Color disabledIndeterminateBoxColor

color that will be used for the box and border in a TriStateCheckbox when disabled AND in an ToggleableState.Indeterminate state.

@NonNull Color checkedBorderColor

color that will be used for the border when checked

@NonNull Color uncheckedBorderColor

color that will be used for the border when unchecked

@NonNull Color disabledBorderColor

color that will be used for the border when disabled and checked

@NonNull Color disabledUncheckedBorderColor

color that will be used for the border when disabled and unchecked

@NonNull Color disabledIndeterminateBorderColor

color that will be used for the border when disabled and in an ToggleableState.Indeterminate state.

Public methods

copy

public final @NonNull CheckboxColors copy(
    @NonNull Color checkedCheckmarkColor,
    @NonNull Color uncheckedCheckmarkColor,
    @NonNull Color checkedBoxColor,
    @NonNull Color uncheckedBoxColor,
    @NonNull Color disabledCheckedBoxColor,
    @NonNull Color disabledUncheckedBoxColor,
    @NonNull Color disabledIndeterminateBoxColor,
    @NonNull Color checkedBorderColor,
    @NonNull Color uncheckedBorderColor,
    @NonNull Color disabledBorderColor,
    @NonNull Color disabledUncheckedBorderColor,
    @NonNull Color disabledIndeterminateBorderColor
)

Returns a copy of this CheckboxColors, 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)

getCheckedBorderColor

public final @NonNull Color getCheckedBorderColor()

color that will be used for the border when checked

getCheckedBoxColor

public final @NonNull Color getCheckedBoxColor()

the color that will be used for the box when checked

getCheckedCheckmarkColor

public final @NonNull Color getCheckedCheckmarkColor()

color that will be used for the checkmark when checked

getDisabledBorderColor

public final @NonNull Color getDisabledBorderColor()

color that will be used for the border when disabled and checked

getDisabledCheckedBoxColor

public final @NonNull Color getDisabledCheckedBoxColor()

color that will be used for the box when disabled and checked

getDisabledIndeterminateBorderColor

public final @NonNull Color getDisabledIndeterminateBorderColor()

color that will be used for the border when disabled and in an ToggleableState.Indeterminate state.

getDisabledIndeterminateBoxColor

public final @NonNull Color getDisabledIndeterminateBoxColor()

color that will be used for the box and border in a TriStateCheckbox when disabled AND in an ToggleableState.Indeterminate state.

getDisabledUncheckedBorderColor

public final @NonNull Color getDisabledUncheckedBorderColor()

color that will be used for the border when disabled and unchecked

getDisabledUncheckedBoxColor

public final @NonNull Color getDisabledUncheckedBoxColor()

color that will be used for the box when disabled and unchecked

getUncheckedBorderColor

public final @NonNull Color getUncheckedBorderColor()

color that will be used for the border when unchecked

getUncheckedBoxColor

public final @NonNull Color getUncheckedBoxColor()

color that will be used for the box when unchecked

getUncheckedCheckmarkColor

public final @NonNull Color getUncheckedCheckmarkColor()

color that will be used for the checkmark when unchecked

hashCode

public int hashCode()