ListItemDefaults

object ListItemDefaults


Contains the default values used by list items.

Summary

Public functions

ListItemBorder
@Composable
border(
    border: Border,
    focusedBorder: Border,
    pressedBorder: Border,
    selectedBorder: Border,
    disabledBorder: Border,
    focusedSelectedBorder: Border,
    focusedDisabledBorder: Border,
    pressedSelectedBorder: Border
)

Creates a ListItemBorder that represents the default Borders applied on a ListItem in different Interaction states

ListItemColors
@Composable
colors(
    containerColor: Color,
    contentColor: Color,
    focusedContainerColor: Color,
    focusedContentColor: Color,
    pressedContainerColor: Color,
    pressedContentColor: Color,
    selectedContainerColor: Color,
    selectedContentColor: Color,
    disabledContainerColor: Color,
    disabledContentColor: Color,
    focusedSelectedContainerColor: Color,
    focusedSelectedContentColor: Color,
    pressedSelectedContainerColor: Color,
    pressedSelectedContentColor: Color
)

Creates a ListItemColors that represents the default container & content colors used in a ListItem

ListItemGlow
glow(
    glow: Glow,
    focusedGlow: Glow,
    pressedGlow: Glow,
    selectedGlow: Glow,
    focusedSelectedGlow: Glow,
    pressedSelectedGlow: Glow
)

Creates a ListItemGlow that represents the default Glows used in a ListItem.

ListItemScale
scale(
    scale: @FloatRange(from = 0.0) Float,
    focusedScale: @FloatRange(from = 0.0) Float,
    pressedScale: @FloatRange(from = 0.0) Float,
    selectedScale: @FloatRange(from = 0.0) Float,
    disabledScale: @FloatRange(from = 0.0) Float,
    focusedSelectedScale: @FloatRange(from = 0.0) Float,
    focusedDisabledScale: @FloatRange(from = 0.0) Float,
    pressedSelectedScale: @FloatRange(from = 0.0) Float
)

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.

ListItemShape
@Composable
shape(
    shape: Shape,
    focusedShape: Shape,
    pressedShape: Shape,
    selectedShape: Shape,
    disabledShape: Shape,
    focusedSelectedShape: Shape,
    focusedDisabledShape: Shape,
    pressedSelectedShape: Shape
)

Creates a ListItemShape that represents the default container shapes used in a ListItem

Public properties

Dp

The default Icon size used by ListItem.

Dp

The Icon size used by DenseListItem.

Dp

The default elevation used by ListItem.

Public functions

border

Added in 1.0.0
@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 Border used when the ListItem is enabled

focusedBorder: Border = border

the Border used when the ListItem is enabled and focused

pressedBorder: Border = focusedBorder

the Border used when the ListItem is enabled and pressed

selectedBorder: Border = border

the Border used when the ListItem is enabled and selected

disabledBorder: Border = border

the Border used when the ListItem is not enabled

focusedSelectedBorder: Border = focusedBorder

the Border used when the ListItem is enabled, focused and selected

focusedDisabledBorder: Border = FocusedDisabledBorder

the Border used when the ListItem is not enabled and focused

pressedSelectedBorder: Border = border

the Border used when the ListItem is enabled, pressed and selected

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

Added in 1.0.0
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 Glow used when the ListItem is enabled, and has no other Interactions.

focusedGlow: Glow = glow

the Glow used when the ListItem is enabled and focused.

pressedGlow: Glow = glow

the Glow used when the ListItem is enabled and pressed.

selectedGlow: Glow = glow

the Glow used when the ListItem is enabled and selected.

focusedSelectedGlow: Glow = focusedGlow

the Glow used when the ListItem is enabled, focused and selected.

pressedSelectedGlow: Glow = glow

the Glow used when the ListItem is enabled, pressed and selected.

scale

Added in 1.0.0
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

Added in 1.0.0
@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

Public properties

IconSize

Added in 1.0.0
val IconSizeDp

The default Icon size used by ListItem.

IconSizeDense

Added in 1.0.0
val IconSizeDenseDp

The Icon size used by DenseListItem.

TonalElevation

Added in 1.0.0
val TonalElevationDp

The default elevation used by ListItem.