DenseListItem
Functions summary
Unit |
@ComposableLists are continuous, vertical indexes of text or images. |
Functions
DenseListItem
@Composable
fun DenseListItem(
selected: Boolean,
onClick: () -> Unit,
headlineContent: @Composable () -> Unit,
modifier: Modifier = Modifier,
enabled: Boolean = true,
onLongClick: (() -> Unit)? = null,
overlineContent: (@Composable () -> Unit)? = null,
supportingContent: (@Composable () -> Unit)? = null,
leadingContent: (@Composable BoxScope.() -> Unit)? = null,
trailingContent: (@Composable () -> Unit)? = null,
tonalElevation: Dp = ListItemDefaults.TonalElevation,
shape: ListItemShape = ListItemDefaults.shape(),
colors: ListItemColors = ListItemDefaults.colors(),
scale: ListItemScale = ListItemDefaults.scale(),
border: ListItemBorder = ListItemDefaults.border(),
glow: ListItemGlow = ListItemDefaults.glow(),
interactionSource: MutableInteractionSource? = null
): Unit
Lists are continuous, vertical indexes of text or images.
DenseListItem is a smaller/denser version of the Material ListItem.
This component can be used to achieve the list item templates existing in the spec. One-line list items have a singular line of headline content. Two-line list items additionally have either supporting or overline content. Three-line list items have either both supporting and overline content, or extended (two-line) supporting text.
This ListItem handles click events, calling its onClick lambda. It also support selected state which can be toggled using the selected param.
| Parameters | |
|---|---|
selected: Boolean |
defines whether this ListItem is selected or not |
onClick: () -> Unit |
called when this ListItem is clicked |
headlineContent: @Composable () -> Unit |
the |
modifier: Modifier = Modifier |
|
enabled: Boolean = true |
controls the enabled state of this list item. When |
onLongClick: (() -> Unit)? = null |
called when this ListItem is long clicked (long-pressed). |
overlineContent: (@Composable () -> Unit)? = null |
the |
supportingContent: (@Composable () -> Unit)? = null |
the |
leadingContent: (@Composable BoxScope.() -> Unit)? = null |
the |
trailingContent: (@Composable () -> Unit)? = null |
the |
tonalElevation: Dp = ListItemDefaults.TonalElevation |
the tonal elevation of this list item |
shape: ListItemShape = ListItemDefaults.shape() |
|
colors: ListItemColors = ListItemDefaults.colors() |
|
scale: ListItemScale = ListItemDefaults.scale() |
|
border: ListItemBorder = ListItemDefaults.border() |
|
glow: ListItemGlow = ListItemDefaults.glow() |
|
interactionSource: MutableInteractionSource? = null |
an optional hoisted |