InputChipDefaults
@ExperimentalTvMaterial3Api
object InputChipDefaults
Contains the default values used by InputChip.
Summary
Public functions |
|
|---|---|
SelectableChipBorder |
@ComposableCreates a |
SelectableChipColors |
@ComposableCreates a |
SelectableChipGlow |
glow(Creates a |
SelectableChipScale |
scale(Creates a |
SelectableChipShape |
shape(Creates a |
Public properties |
|
|---|---|
Dp |
The size of an Input chip avatar |
Dp |
The height applied for an input chip. |
RoundedCornerShape |
The default |
RoundedCornerShape |
The default |
Dp |
The size of an Input chip icon |
Public functions
border
@Composable
fun border(
hasAvatar: Boolean,
border: Border = Border( border = BorderStroke(width = 1.dp, color = MaterialTheme.colorScheme.border), shape = if (hasAvatar) ContainerShapeWithAvatar else ContainerShape ),
focusedBorder: Border = Border.None,
pressedBorder: Border = focusedBorder,
selectedBorder: Border = Border( border = BorderStroke(width = 1.dp, color = MaterialTheme.colorScheme.secondary), shape = if (hasAvatar) ContainerShapeWithAvatar else ContainerShape ),
disabledBorder: Border = Border( border = BorderStroke(width = 1.dp, color = MaterialTheme.colorScheme.surfaceVariant), shape = if (hasAvatar) ContainerShapeWithAvatar else ContainerShape ),
focusedSelectedBorder: Border = Border( border = BorderStroke( width = 1.1.dp, color = MaterialTheme.colorScheme.onPrimaryContainer ), shape = if (hasAvatar) ContainerShapeWithAvatar else ContainerShape ),
focusedDisabledBorder: Border = border,
pressedSelectedBorder: Border = Border.None,
selectedDisabledBorder: Border = Border.None,
focusedSelectedDisabledBorder: Border = border
): SelectableChipBorder
Creates a SelectableChipBorder that represents the default Borders applied on an InputChip in different Interaction states
| Parameters | |
|---|---|
hasAvatar: Boolean |
changes the default border shape based on whether the avatar composable is not null in the Chip |
border: Border = Border(
border = BorderStroke(width = 1.dp, color = MaterialTheme.colorScheme.border),
shape = if (hasAvatar) ContainerShapeWithAvatar else ContainerShape
) |
the |
focusedBorder: Border = Border.None |
the |
pressedBorder: Border = focusedBorder |
the |
selectedBorder: Border = Border(
border = BorderStroke(width = 1.dp, color = MaterialTheme.colorScheme.secondary),
shape = if (hasAvatar) ContainerShapeWithAvatar else ContainerShape
) |
the |
disabledBorder: Border = Border(
border =
BorderStroke(width = 1.dp, color = MaterialTheme.colorScheme.surfaceVariant),
shape = if (hasAvatar) ContainerShapeWithAvatar else ContainerShape
) |
the |
focusedSelectedBorder: Border = Border(
border =
BorderStroke(
width = 1.1.dp,
color = MaterialTheme.colorScheme.onPrimaryContainer
),
shape = if (hasAvatar) ContainerShapeWithAvatar else ContainerShape
) |
the |
focusedDisabledBorder: Border = border |
the |
pressedSelectedBorder: Border = Border.None |
the |
selectedDisabledBorder: Border = Border.None |
the |
focusedSelectedDisabledBorder: Border = border |
the |
colors
@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,
selectedContainerColor: Color = MaterialTheme.colorScheme.secondaryContainer.copy( alpha = SelectedBackgroundColorOpacity ),
selectedContentColor: Color = MaterialTheme.colorScheme.onSecondaryContainer,
disabledContainerColor: Color = MaterialTheme.colorScheme.surfaceVariant.copy(alpha = DisabledBackgroundColorOpacity),
disabledContentColor: Color = MaterialTheme.colorScheme.border.copy(alpha = DisabledContentColorOpacity),
focusedSelectedContainerColor: Color = MaterialTheme.colorScheme.onPrimaryContainer,
focusedSelectedContentColor: Color = MaterialTheme.colorScheme.onPrimary,
pressedSelectedContainerColor: Color = MaterialTheme.colorScheme.secondary,
pressedSelectedContentColor: Color = MaterialTheme.colorScheme.onSecondary
): SelectableChipColors
Creates a SelectableChipColors that represents the default container and content colors used in an InputChip
| Parameters | |
|---|---|
containerColor: Color = Color.Transparent |
the container color used when the Chip is enabled, and has no other |
contentColor: Color = MaterialTheme.colorScheme.onSurfaceVariant |
the content color used when the Chip is enabled, and has no other |
focusedContainerColor: Color = MaterialTheme.colorScheme.onSurface |
the container color used when the Chip is enabled and focused |
focusedContentColor: Color = MaterialTheme.colorScheme.inverseOnSurface |
the content color used when the Chip is enabled and focused |
pressedContainerColor: Color = MaterialTheme.colorScheme.onSurfaceVariant |
the container color used when the Chip is enabled and pressed |
pressedContentColor: Color = MaterialTheme.colorScheme.surface |
the content color used when the Chip is enabled and pressed |
selectedContainerColor: Color = MaterialTheme.colorScheme.secondaryContainer.copy(
alpha = SelectedBackgroundColorOpacity
) |
the container color used when the Chip is enabled and selected |
selectedContentColor: Color = MaterialTheme.colorScheme.onSecondaryContainer |
the content color used when the Chip is enabled and selected |
disabledContainerColor: Color = MaterialTheme.colorScheme.surfaceVariant.copy(alpha = DisabledBackgroundColorOpacity) |
the container color used when the Chip is not enabled |
disabledContentColor: Color = MaterialTheme.colorScheme.border.copy(alpha = DisabledContentColorOpacity) |
the content color used when the Chip is not enabled |
focusedSelectedContainerColor: Color = MaterialTheme.colorScheme.onPrimaryContainer |
the container color used when the Chip is enabled, focused and selected |
focusedSelectedContentColor: Color = MaterialTheme.colorScheme.onPrimary |
the content color used when the Chip is enabled, focused and selected |
pressedSelectedContainerColor: Color = MaterialTheme.colorScheme.secondary |
the container color used when the Chip is enabled, pressed and selected |
pressedSelectedContentColor: Color = MaterialTheme.colorScheme.onSecondary |
the content color used when the Chip is enabled, pressed and selected |
glow
fun glow(
glow: Glow = Glow.None,
focusedGlow: Glow = glow,
pressedGlow: Glow = glow,
selectedGlow: Glow = glow,
focusedSelectedGlow: Glow = focusedGlow,
pressedSelectedGlow: Glow = glow
): SelectableChipGlow
Creates a SelectableChipGlow that represents the default Glows used in an InputChip
| Parameters | |
|---|---|
glow: Glow = Glow.None |
the |
focusedGlow: Glow = glow |
the |
pressedGlow: Glow = glow |
the |
selectedGlow: Glow = glow |
the |
focusedSelectedGlow: Glow = focusedGlow |
the |
pressedSelectedGlow: Glow = glow |
the |
scale
fun scale(
scale: @FloatRange(from = 0.0) Float = 1.0f,
focusedScale: @FloatRange(from = 0.0) Float = 1.1f,
pressedScale: @FloatRange(from = 0.0) Float = scale,
selectedScale: @FloatRange(from = 0.0) Float = scale,
disabledScale: @FloatRange(from = 0.0) Float = scale,
focusedSelectedScale: @FloatRange(from = 0.0) Float = focusedScale,
focusedDisabledScale: @FloatRange(from = 0.0) Float = disabledScale,
pressedSelectedScale: @FloatRange(from = 0.0) Float = scale,
selectedDisabledScale: @FloatRange(from = 0.0) Float = disabledScale,
focusedSelectedDisabledScale: @FloatRange(from = 0.0) Float = disabledScale
): SelectableChipScale
Creates a SelectableChipScale that represents the default scaleFactors used in an InputChip. 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: @FloatRange(from = 0.0) Float = 1.0f |
the scaleFactor used when the Chip is enabled, and has no other |
focusedScale: @FloatRange(from = 0.0) Float = 1.1f |
the scaleFactor used when the Chip is enabled and focused |
pressedScale: @FloatRange(from = 0.0) Float = scale |
the scaleFactor used when the Chip is enabled and pressed |
selectedScale: @FloatRange(from = 0.0) Float = scale |
the scaleFactor used when the Chip is enabled and selected |
disabledScale: @FloatRange(from = 0.0) Float = scale |
the scaleFactor used when the Chip is not enabled |
focusedSelectedScale: @FloatRange(from = 0.0) Float = focusedScale |
the scaleFactor used when the Chip is enabled, focused and selected |
focusedDisabledScale: @FloatRange(from = 0.0) Float = disabledScale |
the scaleFactor used when the Chip is not enabled and focused |
pressedSelectedScale: @FloatRange(from = 0.0) Float = scale |
the scaleFactor used when the Chip is enabled, pressed and selected |
selectedDisabledScale: @FloatRange(from = 0.0) Float = disabledScale |
the scaleFactor used when the Chip is not enabled and selected |
focusedSelectedDisabledScale: @FloatRange(from = 0.0) Float = disabledScale |
the scaleFactor used when the Chip is not enabled, focused and selected |
shape
fun shape(
hasAvatar: Boolean,
shape: Shape = if (hasAvatar) ContainerShapeWithAvatar else ContainerShape,
focusedShape: Shape = shape,
pressedShape: Shape = shape,
selectedShape: Shape = shape,
disabledShape: Shape = shape,
focusedSelectedShape: Shape = shape,
focusedDisabledShape: Shape = disabledShape,
pressedSelectedShape: Shape = shape,
selectedDisabledShape: Shape = disabledShape,
focusedSelectedDisabledShape: Shape = disabledShape
): SelectableChipShape
Creates a SelectableChipShape that represents the default container shapes used in an InputChip
| Parameters | |
|---|---|
hasAvatar: Boolean |
changes the default shape based on whether the avatar composable is not null in the Chip |
shape: Shape = if (hasAvatar) ContainerShapeWithAvatar else ContainerShape |
the shape used when the Chip is enabled, and has no other |
focusedShape: Shape = shape |
the shape used when the Chip is enabled and focused |
pressedShape: Shape = shape |
the shape used when the Chip is enabled and pressed |
selectedShape: Shape = shape |
the shape used when the Chip is enabled and selected |
disabledShape: Shape = shape |
the shape used when the Chip is not enabled |
focusedSelectedShape: Shape = shape |
the shape used when the Chip is enabled, focused and selected |
focusedDisabledShape: Shape = disabledShape |
the shape used when the Chip is not enabled and focused |
pressedSelectedShape: Shape = shape |
the shape used when the Chip is enabled, pressed and selected |
selectedDisabledShape: Shape = disabledShape |
the shape used when the Chip is not enabled and selected |
focusedSelectedDisabledShape: Shape = disabledShape |
the shape used when the Chip is not enabled, focused and selected |
Public properties
ContainerHeight
val ContainerHeight: Dp
The height applied for an input chip. Note that you can override it by applying Modifier.height directly on a chip.
ContainerShape
val ContainerShape: RoundedCornerShape
The default Shape applied to an input chip
ContainerShapeWithAvatar
val ContainerShapeWithAvatar: RoundedCornerShape
The default Shape applied to an input chip with avatar