Object

SelectableChipDefaults

Contains the default values used by SelectableChips and SplitSelectableChips

Source set: Android

Added in 1.7.0-alpha01

public object SelectableChipDefaults

Contains the default values used by SelectableChips and SplitSelectableChips

Properties

ContentPadding

Source set: Android

Added in 1.7.0-alpha01

public val ContentPadding: PaddingValues

The default content padding used by SelectableChip and SplitSelectableChip

Height

Source set: Android

Added in 1.7.0-alpha01

public val Height: Dp

The default height applied for the SelectableChip or SplitSelectableChip. Note that you can override it by applying Modifier.heightIn directly on SelectableChip or SplitSelectableChip.

IconSize

Source set: Android

Added in 1.7.0-alpha01

public val IconSize: Dp

The default size of app icons or selection controls when used inside a SelectableChip or SplitSelectableChip.

Functions

selectableChipColors

Added in 1.7.0-alpha01

@Composable
public fun selectableChipColors(
    selectedStartBackgroundColor: Color =
        MaterialTheme.colors.surface
            .copy(alpha = 0f)
            .compositeOver(MaterialTheme.colors.surface),
    selectedEndBackgroundColor: Color =
        MaterialTheme.colors.primary
            .copy(alpha = 0.5f)
            .compositeOver(MaterialTheme.colors.surface),
    selectedContentColor: Color = MaterialTheme.colors.onSurface,
    selectedSecondaryContentColor: Color = MaterialTheme.colors.onSurfaceVariant,
    selectedSelectionControlColor: Color = MaterialTheme.colors.secondary,
    unselectedStartBackgroundColor: Color = MaterialTheme.colors.surface,
    unselectedEndBackgroundColor: Color = unselectedStartBackgroundColor,
    unselectedContentColor: Color = contentColorFor(selectedEndBackgroundColor),
    unselectedSecondaryContentColor: Color = unselectedContentColor,
    unselectedSelectionControlColor: Color = unselectedContentColor,
    gradientDirection: LayoutDirection = LocalLayoutDirection.current,
): SelectableChipColors

Creates a SelectableChipColors for use in a SelectableChip. SelectableChips are expected to have a linear gradient background when selected, similar to a ChipDefaults.gradientBackgroundChipColors and a solid neutral background when not selected (similar to a ChipDefaults.secondaryChipColors)

Parameters

selectedStartBackgroundColor The background color used at the start of the gradient of a SelectableChip when enabled and selected.
selectedEndBackgroundColor The background color used at the end of the gradient of a SelectableChip when enabled and selected.
selectedContentColor The content color of a SelectableChip when enabled and selected.
selectedSecondaryContentColor The secondary content color of this SelectableChip when enabled and selected, used for secondaryLabel content
selectedSelectionControlColor The selection control color of this SelectableChip when enabled and selected, used for selectionControl content
unselectedStartBackgroundColor The background color used at the start of the gradient of a SelectableChip when enabled and unselected.
unselectedEndBackgroundColor The background color used at the end of the gradient of a SelectableChip when enabled and unselected.
unselectedContentColor The content color of a SelectableChip when enabled and unselected.
unselectedSecondaryContentColor The secondary content color of this SelectableChip when enabled and unselected, used for secondaryLabel content
unselectedSelectionControlColor The selection control color of this SelectableChip when enabled and unselected.
gradientDirection Whether the chips gradient should be start to end (indicated by LayoutDirection.Ltr) or end to start (indicated by LayoutDirection.Rtl).

splitSelectableChipColors

Added in 1.7.0-alpha01

@Composable
public fun splitSelectableChipColors(
    backgroundColor: Color = MaterialTheme.colors.surface,
    contentColor: Color = MaterialTheme.colors.onSurface,
    secondaryContentColor: Color = MaterialTheme.colors.onSurfaceVariant,
    selectedSelectionControlColor: Color = MaterialTheme.colors.secondary,
    unselectedSelectionControlColor: Color = contentColor,
    splitBackgroundOverlayColor: Color = Color.White.copy(alpha = 0.05f),
): SplitSelectableChipColors

Creates a SplitSelectableChipColors for use in a SplitSelectableChip.

Parameters

backgroundColor The background color of this SplitSelectableChip when enabled
contentColor The content color of this SplitSelectableChip when enabled.
secondaryContentColor The secondary content color of thisSplitSelectableChip when enabled
selectedSelectionControlColor The selection control content color of this SplitSelectableChip when enabled.
unselectedSelectionControlColor The selection control content color of this SplitSelectableChip when enabled.
splitBackgroundOverlayColor The color to use to lighten/distinguish the background behind the selection control 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 selection control icon.