Object

ToggleChipDefaults

Contains the default values used by ToggleChips and SplitToggleChips

Source set: Android

Added in 1.7.0-alpha01

public object ToggleChipDefaults

Contains the default values used by ToggleChips and SplitToggleChips

Properties

SwitchUncheckedIconColor

Source set: Android

Added in 1.7.0-alpha01

public val SwitchUncheckedIconColor: Color

The Wear Material UX recommended color to use for an unchecked switch icon.

ContentPadding

Source set: Android

Added in 1.7.0-alpha01

public val ContentPadding: PaddingValues

The default content padding used by ToggleChip and SplitToggleChip

Height

Source set: Android

Added in 1.7.0-alpha01

public 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

Source set: Android

Added in 1.7.0-alpha01

public val IconSize: Dp

The default size of app icons or toggle controls when used inside a ToggleChip or SplitToggleChip.

RadioOn

Source set: Android

Added in 1.7.0-alpha01

public val RadioOn: ImageVector

RadioOff

Source set: Android

Added in 1.7.0-alpha01

public val RadioOff: ImageVector

CheckboxOn

Source set: Android

Added in 1.7.0-alpha01

public val CheckboxOn: ImageVector

Functions

toggleChipColors

toggleChipColors

Added in 1.7.0-alpha01

@Composable
public 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 The background color used at the start of the gradient of a ToggleChip when enabled and checked.
checkedEndBackgroundColor The background color used at the end of the gradient of a ToggleChip when enabled and checked.
checkedContentColor The content color of a ToggleChip when enabled and checked.
checkedSecondaryContentColor The secondary content color of this ToggleChip when enabled and checked, used for secondaryLabel content
checkedToggleControlColor The toggle control color of this ToggleChip when enabled and checked, used for toggleControl content
uncheckedStartBackgroundColor The background color used at the start of the gradient of a ToggleChip when enabled and unchecked.
uncheckedEndBackgroundColor The background color used at the end of the gradient of a ToggleChip when enabled and unchecked.
uncheckedContentColor The content color of a ToggleChip when enabled and checked.
uncheckedSecondaryContentColor The secondary content color of this ToggleChip when enabled and unchecked, used for secondaryLabel content
uncheckedToggleControlColor The toggle control color of this ToggleChip when enabled and unchecked.
gradientDirection Whether the chips gradient should be start to end (indicated by LayoutDirection.Ltr) or end to start (indicated by LayoutDirection.Rtl).

splitToggleChipColors


splitToggleChipColors

Added in 1.7.0-alpha01

@Composable
public 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 The background color of this SplitToggleChip when enabled
contentColor The content color of this SplitToggleChip when enabled.
secondaryContentColor The secondary content color of thisSplitToggleChip when enabled
checkedToggleControlColor The toggle control content color of this SplitToggleChip when enabled.
uncheckedToggleControlColor The toggle control content color of this SplitToggleChip when enabled.
splitBackgroundOverlayColor 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


switchIcon

Added in 1.7.0-alpha01

public 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 whether the ToggleChip or SplitToggleChip is currently 'on' (checked/true) or 'off' (unchecked/false)

radioIcon


radioIcon

Added in 1.7.0-alpha01

public 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 whether the ToggleChip or SplitToggleChip is currently 'on' (checked/true) or 'off' (unchecked/false)

checkboxIcon


checkboxIcon

Added in 1.7.0-alpha01

public 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 whether the ToggleChip or SplitToggleChip is currently 'on' (checked/true) or 'off' (unchecked/false)

Last updated: