ToggleChipDefaults
object ToggleChipDefaults
Contains the default values used by ToggleChips and SplitToggleChips
Summary
Public functions |
|
|---|---|
ImageVector |
checkboxIcon(checked: Boolean)Creates checkbox style toggle |
ImageVector |
Creates a radio button style toggle |
SplitToggleChipColors |
@ComposableCreates a |
ImageVector |
switchIcon(checked: Boolean)Creates switch style toggle |
ToggleChipColors |
@ComposableCreates a |
Public properties |
|
|---|---|
ImageVector |
|
PaddingValues |
The default content padding used by |
Dp |
The default height applied for the |
Dp |
The default size of app icons or toggle controls when used inside a |
ImageVector |
|
ImageVector |
|
Color |
The Wear Material UX recommended color to use for an unchecked switch icon. |
Public functions
checkboxIcon
fun checkboxIcon(checked: Boolean): ImageVector
Creates checkbox style toggle ImageVectors for use in the toggleControl slot of a ToggleChip or SplitToggleChip. Depending on checked will return either an 'on' (ticked/checked) or 'off' (unticked/unchecked) checkbox image.
| Parameters | |
|---|---|
checked: Boolean |
whether the |
radioIcon
fun radioIcon(checked: Boolean): ImageVector
Creates a radio button style toggle ImageVectors for use in the toggleControl slot of a ToggleChip or SplitToggleChip. Depending on checked will return either an 'on' (checked) or 'off' (unchecked) radio button icon.
| Parameters | |
|---|---|
checked: Boolean |
whether the |
splitToggleChipColors
@Composable
fun splitToggleChipColors(
backgroundColor: Color = MaterialTheme.colors.surface,
contentColor: Color = MaterialTheme.colors.onSurface,
secondaryContentColor: Color = MaterialTheme.colors.onSurfaceVariant,
checkedToggleControlColor: Color = MaterialTheme.colors.secondary,
uncheckedToggleControlColor: Color = contentColor,
splitBackgroundOverlayColor: Color = Color.White.copy(alpha = 0.05f)
): SplitToggleChipColors
Creates a SplitToggleChipColors for use in a SplitToggleChip.
| Parameters | |
|---|---|
backgroundColor: Color = MaterialTheme.colors.surface |
The background color of this |
contentColor: Color = MaterialTheme.colors.onSurface |
The content color of this |
secondaryContentColor: Color = MaterialTheme.colors.onSurfaceVariant |
The secondary content color of this |
checkedToggleControlColor: Color = MaterialTheme.colors.secondary |
The toggle control content color of this |
uncheckedToggleControlColor: Color = contentColor |
The toggle control content color of this |
splitBackgroundOverlayColor: Color = Color.White.copy(alpha = 0.05f) |
The color to use to lighten/distinguish the background behind the ToggleControl for a split background chip. A split background chip has two tappable areas, one for the main body of the chip and one for area around the toggle control icon. |
switchIcon
fun switchIcon(checked: Boolean): ImageVector
Creates switch style toggle ImageVectors for use in the toggleControl slot of a ToggleChip or SplitToggleChip. Depending on checked will return either an 'on' (checked) or 'off' (unchecked) switch icon.
| Parameters | |
|---|---|
checked: Boolean |
whether the |
toggleChipColors
@Composable
fun toggleChipColors(
checkedStartBackgroundColor: Color = MaterialTheme.colors.surface .copy(alpha = 0f) .compositeOver(MaterialTheme.colors.surface),
checkedEndBackgroundColor: Color = MaterialTheme.colors.primary .copy(alpha = 0.5f) .compositeOver(MaterialTheme.colors.surface),
checkedContentColor: Color = MaterialTheme.colors.onSurface,
checkedSecondaryContentColor: Color = MaterialTheme.colors.onSurfaceVariant,
checkedToggleControlColor: Color = MaterialTheme.colors.secondary,
uncheckedStartBackgroundColor: Color = MaterialTheme.colors.surface,
uncheckedEndBackgroundColor: Color = uncheckedStartBackgroundColor,
uncheckedContentColor: Color = contentColorFor(checkedEndBackgroundColor),
uncheckedSecondaryContentColor: Color = uncheckedContentColor,
uncheckedToggleControlColor: Color = uncheckedContentColor,
gradientDirection: LayoutDirection = LocalLayoutDirection.current
): ToggleChipColors
Creates a ToggleChipColors for use in a ToggleChip. ToggleChips are expected to have a linear gradient background when checked, similar to a ChipDefaults.gradientBackgroundChipColors and a solid neutral background when not checked (similar to a ChipDefaults.secondaryChipColors)
| Parameters | |
|---|---|
checkedStartBackgroundColor: Color = MaterialTheme.colors.surface
.copy(alpha = 0f)
.compositeOver(MaterialTheme.colors.surface) |
The background color used at the start of the gradient of a |
checkedEndBackgroundColor: Color = MaterialTheme.colors.primary
.copy(alpha = 0.5f)
.compositeOver(MaterialTheme.colors.surface) |
The background color used at the end of the gradient of a |
checkedContentColor: Color = MaterialTheme.colors.onSurface |
The content color of a |
checkedSecondaryContentColor: Color = MaterialTheme.colors.onSurfaceVariant |
The secondary content color of this |
checkedToggleControlColor: Color = MaterialTheme.colors.secondary |
The toggle control color of this |
uncheckedStartBackgroundColor: Color = MaterialTheme.colors.surface |
The background color used at the start of the gradient of a |
uncheckedEndBackgroundColor: Color = uncheckedStartBackgroundColor |
The background color used at the end of the gradient of a |
uncheckedContentColor: Color = contentColorFor(checkedEndBackgroundColor) |
The content color of a |
uncheckedSecondaryContentColor: Color = uncheckedContentColor |
The secondary content color of this |
uncheckedToggleControlColor: Color = uncheckedContentColor |
The toggle control color of this |
gradientDirection: LayoutDirection = LocalLayoutDirection.current |
Whether the chips gradient should be start to end (indicated by |
Public properties
ContentPadding
val ContentPadding: PaddingValues
The default content padding used by ToggleChip and SplitToggleChip
Height
val Height: Dp
The default height applied for the ToggleChip or SplitToggleChip. Note that you can override it by applying Modifier.heightIn directly on ToggleChip or SplitToggleChip.
IconSize
val IconSize: Dp
The default size of app icons or toggle controls when used inside a ToggleChip or SplitToggleChip.
SwitchUncheckedIconColor
val SwitchUncheckedIconColor: Color
The Wear Material UX recommended color to use for an unchecked switch icon.