ChipDefaults
-
Cmn
@ExperimentalMaterialApi
object ChipDefaults
Contains the baseline values used by chips.
Summary
Constants |
||
|---|---|---|
const Float |
ContentOpacity = 0.87fThe color opacity used for chip's content color |
Cmn
|
const Float |
LeadingIconOpacity = 0.54fThe color opacity used for chip's leading icon color |
Cmn
|
const Float |
OutlinedBorderOpacity = 0.12fThe color opacity used for the outlined chip's border color |
Cmn
|
Public functions |
||
|---|---|---|
ChipColors |
@ComposableCreates a |
Cmn
|
SelectableChipColors |
@ComposableCreates a |
Cmn
|
ChipColors |
@ComposableCreates a |
Cmn
|
SelectableChipColors |
@ComposableCreates a |
Cmn
|
Public properties |
||
|---|---|---|
Dp |
The size of a chip's leading icon |
Cmn
|
Dp |
The min height applied for a chip. |
Cmn
|
Dp |
The outlined chip's border size |
Cmn
|
Dp |
The size of a standalone selected icon |
Cmn
|
BorderStroke |
The border used by all types of outlined chips |
Cmn
|
Constants
ContentOpacity
const val ContentOpacity = 0.87f: Float
The color opacity used for chip's content color
LeadingIconOpacity
const val LeadingIconOpacity = 0.54f: Float
The color opacity used for chip's leading icon color
OutlinedBorderOpacity
const val OutlinedBorderOpacity = 0.12f: Float
The color opacity used for the outlined chip's border color
Public functions
chipColors
@Composable
fun chipColors(
backgroundColor: Color = MaterialTheme.colors.onSurface .copy(alpha = SurfaceOverlayOpacity) .compositeOver(MaterialTheme.colors.surface),
contentColor: Color = MaterialTheme.colors.onSurface.copy(alpha = ContentOpacity),
leadingIconContentColor: Color = contentColor.copy(alpha = LeadingIconOpacity),
disabledBackgroundColor: Color = MaterialTheme.colors.onSurface .copy(alpha = ContentAlpha.disabled * SurfaceOverlayOpacity) .compositeOver(MaterialTheme.colors.surface),
disabledContentColor: Color = contentColor.copy(alpha = ContentAlpha.disabled * ContentOpacity),
disabledLeadingIconContentColor: Color = leadingIconContentColor.copy(alpha = ContentAlpha.disabled * LeadingIconOpacity)
): ChipColors
Creates a ChipColors that represents the default background and content colors used in a filled Chip.
| Parameters | |
|---|---|
backgroundColor: Color = MaterialTheme.colors.onSurface
.copy(alpha = SurfaceOverlayOpacity)
.compositeOver(MaterialTheme.colors.surface) |
the background color of this chip when enabled |
contentColor: Color = MaterialTheme.colors.onSurface.copy(alpha = ContentOpacity) |
the content color of this chip when enabled, there is a separate param for icon colors |
leadingIconContentColor: Color = contentColor.copy(alpha = LeadingIconOpacity) |
the color of this chip's start icon when enabled |
disabledBackgroundColor: Color = MaterialTheme.colors.onSurface
.copy(alpha = ContentAlpha.disabled * SurfaceOverlayOpacity)
.compositeOver(MaterialTheme.colors.surface) |
the background color of this chip when not enabled |
disabledContentColor: Color = contentColor.copy(alpha = ContentAlpha.disabled * ContentOpacity) |
the content color of this chip when not enabled |
disabledLeadingIconContentColor: Color = leadingIconContentColor.copy(alpha = ContentAlpha.disabled * LeadingIconOpacity) |
the color of this chip's start icon when not enabled |
filterChipColors
@Composable
fun filterChipColors(
backgroundColor: Color = MaterialTheme.colors.onSurface .copy(alpha = SurfaceOverlayOpacity) .compositeOver(MaterialTheme.colors.surface),
contentColor: Color = MaterialTheme.colors.onSurface.copy(alpha = ContentOpacity),
leadingIconColor: Color = contentColor.copy(LeadingIconOpacity),
disabledBackgroundColor: Color = MaterialTheme.colors.onSurface .copy(alpha = ContentAlpha.disabled * SurfaceOverlayOpacity) .compositeOver(MaterialTheme.colors.surface),
disabledContentColor: Color = contentColor.copy(alpha = ContentAlpha.disabled * ContentOpacity),
disabledLeadingIconColor: Color = leadingIconColor.copy(alpha = ContentAlpha.disabled * LeadingIconOpacity),
selectedBackgroundColor: Color = MaterialTheme.colors.onSurface .copy(alpha = SurfaceOverlayOpacity) .compositeOver(backgroundColor),
selectedContentColor: Color = MaterialTheme.colors.onSurface .copy(alpha = SelectedOverlayOpacity) .compositeOver(contentColor),
selectedLeadingIconColor: Color = MaterialTheme.colors.onSurface .copy(alpha = SelectedOverlayOpacity) .compositeOver(leadingIconColor)
): SelectableChipColors
Creates a SelectableChipColors that represents the default background and content colors used in a filled FilterChip.
| Parameters | |
|---|---|
backgroundColor: Color = MaterialTheme.colors.onSurface
.copy(alpha = SurfaceOverlayOpacity)
.compositeOver(MaterialTheme.colors.surface) |
the background color of this chip when enabled |
contentColor: Color = MaterialTheme.colors.onSurface.copy(alpha = ContentOpacity) |
the content color of this chip when enabled |
leadingIconColor: Color = contentColor.copy(LeadingIconOpacity) |
the color of this chip's start icon when enabled |
disabledBackgroundColor: Color = MaterialTheme.colors.onSurface
.copy(alpha = ContentAlpha.disabled * SurfaceOverlayOpacity)
.compositeOver(MaterialTheme.colors.surface) |
the background color of this chip when not enabled |
disabledContentColor: Color = contentColor.copy(alpha = ContentAlpha.disabled * ContentOpacity) |
the content color of this chip when not enabled |
disabledLeadingIconColor: Color = leadingIconColor.copy(alpha = ContentAlpha.disabled * LeadingIconOpacity) |
the color of this chip's start icon when not enabled |
selectedBackgroundColor: Color = MaterialTheme.colors.onSurface
.copy(alpha = SurfaceOverlayOpacity)
.compositeOver(backgroundColor) |
the background color of this chip when selected |
selectedContentColor: Color = MaterialTheme.colors.onSurface
.copy(alpha = SelectedOverlayOpacity)
.compositeOver(contentColor) |
the content color of this chip when selected |
selectedLeadingIconColor: Color = MaterialTheme.colors.onSurface
.copy(alpha = SelectedOverlayOpacity)
.compositeOver(leadingIconColor) |
the color of this chip's start icon when selected |
outlinedChipColors
@Composable
fun outlinedChipColors(
backgroundColor: Color = MaterialTheme.colors.surface,
contentColor: Color = MaterialTheme.colors.onSurface.copy(alpha = ContentOpacity),
leadingIconContentColor: Color = contentColor.copy(alpha = LeadingIconOpacity),
disabledBackgroundColor: Color = backgroundColor,
disabledContentColor: Color = contentColor.copy(alpha = ContentAlpha.disabled * ContentOpacity),
disabledLeadingIconContentColor: Color = leadingIconContentColor.copy(alpha = ContentAlpha.disabled * LeadingIconOpacity)
): ChipColors
Creates a ChipColors that represents the default background and content colors used in an outlined Chip.
leadingIconContentColor the color of this chip's start icon when enabled
| Parameters | |
|---|---|
backgroundColor: Color = MaterialTheme.colors.surface |
the background color of this chip when enabled |
contentColor: Color = MaterialTheme.colors.onSurface.copy(alpha = ContentOpacity) |
the content color of this chip when enabled, there is a separate param for icon colors |
leadingIconContentColor: Color = contentColor.copy(alpha = LeadingIconOpacity) |
the leading icon content color of this chip when enabled |
disabledBackgroundColor: Color = backgroundColor |
the background color of this chip when not enabled |
disabledContentColor: Color = contentColor.copy(alpha = ContentAlpha.disabled * ContentOpacity) |
the content color of this chip when not enabled |
disabledLeadingIconContentColor: Color = leadingIconContentColor.copy(alpha = ContentAlpha.disabled * LeadingIconOpacity) |
the color of this chip's start icon when not enabled |
outlinedFilterChipColors
@Composable
fun outlinedFilterChipColors(
backgroundColor: Color = MaterialTheme.colors.surface,
contentColor: Color = MaterialTheme.colors.onSurface.copy(ContentOpacity),
leadingIconColor: Color = contentColor.copy(LeadingIconOpacity),
disabledBackgroundColor: Color = backgroundColor,
disabledContentColor: Color = contentColor.copy(alpha = ContentAlpha.disabled * ContentOpacity),
disabledLeadingIconColor: Color = leadingIconColor.copy(alpha = ContentAlpha.disabled * LeadingIconOpacity),
selectedBackgroundColor: Color = MaterialTheme.colors.onSurface .copy(alpha = SelectedOverlayOpacity) .compositeOver(backgroundColor),
selectedContentColor: Color = MaterialTheme.colors.onSurface .copy(alpha = SelectedOverlayOpacity) .compositeOver(contentColor),
selectedLeadingIconColor: Color = MaterialTheme.colors.onSurface .copy(alpha = SelectedOverlayOpacity) .compositeOver(leadingIconColor)
): SelectableChipColors
Creates a ChipColors that represents the default background and content colors used in a selectable outlined FilterChip.
| Parameters | |
|---|---|
backgroundColor: Color = MaterialTheme.colors.surface |
the background color of this chip when enabled |
contentColor: Color = MaterialTheme.colors.onSurface.copy(ContentOpacity) |
the content color of this chip when enabled |
leadingIconColor: Color = contentColor.copy(LeadingIconOpacity) |
the color of this chip's start icon when enabled |
disabledBackgroundColor: Color = backgroundColor |
the background color of this chip when not enabled |
disabledContentColor: Color = contentColor.copy(alpha = ContentAlpha.disabled * ContentOpacity) |
the content color of this chip when not enabled |
disabledLeadingIconColor: Color = leadingIconColor.copy(alpha = ContentAlpha.disabled * LeadingIconOpacity) |
the color of this chip's start icon when not enabled |
selectedBackgroundColor: Color = MaterialTheme.colors.onSurface
.copy(alpha = SelectedOverlayOpacity)
.compositeOver(backgroundColor) |
the background color of this chip when selected |
selectedContentColor: Color = MaterialTheme.colors.onSurface
.copy(alpha = SelectedOverlayOpacity)
.compositeOver(contentColor) |
the content color of this chip when selected |
selectedLeadingIconColor: Color = MaterialTheme.colors.onSurface
.copy(alpha = SelectedOverlayOpacity)
.compositeOver(leadingIconColor) |
the color of this chip's start icon when selected |