SelectableChipDefaults


object SelectableChipDefaults


Contains the default values used by SelectableChips and SplitSelectableChips

Summary

Public functions

SelectableChipColors
@Composable
selectableChipColors(
    selectedStartBackgroundColor: Color,
    selectedEndBackgroundColor: Color,
    selectedContentColor: Color,
    selectedSecondaryContentColor: Color,
    selectedSelectionControlColor: Color,
    unselectedStartBackgroundColor: Color,
    unselectedEndBackgroundColor: Color,
    unselectedContentColor: Color,
    unselectedSecondaryContentColor: Color,
    unselectedSelectionControlColor: Color,
    gradientDirection: LayoutDirection
)

Creates a SelectableChipColors for use in a SelectableChip.

SplitSelectableChipColors
@Composable
splitSelectableChipColors(
    backgroundColor: Color,
    contentColor: Color,
    secondaryContentColor: Color,
    selectedSelectionControlColor: Color,
    unselectedSelectionControlColor: Color,
    splitBackgroundOverlayColor: Color
)

Creates a SplitSelectableChipColors for use in a SplitSelectableChip.

Public properties

PaddingValues

The default content padding used by SelectableChip and SplitSelectableChip

Dp

The default height applied for the SelectableChip or SplitSelectableChip.

Dp

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

Public functions

selectableChipColors

@Composable
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: Color = MaterialTheme.colors.surface.copy(alpha = 0f) .compositeOver(MaterialTheme.colors.surface)

The background color used at the start of the gradient of a SelectableChip when enabled and selected.

selectedEndBackgroundColor: Color = MaterialTheme.colors.primary.copy(alpha = 0.5f) .compositeOver(MaterialTheme.colors.surface)

The background color used at the end of the gradient of a SelectableChip when enabled and selected.

selectedContentColor: Color = MaterialTheme.colors.onSurface

The content color of a SelectableChip when enabled and selected.

selectedSecondaryContentColor: Color = MaterialTheme.colors.onSurfaceVariant

The secondary content color of this SelectableChip when enabled and selected, used for secondaryLabel content

selectedSelectionControlColor: Color = MaterialTheme.colors.secondary

The selection control color of this SelectableChip when enabled and selected, used for selectionControl content

unselectedStartBackgroundColor: Color = MaterialTheme.colors.surface

The background color used at the start of the gradient of a SelectableChip when enabled and unselected.

unselectedEndBackgroundColor: Color = unselectedStartBackgroundColor

The background color used at the end of the gradient of a SelectableChip when enabled and unselected.

unselectedContentColor: Color = contentColorFor(selectedEndBackgroundColor)

The content color of a SelectableChip when enabled and unselected.

unselectedSecondaryContentColor: Color = unselectedContentColor

The secondary content color of this SelectableChip when enabled and unselected, used for secondaryLabel content

unselectedSelectionControlColor: Color = unselectedContentColor

The selection control color of this SelectableChip when enabled and unselected.

gradientDirection: LayoutDirection = LocalLayoutDirection.current

Whether the chips gradient should be start to end (indicated by LayoutDirection.Ltr) or end to start (indicated by LayoutDirection.Rtl).

splitSelectableChipColors

@Composable
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: Color = MaterialTheme.colors.surface

The background color of this SplitSelectableChip when enabled

contentColor: Color = MaterialTheme.colors.onSurface

The content color of this SplitSelectableChip when enabled.

secondaryContentColor: Color = MaterialTheme.colors.onSurfaceVariant

The secondary content color of thisSplitSelectableChip when enabled

selectedSelectionControlColor: Color = MaterialTheme.colors.secondary

The selection control content color of this SplitSelectableChip when enabled.

unselectedSelectionControlColor: Color = contentColor

The selection control content color of this SplitSelectableChip when enabled.

splitBackgroundOverlayColor: Color = Color.White.copy(alpha = 0.05f)

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.

Public properties

ContentPadding

Added in 1.4.0-alpha07
val ContentPaddingPaddingValues

The default content padding used by SelectableChip and SplitSelectableChip

Height

Added in 1.4.0-alpha07
val HeightDp

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

Added in 1.4.0-alpha07
val IconSizeDp

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