ListItemDefaults
object ListItemDefaults
Contains the default values used by list items.
Summary
Public functions |
|
|---|---|
ListItemBorder |
@ComposableCreates a |
ListItemColors |
@ComposableCreates a |
ListItemGlow |
glow(Creates a |
ListItemScale |
scale(Creates a |
ListItemShape |
@ComposableCreates a |
Public properties |
|
|---|---|
Dp |
The default Icon size used by |
Dp |
The Icon size used by |
Dp |
The default elevation used by |
Public functions
border
@Composable
fun border(
border: Border = Border.None,
focusedBorder: Border = border,
pressedBorder: Border = focusedBorder,
selectedBorder: Border = border,
disabledBorder: Border = border,
focusedSelectedBorder: Border = focusedBorder,
focusedDisabledBorder: Border = FocusedDisabledBorder,
pressedSelectedBorder: Border = border
): ListItemBorder
Creates a ListItemBorder that represents the default Borders applied on a ListItem in different Interaction states
| Parameters | |
|---|---|
border: Border = Border.None |
the default |
focusedBorder: Border = border |
the |
pressedBorder: Border = focusedBorder |
the |
selectedBorder: Border = border |
the |
disabledBorder: Border = border |
the |
focusedSelectedBorder: Border = focusedBorder |
the |
focusedDisabledBorder: Border = FocusedDisabledBorder |
the |
pressedSelectedBorder: Border = border |
the |
colors
@Composable
fun colors(
containerColor: Color = Color.Transparent,
contentColor: Color = MaterialTheme.colorScheme.onSurface,
focusedContainerColor: Color = MaterialTheme.colorScheme.inverseSurface,
focusedContentColor: Color = contentColorFor(focusedContainerColor),
pressedContainerColor: Color = focusedContainerColor,
pressedContentColor: Color = contentColorFor(focusedContainerColor),
selectedContainerColor: Color = MaterialTheme.colorScheme.secondaryContainer.copy( alpha = SelectedContainerColorOpacity ),
selectedContentColor: Color = MaterialTheme.colorScheme.onSecondaryContainer,
disabledContainerColor: Color = Color.Transparent,
disabledContentColor: Color = MaterialTheme.colorScheme.onSurface,
focusedSelectedContainerColor: Color = focusedContainerColor,
focusedSelectedContentColor: Color = focusedContentColor,
pressedSelectedContainerColor: Color = pressedContainerColor,
pressedSelectedContentColor: Color = pressedContentColor
): ListItemColors
Creates a ListItemColors that represents the default container & content colors used in a ListItem
| Parameters | |
|---|---|
containerColor: Color = Color.Transparent |
the default container color used when the ListItem is enabled |
contentColor: Color = MaterialTheme.colorScheme.onSurface |
the default content color used when the ListItem is enabled |
focusedContainerColor: Color = MaterialTheme.colorScheme.inverseSurface |
the container color used when the ListItem is enabled and focused |
focusedContentColor: Color = contentColorFor(focusedContainerColor) |
the content color used when the ListItem is enabled and focused |
pressedContainerColor: Color = focusedContainerColor |
the container color used when the ListItem is enabled and pressed |
pressedContentColor: Color = contentColorFor(focusedContainerColor) |
the content color used when the ListItem is enabled and pressed |
selectedContainerColor: Color = MaterialTheme.colorScheme.secondaryContainer.copy(
alpha = SelectedContainerColorOpacity
) |
the container color used when the ListItem is enabled and selected |
selectedContentColor: Color = MaterialTheme.colorScheme.onSecondaryContainer |
the content color used when the ListItem is enabled and selected |
disabledContainerColor: Color = Color.Transparent |
the container color used when the ListItem is not enabled |
disabledContentColor: Color = MaterialTheme.colorScheme.onSurface |
the content color used when the ListItem is not enabled |
focusedSelectedContainerColor: Color = focusedContainerColor |
the container color used when the ListItem is enabled, focused and selected |
focusedSelectedContentColor: Color = focusedContentColor |
the content color used when the ListItem is enabled, focused and selected |
pressedSelectedContainerColor: Color = pressedContainerColor |
the container color used when the ListItem is enabled, pressed and selected |
pressedSelectedContentColor: Color = pressedContentColor |
the content color used when the ListItem 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
): ListItemGlow
Creates a ListItemGlow that represents the default Glows used in a ListItem.
| 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.05f,
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
): ListItemScale
Creates a ListItemScale that represents the default scales used in a ListItem. scales 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 scale used when the ListItem is enabled. |
focusedScale: @FloatRange(from = 0.0) Float = 1.05f |
the scale used when the ListItem is enabled and focused. |
pressedScale: @FloatRange(from = 0.0) Float = scale |
the scale used when the ListItem is enabled and pressed. |
selectedScale: @FloatRange(from = 0.0) Float = scale |
the scale used when the ListItem is enabled and selected. |
disabledScale: @FloatRange(from = 0.0) Float = scale |
the scale used when the ListItem is not enabled. |
focusedSelectedScale: @FloatRange(from = 0.0) Float = focusedScale |
the scale used when the ListItem is enabled, focused and selected. |
focusedDisabledScale: @FloatRange(from = 0.0) Float = disabledScale |
the scale used when the ListItem is not enabled and focused. |
pressedSelectedScale: @FloatRange(from = 0.0) Float = scale |
the scale used when the ListItem is enabled, pressed and selected. |
shape
@Composable
fun shape(
shape: Shape = ListItemShape,
focusedShape: Shape = shape,
pressedShape: Shape = shape,
selectedShape: Shape = shape,
disabledShape: Shape = shape,
focusedSelectedShape: Shape = shape,
focusedDisabledShape: Shape = disabledShape,
pressedSelectedShape: Shape = shape
): ListItemShape
Creates a ListItemShape that represents the default container shapes used in a ListItem
| Parameters | |
|---|---|
shape: Shape = ListItemShape |
the default shape used when the ListItem is enabled |
focusedShape: Shape = shape |
the shape used when the ListItem is enabled and focused |
pressedShape: Shape = shape |
the shape used when the ListItem is enabled and pressed |
selectedShape: Shape = shape |
the shape used when the ListItem is enabled and selected |
disabledShape: Shape = shape |
the shape used when the ListItem is not enabled |
focusedSelectedShape: Shape = shape |
the shape used when the ListItem is enabled, focused and selected |
focusedDisabledShape: Shape = disabledShape |
the shape used when the ListItem is not enabled and focused |
pressedSelectedShape: Shape = shape |
the shape used when the ListItem is enabled, pressed and selected |