Google is committed to advancing racial equity for Black communities. See how.

CheckboxConstants

object CheckboxConstants
kotlin.Any
   ↳ androidx.compose.material.CheckboxConstants

Constants used in Checkbox and TriStateCheckbox.

Summary

Public methods
Color
animateDefaultBorderColor(state: ToggleableState, enabled: Boolean, checkedColor: Color = MaterialTheme.colors.secondary, uncheckedColor: Color = defaultUncheckedColor, disabledColor: Color = defaultDisabledColor, disabledIndeterminateColor: Color = defaultDisabledIndeterminateColor(checkedColor))

Represents the default color used for the border of the box in a Checkbox or TriStateCheckboxs as it animates between states.

Color
animateDefaultBoxColor(state: ToggleableState, enabled: Boolean, checkedColor: Color = MaterialTheme.colors.secondary, uncheckedColor: Color = checkedColor.copy(alpha = 0f), disabledCheckedColor: Color = defaultDisabledColor, disabledUncheckedColor: Color = Color.Transparent, disabledIndeterminateColor: Color = defaultDisabledIndeterminateColor(checkedColor))

Represents the default color used for the background of the box in a Checkbox or TriStateCheckbox as it animates between states.

Color
animateDefaultCheckmarkColor(state: ToggleableState, checkedColor: Color = MaterialTheme.colors.surface, uncheckedColor: Color = checkedColor.copy(alpha = 0f))

Represents the default color used for the checkmark in a Checkbox or TriStateCheckbox as it animates between states.

Color

Default color that will be used for TriStateCheckbox when disabled and in a ToggleableState.Indeterminate state.

Properties
Color

Default color that will be used for a Checkbox when disabled

Color

Default color that will be used for a Checkbox when unchecked

Public methods

animateDefaultBorderColor

@Composable fun animateDefaultBorderColor(
    state: ToggleableState,
    enabled: Boolean,
    checkedColor: Color = MaterialTheme.colors.secondary,
    uncheckedColor: Color = defaultUncheckedColor,
    disabledColor: Color = defaultDisabledColor,
    disabledIndeterminateColor: Color = defaultDisabledIndeterminateColor(checkedColor)
): Color

Represents the default color used for the border of the box in a Checkbox or TriStateCheckboxs as it animates between states.

Parameters
state: ToggleableState the ToggleableState of the checkbox
enabled: Boolean whether the checkbox is enabled
checkedColor: Color = MaterialTheme.colors.secondary the color to use for the border of the box when the Checkbox is ToggleableState.On.
uncheckedColor: Color = defaultUncheckedColor the color to use for the border of the box when the Checkbox is ToggleableState.Off.
disabledColor: Color = defaultDisabledColor the color to use for the border of the box when the Checkbox is ToggleableState.On or ToggleableState.Off, and not enabled.
disabledIndeterminateColor: Color = defaultDisabledIndeterminateColor(checkedColor) the color to use for the border of the box when the Checkbox is ToggleableState.Indeterminate and not enabled.
Return
the Color representing the border color of the box

animateDefaultBoxColor

@Composable fun animateDefaultBoxColor(
    state: ToggleableState,
    enabled: Boolean,
    checkedColor: Color = MaterialTheme.colors.secondary,
    uncheckedColor: Color = checkedColor.copy(alpha = 0f),
    disabledCheckedColor: Color = defaultDisabledColor,
    disabledUncheckedColor: Color = Color.Transparent,
    disabledIndeterminateColor: Color = defaultDisabledIndeterminateColor(checkedColor)
): Color

Represents the default color used for the background of the box in a Checkbox or TriStateCheckbox as it animates between states.

Parameters
state: ToggleableState the ToggleableState of the checkbox
enabled: Boolean whether the checkbox is enabled
checkedColor: Color = MaterialTheme.colors.secondary the color to use for the background of the box when the Checkbox is ToggleableState.On.
uncheckedColor: Color = checkedColor.copy(alpha = 0f) the color to use for the background of the box when the Checkbox is ToggleableState.Off - this is typically transparent.
disabledCheckedColor: Color = defaultDisabledColor the color to use for the background of the box when the Checkbox is ToggleableState.On and not enabled.
disabledUncheckedColor: Color = Color.Transparent the color to use for the background of the box when the Checkbox is ToggleableState.Off and not enabled.
disabledIndeterminateColor: Color = defaultDisabledIndeterminateColor(checkedColor) the color to use for the background of the box when the Checkbox is ToggleableState.Indeterminate and not enabled.
Return
the Color representing the background color of the box

animateDefaultCheckmarkColor

@Composable fun animateDefaultCheckmarkColor(
    state: ToggleableState,
    checkedColor: Color = MaterialTheme.colors.surface,
    uncheckedColor: Color = checkedColor.copy(alpha = 0f)
): Color

Represents the default color used for the checkmark in a Checkbox or TriStateCheckbox as it animates between states.

Parameters
state: ToggleableState the ToggleableState of the checkbox
checkedColor: Color = MaterialTheme.colors.surface the color to use for the checkmark when the Checkbox is ToggleableState.On.
uncheckedColor: Color = checkedColor.copy(alpha = 0f) the color to use for the checkmark when the Checkbox is ToggleableState.Off - this is typically transparent, as no checkmark should be displayed in this state.
Return
the Color representing the checkmark color

defaultDisabledIndeterminateColor

@Composable fun defaultDisabledIndeterminateColor(checkedColor: Color): Color

Default color that will be used for TriStateCheckbox when disabled and in a ToggleableState.Indeterminate state.

Properties

defaultDisabledColor

@Composable val defaultDisabledColor: Color

Default color that will be used for a Checkbox when disabled

defaultUncheckedColor

@Composable val defaultUncheckedColor: Color

Default color that will be used for a Checkbox when unchecked