@ExperimentalTvMaterial3Api
object SuggestionChipDefaults
Contains the default values used by SuggestionChip.
Properties
val ContainerHeight = 36.dp
The height applied to a suggestion chip. Note that you can override it by applying Modifier.height directly on a chip.
val ContainerShape = RoundedCornerShape(8.dp)
The default Shape applied to a suggestion chip
Functions
shape
fun shape(
shape: Shape = ContainerShape,
focusedShape: Shape = shape,
pressedShape: Shape = shape,
disabledShape: Shape = shape,
focusedDisabledShape: Shape = disabledShape,
) =
ClickableChipShape(
shape = shape,
focusedShape = focusedShape,
pressedShape = pressedShape,
disabledShape = disabledShape,
focusedDisabledShape = focusedDisabledShape,
)
Creates a ClickableChipShape that represents the default container shapes used in a SuggestionChip
Parameters
| shape | the shape used when the Chip is enabled, and has no other Interactions |
| focusedShape | the shape used when the Chip is enabled and focused |
| pressedShape | the shape used when the Chip is enabled pressed |
| disabledShape | the shape used when the Chip is not enabled |
| focusedDisabledShape | the shape used when the Chip is not enabled and focused |
colors
@ReadOnlyComposable
@Composable
fun colors(
containerColor: Color = Color.Transparent,
contentColor: Color = MaterialTheme.colorScheme.onSurfaceVariant,
focusedContainerColor: Color = MaterialTheme.colorScheme.onSurface,
focusedContentColor: Color = MaterialTheme.colorScheme.inverseOnSurface,
pressedContainerColor: Color = MaterialTheme.colorScheme.onSurfaceVariant,
pressedContentColor: Color = MaterialTheme.colorScheme.surface,
disabledContainerColor: Color =
MaterialTheme.colorScheme.surfaceVariant.copy(alpha = DisabledBackgroundColorOpacity),
disabledContentColor: Color =
MaterialTheme.colorScheme.border.copy(alpha = DisabledContentColorOpacity),
) =
ClickableChipColors(
containerColor = containerColor,
contentColor = contentColor,
focusedContainerColor = focusedContainerColor,
focusedContentColor = focusedContentColor,
pressedContainerColor = pressedContainerColor,
pressedContentColor = pressedContentColor,
disabledContainerColor = disabledContainerColor,
disabledContentColor = disabledContentColor,
)
Creates a ClickableChipColors that represents the default container and content colors used in a SuggestionChip
Parameters
| containerColor | the container color of this Chip when enabled |
| contentColor | the content color of this Chip when enabled |
| focusedContainerColor | the container color of this Chip when enabled and focused |
| focusedContentColor | the content color of this Chip when enabled and focused |
| pressedContainerColor | the container color of this Chip when enabled and pressed |
| pressedContentColor | the content color of this Chip when enabled and pressed |
| disabledContainerColor | the container color of this Chip when not enabled |
| disabledContentColor | the content color of this Chip when not enabled |
scale
fun scale(
@FloatRange(from = 0.0) scale: Float = 1f,
@FloatRange(from = 0.0) focusedScale: Float = 1.1f,
@FloatRange(from = 0.0) pressedScale: Float = scale,
@FloatRange(from = 0.0) disabledScale: Float = scale,
@FloatRange(from = 0.0) focusedDisabledScale: Float = disabledScale,
) =
ClickableChipScale(
scale = scale,
focusedScale = focusedScale,
pressedScale = pressedScale,
disabledScale = disabledScale,
focusedDisabledScale = focusedDisabledScale,
)
Creates a ClickableChipScale that represents the default scaleFactors used in a SuggestionChip. scaleFactors are used to modify the size of a composable in different Interaction states e.g. 1f (original) in default state, 1.2f (scaled up) in focused state, 0.8f (scaled down) in pressed state, etc
Parameters
| scale | the scaleFactor to be used for this Chip when enabled |
| focusedScale | the scaleFactor to be used for this Chip when focused |
| pressedScale | the scaleFactor to be used for this Chip when pressed |
| disabledScale | the scaleFactor to be used for this Chip when disabled |
| focusedDisabledScale | the scaleFactor to be used for this Chip when disabled and focused |
border
@ReadOnlyComposable
@Composable
fun border(
border: Border =
Border(
border = BorderStroke(width = 1.dp, color = MaterialTheme.colorScheme.border),
shape = ContainerShape,
),
focusedBorder: Border = Border.None,
pressedBorder: Border = focusedBorder,
disabledBorder: Border =
Border(
border =
BorderStroke(width = 1.dp, color = MaterialTheme.colorScheme.surfaceVariant),
shape = ContainerShape,
),
focusedDisabledBorder: Border = border,
) =
ClickableChipBorder(
border = border,
focusedBorder = focusedBorder,
pressedBorder = pressedBorder,
disabledBorder = disabledBorder,
focusedDisabledBorder = focusedDisabledBorder,
)
Creates a ClickableChipBorder that represents the default Borders applied on a SuggestionChip in different Interaction states
Parameters
| border | the Border to be used for this Chip when enabled |
| focusedBorder | the Border to be used for this Chip when focused |
| pressedBorder | the Border to be used for this Chip when pressed |
| disabledBorder | the Border to be used for this Chip when disabled |
| focusedDisabledBorder | the Border to be used for this Chip when disabled and focused |
glow
fun glow(glow: Glow = Glow.None, focusedGlow: Glow = glow, pressedGlow: Glow = glow) =
ClickableChipGlow(glow = glow, focusedGlow = focusedGlow, pressedGlow = pressedGlow)
Creates a ClickableChipGlow that represents the default Glows used in a SuggestionChip
Parameters
| glow | the Glow behind this Button when enabled |
| focusedGlow | the Glow behind this Button when focused |
| pressedGlow | the Glow behind this Button when pressed |