SwitchDefaults


Contains the default values used by Switch

Summary

Public functions

SwitchColors

Creates a SwitchColors that represents the different colors used in a Switch in different states.

Cmn
SwitchColors
@Composable
colors(
    checkedThumbColor: Color,
    checkedTrackColor: Color,
    checkedBorderColor: Color,
    checkedIconColor: Color,
    uncheckedThumbColor: Color,
    uncheckedTrackColor: Color,
    uncheckedBorderColor: Color,
    uncheckedIconColor: Color,
    disabledCheckedThumbColor: Color,
    disabledCheckedTrackColor: Color,
    disabledCheckedBorderColor: Color,
    disabledCheckedIconColor: Color,
    disabledUncheckedThumbColor: Color,
    disabledUncheckedTrackColor: Color,
    disabledUncheckedBorderColor: Color,
    disabledUncheckedIconColor: Color
)

Creates a SwitchColors that represents the different colors used in a Switch in different states.

Cmn

Public properties

Dp

Icon size to use for thumbContent

Cmn

Public functions

colors

@Composable
fun colors(): SwitchColors

Creates a SwitchColors that represents the different colors used in a Switch in different states.

colors

@Composable
fun colors(
    checkedThumbColor: Color = SwitchTokens.SelectedHandleColor.value,
    checkedTrackColor: Color = SwitchTokens.SelectedTrackColor.value,
    checkedBorderColor: Color = Color.Transparent,
    checkedIconColor: Color = SwitchTokens.SelectedIconColor.value,
    uncheckedThumbColor: Color = SwitchTokens.UnselectedHandleColor.value,
    uncheckedTrackColor: Color = SwitchTokens.UnselectedTrackColor.value,
    uncheckedBorderColor: Color = SwitchTokens.UnselectedFocusTrackOutlineColor.value,
    uncheckedIconColor: Color = SwitchTokens.UnselectedIconColor.value,
    disabledCheckedThumbColor: Color = SwitchTokens.DisabledSelectedHandleColor.value .copy(alpha = SwitchTokens.DisabledSelectedHandleOpacity) .compositeOver(MaterialTheme.colorScheme.surface),
    disabledCheckedTrackColor: Color = SwitchTokens.DisabledSelectedTrackColor.value .copy(alpha = SwitchTokens.DisabledTrackOpacity) .compositeOver(MaterialTheme.colorScheme.surface),
    disabledCheckedBorderColor: Color = Color.Transparent,
    disabledCheckedIconColor: Color = SwitchTokens.DisabledSelectedIconColor.value .copy(alpha = SwitchTokens.DisabledSelectedIconOpacity) .compositeOver(MaterialTheme.colorScheme.surface),
    disabledUncheckedThumbColor: Color = SwitchTokens.DisabledUnselectedHandleColor.value .copy(alpha = SwitchTokens.DisabledUnselectedHandleOpacity) .compositeOver(MaterialTheme.colorScheme.surface),
    disabledUncheckedTrackColor: Color = SwitchTokens.DisabledUnselectedTrackColor.value .copy(alpha = SwitchTokens.DisabledTrackOpacity) .compositeOver(MaterialTheme.colorScheme.surface),
    disabledUncheckedBorderColor: Color = SwitchTokens.DisabledUnselectedTrackOutlineColor.value .copy(alpha = SwitchTokens.DisabledTrackOpacity) .compositeOver(MaterialTheme.colorScheme.surface),
    disabledUncheckedIconColor: Color = SwitchTokens.DisabledUnselectedIconColor.value .copy(alpha = SwitchTokens.DisabledUnselectedIconOpacity) .compositeOver(MaterialTheme.colorScheme.surface)
): SwitchColors

Creates a SwitchColors that represents the different colors used in a Switch in different states.

Parameters
checkedThumbColor: Color = SwitchTokens.SelectedHandleColor.value

the color used for the thumb when enabled and checked

checkedTrackColor: Color = SwitchTokens.SelectedTrackColor.value

the color used for the track when enabled and checked

checkedBorderColor: Color = Color.Transparent

the color used for the border when enabled and checked

checkedIconColor: Color = SwitchTokens.SelectedIconColor.value

the color used for the icon when enabled and checked

uncheckedThumbColor: Color = SwitchTokens.UnselectedHandleColor.value

the color used for the thumb when enabled and unchecked

uncheckedTrackColor: Color = SwitchTokens.UnselectedTrackColor.value

the color used for the track when enabled and unchecked

uncheckedBorderColor: Color = SwitchTokens.UnselectedFocusTrackOutlineColor.value

the color used for the border when enabled and unchecked

uncheckedIconColor: Color = SwitchTokens.UnselectedIconColor.value

the color used for the icon when enabled and unchecked

disabledCheckedThumbColor: Color = SwitchTokens.DisabledSelectedHandleColor.value .copy(alpha = SwitchTokens.DisabledSelectedHandleOpacity) .compositeOver(MaterialTheme.colorScheme.surface)

the color used for the thumb when disabled and checked

disabledCheckedTrackColor: Color = SwitchTokens.DisabledSelectedTrackColor.value .copy(alpha = SwitchTokens.DisabledTrackOpacity) .compositeOver(MaterialTheme.colorScheme.surface)

the color used for the track when disabled and checked

disabledCheckedBorderColor: Color = Color.Transparent

the color used for the border when disabled and checked

disabledCheckedIconColor: Color = SwitchTokens.DisabledSelectedIconColor.value .copy(alpha = SwitchTokens.DisabledSelectedIconOpacity) .compositeOver(MaterialTheme.colorScheme.surface)

the color used for the icon when disabled and checked

disabledUncheckedThumbColor: Color = SwitchTokens.DisabledUnselectedHandleColor.value .copy(alpha = SwitchTokens.DisabledUnselectedHandleOpacity) .compositeOver(MaterialTheme.colorScheme.surface)

the color used for the thumb when disabled and unchecked

disabledUncheckedTrackColor: Color = SwitchTokens.DisabledUnselectedTrackColor.value .copy(alpha = SwitchTokens.DisabledTrackOpacity) .compositeOver(MaterialTheme.colorScheme.surface)

the color used for the track when disabled and unchecked

disabledUncheckedBorderColor: Color = SwitchTokens.DisabledUnselectedTrackOutlineColor.value .copy(alpha = SwitchTokens.DisabledTrackOpacity) .compositeOver(MaterialTheme.colorScheme.surface)

the color used for the border when disabled and unchecked

disabledUncheckedIconColor: Color = SwitchTokens.DisabledUnselectedIconColor.value .copy(alpha = SwitchTokens.DisabledUnselectedIconOpacity) .compositeOver(MaterialTheme.colorScheme.surface)

the color used for the icon when disabled and unchecked

Public properties

IconSize

val IconSizeDp

Icon size to use for thumbContent