Android Studio Sign in

ListItemDefaults


Contains the default values used by list items.

Summary

Public functions

ListItemColors

Creates a ListItemColors that represents the default colors for a ListItem in different states.

Cmn
ListItemColors
@Composable
colors(
    containerColor: Color,
    headlineColor: Color,
    leadingIconColor: Color,
    overlineColor: Color,
    supportingColor: Color,
    trailingIconColor: Color,
    disabledHeadlineColor: Color,
    disabledLeadingIconColor: Color,
    disabledTrailingIconColor: Color
)

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

Cmn
ListItemColors
@Composable
colors(
    containerColor: Color,
    contentColor: Color,
    leadingContentColor: Color,
    trailingContentColor: Color,
    overlineContentColor: Color,
    supportingContentColor: Color,
    disabledContainerColor: Color,
    disabledContentColor: Color,
    disabledLeadingContentColor: Color,
    disabledTrailingContentColor: Color,
    disabledOverlineContentColor: Color,
    disabledSupportingContentColor: Color,
    selectedContainerColor: Color,
    selectedContentColor: Color,
    selectedLeadingContentColor: Color,
    selectedTrailingContentColor: Color,
    selectedOverlineContentColor: Color,
    selectedSupportingContentColor: Color,
    draggedContainerColor: Color,
    draggedContentColor: Color,
    draggedLeadingContentColor: Color,
    draggedTrailingContentColor: Color,
    draggedOverlineContentColor: Color,
    draggedSupportingContentColor: Color
)

Creates a ListItemColors that represents the default colors for a ListItem in different states.

Cmn
ListItemElevation
@ExperimentalMaterial3ExpressiveApi
elevation(elevation: Dp, draggedElevation: Dp)

Creates a ListItemElevation that represents the elevation for a ListItem in different states.

Cmn
ListItemColors

Creates a ListItemColors that represents the default colors for a SegmentedListItem in different states.

Cmn
ListItemColors
@ExperimentalMaterial3ExpressiveApi
@Composable
segmentedColors(
    containerColor: Color,
    contentColor: Color,
    leadingContentColor: Color,
    trailingContentColor: Color,
    overlineContentColor: Color,
    supportingContentColor: Color,
    disabledContainerColor: Color,
    disabledContentColor: Color,
    disabledLeadingContentColor: Color,
    disabledTrailingContentColor: Color,
    disabledOverlineContentColor: Color,
    disabledSupportingContentColor: Color,
    selectedContainerColor: Color,
    selectedContentColor: Color,
    selectedLeadingContentColor: Color,
    selectedTrailingContentColor: Color,
    selectedOverlineContentColor: Color,
    selectedSupportingContentColor: Color,
    draggedContainerColor: Color,
    draggedContentColor: Color,
    draggedLeadingContentColor: Color,
    draggedTrailingContentColor: Color,
    draggedOverlineContentColor: Color,
    draggedSupportingContentColor: Color
)

Creates a ListItemColors that represents the default colors for a SegmentedListItem in different states.

Cmn
ListItemShapes

Constructor for ListItemShapes to be used by a SegmentedListItem which has an index in a list that has a total of count items.

Cmn
ListItemShapes

Creates a ListItemShapes that represents the default shapes for a ListItem in different states.

Cmn
ListItemShapes
@ExperimentalMaterial3ExpressiveApi
@Composable
shapes(
    shape: Shape?,
    selectedShape: Shape?,
    pressedShape: Shape?,
    focusedShape: Shape?,
    hoveredShape: Shape?,
    draggedShape: Shape?
)

Creates a ListItemShapes that represents the default shapes for a ListItem in different states.

Cmn
Alignment.Vertical

Returns the default vertical alignment of children content within a ListItem.

Cmn

Public properties

PaddingValues

The default padding applied to all content within a list item.

Cmn
Dp

The default elevation of a list item

Cmn
Dp

The vertical space between different SegmentedListItems.

Cmn
Color

The container color of a list item

Cmn
Color

The content color of a list item

Cmn
Shape

The default shape of a list item

Cmn

Public functions

colors

@Composable
fun colors(): ListItemColors

Creates a ListItemColors that represents the default colors for a ListItem in different states.

colors

@Composable
fun colors(
    containerColor: Color = Color.Unspecified,
    headlineColor: Color = Color.Unspecified,
    leadingIconColor: Color = Color.Unspecified,
    overlineColor: Color = Color.Unspecified,
    supportingColor: Color = Color.Unspecified,
    trailingIconColor: Color = Color.Unspecified,
    disabledHeadlineColor: Color = Color.Unspecified,
    disabledLeadingIconColor: Color = Color.Unspecified,
    disabledTrailingIconColor: Color = Color.Unspecified
): ListItemColors

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

Parameters
containerColor: Color = Color.Unspecified

the container color of this list item when enabled.

headlineColor: Color = Color.Unspecified

the headline text content color of this list item when enabled.

leadingIconColor: Color = Color.Unspecified

the color of this list item's leading content when enabled.

overlineColor: Color = Color.Unspecified

the overline text color of this list item

supportingColor: Color = Color.Unspecified

the supporting text color of this list item

trailingIconColor: Color = Color.Unspecified

the color of this list item's trailing content when enabled.

disabledHeadlineColor: Color = Color.Unspecified

the content color of this list item when not enabled.

disabledLeadingIconColor: Color = Color.Unspecified

the color of this list item's leading content when not enabled.

disabledTrailingIconColor: Color = Color.Unspecified

the color of this list item's trailing content when not enabled.

colors

@Composable
fun colors(
    containerColor: Color = Color.Unspecified,
    contentColor: Color = Color.Unspecified,
    leadingContentColor: Color = Color.Unspecified,
    trailingContentColor: Color = Color.Unspecified,
    overlineContentColor: Color = Color.Unspecified,
    supportingContentColor: Color = Color.Unspecified,
    disabledContainerColor: Color = Color.Unspecified,
    disabledContentColor: Color = Color.Unspecified,
    disabledLeadingContentColor: Color = Color.Unspecified,
    disabledTrailingContentColor: Color = Color.Unspecified,
    disabledOverlineContentColor: Color = Color.Unspecified,
    disabledSupportingContentColor: Color = Color.Unspecified,
    selectedContainerColor: Color = Color.Unspecified,
    selectedContentColor: Color = Color.Unspecified,
    selectedLeadingContentColor: Color = Color.Unspecified,
    selectedTrailingContentColor: Color = Color.Unspecified,
    selectedOverlineContentColor: Color = Color.Unspecified,
    selectedSupportingContentColor: Color = Color.Unspecified,
    draggedContainerColor: Color = Color.Unspecified,
    draggedContentColor: Color = Color.Unspecified,
    draggedLeadingContentColor: Color = Color.Unspecified,
    draggedTrailingContentColor: Color = Color.Unspecified,
    draggedOverlineContentColor: Color = Color.Unspecified,
    draggedSupportingContentColor: Color = Color.Unspecified
): ListItemColors

Creates a ListItemColors that represents the default colors for a ListItem in different states.

Parameters
containerColor: Color = Color.Unspecified

the container color of the list item.

contentColor: Color = Color.Unspecified

the content color of the list item.

leadingContentColor: Color = Color.Unspecified

the leading content color of the list item.

trailingContentColor: Color = Color.Unspecified

the trailing content color of the list item.

overlineContentColor: Color = Color.Unspecified

the overline content color of the list item.

supportingContentColor: Color = Color.Unspecified

the supporting content color of the list item.

disabledContainerColor: Color = Color.Unspecified

the container color of the list item when disabled.

disabledContentColor: Color = Color.Unspecified

the content color of the list item when disabled.

disabledLeadingContentColor: Color = Color.Unspecified

the leading content color of the list item when disabled.

disabledTrailingContentColor: Color = Color.Unspecified

the trailing content color of the list item when disabled.

disabledOverlineContentColor: Color = Color.Unspecified

the overline content color of the list item when disabled.

disabledSupportingContentColor: Color = Color.Unspecified

the supporting content color of the list item when disabled.

selectedContainerColor: Color = Color.Unspecified

the container color of the list item when selected.

selectedContentColor: Color = Color.Unspecified

the content color of the list item when selected.

selectedLeadingContentColor: Color = Color.Unspecified

the leading content color of the list item when selected.

selectedTrailingContentColor: Color = Color.Unspecified

the trailing content color of the list item when selected.

selectedOverlineContentColor: Color = Color.Unspecified

the overline content color of the list item when selected.

selectedSupportingContentColor: Color = Color.Unspecified

the supporting content color of the list item when selected.

draggedContainerColor: Color = Color.Unspecified

the container color of the list item when dragged.

draggedContentColor: Color = Color.Unspecified

the content color of the list item when dragged.

draggedLeadingContentColor: Color = Color.Unspecified

the leading content color of the list item when dragged.

draggedTrailingContentColor: Color = Color.Unspecified

the trailing content color of the list item when dragged.

draggedOverlineContentColor: Color = Color.Unspecified

the overline content color of the list item when dragged.

draggedSupportingContentColor: Color = Color.Unspecified

the supporting content color of the list item when dragged.

elevation

@ExperimentalMaterial3ExpressiveApi
fun elevation(
    elevation: Dp = ListTokens.ItemContainerElevation,
    draggedElevation: Dp = ListTokens.ItemDraggedContainerElevation
): ListItemElevation

Creates a ListItemElevation that represents the elevation for a ListItem in different states.

Parameters
elevation: Dp = ListTokens.ItemContainerElevation

the default elevation of the list item.

draggedElevation: Dp = ListTokens.ItemDraggedContainerElevation

the elevation of the list item when dragged.

segmentedColors

@ExperimentalMaterial3ExpressiveApi
@Composable
fun segmentedColors(): ListItemColors

Creates a ListItemColors that represents the default colors for a SegmentedListItem in different states.

segmentedColors

@ExperimentalMaterial3ExpressiveApi
@Composable
fun segmentedColors(
    containerColor: Color = Color.Unspecified,
    contentColor: Color = Color.Unspecified,
    leadingContentColor: Color = Color.Unspecified,
    trailingContentColor: Color = Color.Unspecified,
    overlineContentColor: Color = Color.Unspecified,
    supportingContentColor: Color = Color.Unspecified,
    disabledContainerColor: Color = Color.Unspecified,
    disabledContentColor: Color = Color.Unspecified,
    disabledLeadingContentColor: Color = Color.Unspecified,
    disabledTrailingContentColor: Color = Color.Unspecified,
    disabledOverlineContentColor: Color = Color.Unspecified,
    disabledSupportingContentColor: Color = Color.Unspecified,
    selectedContainerColor: Color = Color.Unspecified,
    selectedContentColor: Color = Color.Unspecified,
    selectedLeadingContentColor: Color = Color.Unspecified,
    selectedTrailingContentColor: Color = Color.Unspecified,
    selectedOverlineContentColor: Color = Color.Unspecified,
    selectedSupportingContentColor: Color = Color.Unspecified,
    draggedContainerColor: Color = Color.Unspecified,
    draggedContentColor: Color = Color.Unspecified,
    draggedLeadingContentColor: Color = Color.Unspecified,
    draggedTrailingContentColor: Color = Color.Unspecified,
    draggedOverlineContentColor: Color = Color.Unspecified,
    draggedSupportingContentColor: Color = Color.Unspecified
): ListItemColors

Creates a ListItemColors that represents the default colors for a SegmentedListItem in different states.

Parameters
containerColor: Color = Color.Unspecified

the container color of the list item.

contentColor: Color = Color.Unspecified

the content color of the list item.

leadingContentColor: Color = Color.Unspecified

the leading content color of the list item.

trailingContentColor: Color = Color.Unspecified

the trailing content color of the list item.

overlineContentColor: Color = Color.Unspecified

the overline content color of the list item.

supportingContentColor: Color = Color.Unspecified

the supporting content color of the list item.

disabledContainerColor: Color = Color.Unspecified

the container color of the list item when disabled.

disabledContentColor: Color = Color.Unspecified

the content color of the list item when disabled.

disabledLeadingContentColor: Color = Color.Unspecified

the leading content color of the list item when disabled.

disabledTrailingContentColor: Color = Color.Unspecified

the trailing content color of the list item when disabled.

disabledOverlineContentColor: Color = Color.Unspecified

the overline content color of the list item when disabled.

disabledSupportingContentColor: Color = Color.Unspecified

the supporting content color of the list item when disabled.

selectedContainerColor: Color = Color.Unspecified

the container color of the list item when selected.

selectedContentColor: Color = Color.Unspecified

the content color of the list item when selected.

selectedLeadingContentColor: Color = Color.Unspecified

the leading content color of the list item when selected.

selectedTrailingContentColor: Color = Color.Unspecified

the trailing content color of the list item when selected.

selectedOverlineContentColor: Color = Color.Unspecified

the overline content color of the list item when selected.

selectedSupportingContentColor: Color = Color.Unspecified

the supporting content color of the list item when selected.

draggedContainerColor: Color = Color.Unspecified

the container color of the list item when dragged.

draggedContentColor: Color = Color.Unspecified

the content color of the list item when dragged.

draggedLeadingContentColor: Color = Color.Unspecified

the leading content color of the list item when dragged.

draggedTrailingContentColor: Color = Color.Unspecified

the trailing content color of the list item when dragged.

draggedOverlineContentColor: Color = Color.Unspecified

the overline content color of the list item when dragged.

draggedSupportingContentColor: Color = Color.Unspecified

the supporting content color of the list item when dragged.

segmentedShapes

@ExperimentalMaterial3ExpressiveApi
@Composable
fun segmentedShapes(
    index: Int,
    count: Int,
    defaultShapes: ListItemShapes = shapes()
): ListItemShapes

Constructor for ListItemShapes to be used by a SegmentedListItem which has an index in a list that has a total of count items.

Parameters
index: Int

the index for this list item in the overall list.

count: Int

the total count of list items in the overall list.

defaultShapes: ListItemShapes = shapes()

the default ListItemShapes that should be used for standalone items or items in the middle of the list.

shapes

@ExperimentalMaterial3ExpressiveApi
@Composable
fun shapes(): ListItemShapes

Creates a ListItemShapes that represents the default shapes for a ListItem in different states.

shapes

@ExperimentalMaterial3ExpressiveApi
@Composable
fun shapes(
    shape: Shape? = null,
    selectedShape: Shape? = null,
    pressedShape: Shape? = null,
    focusedShape: Shape? = null,
    hoveredShape: Shape? = null,
    draggedShape: Shape? = null
): ListItemShapes

Creates a ListItemShapes that represents the default shapes for a ListItem in different states.

Parameters
shape: Shape? = null

the default shape of the list item.

selectedShape: Shape? = null

the shape of the list item when selected.

pressedShape: Shape? = null

the shape of the list item when pressed.

focusedShape: Shape? = null

the shape of the list item when focused.

hoveredShape: Shape? = null

the shape of the list item when hovered.

draggedShape: Shape? = null

the shape of the list item when dragged.

verticalAlignment

@ExperimentalMaterial3ExpressiveApi
@Composable
fun verticalAlignment(): Alignment.Vertical

Returns the default vertical alignment of children content within a ListItem. This is equivalent to Alignment.CenterVertically for shorter items and Alignment.Top for taller items.

Public properties

ContentPadding

val ContentPaddingPaddingValues

The default padding applied to all content within a list item.

Elevation

val ElevationDp

The default elevation of a list item

SegmentedGap

@ExperimentalMaterial3ExpressiveApi
val SegmentedGapDp

The vertical space between different SegmentedListItems.

containerColor

val containerColorColor

The container color of a list item

contentColor

val contentColorColor

The content color of a list item

shape

val shapeShape

The default shape of a list item

Morty Proxy This is a proxified and sanitized view of the page, visit original site.