public object ScrollFieldDefaults
Object to hold defaults used by ScrollField.
Properties
ScrollFieldHeight
public val ScrollFieldHeight: Dp = 120.dp
The default height for a ScrollField. This can be used as a reference when providing a Modifier.height to the ScrollField. At this height the selected item is displayed with the items above and below it partially visible. A taller ScrollField displays more items.
shape
public val shape: Shape
The default shape for the ScrollField container background.
Functions
colors
@Composable
public fun colors(): ScrollFieldColors
Default colors used by a ScrollField.
colors
@Composable
public fun colors(
containerColor: Color = Color.Unspecified,
contentColor: Color = Color.Unspecified,
selectedContentColor: Color = Color.Unspecified,
disabledContainerColor: Color = Color.Unspecified,
disabledContentColor: Color = Color.Unspecified,
disabledSelectedContentColor: Color = Color.Unspecified,
): ScrollFieldColors
Creates a ScrollFieldColors that represents the default container, content, and selected colors used in a ScrollField.
Parameters
| containerColor | The color of the ScrollField container, when enabled. |
| contentColor | The color of the numerical value(s) visible on the screen that are not chosen, when enabled. |
| selectedContentColor | The color of the numerical value that is centered and snapped into place, when enabled. |
| disabledContainerColor | The color of the ScrollField container, when disabled. |
| disabledContentColor | The color of the numerical value(s) visible on the screen that are not chosen, when disabled. |
| disabledSelectedContentColor | The color of the numerical value that is centered and snapped into place, when disabled. |
Item
@Composable
public fun Item(
index: Int,
selected: Boolean,
enabled: Boolean = true,
colors: ScrollFieldColors = colors(),
)
The default item implementation for ScrollField.
Parameters
| index | the current item index. |
| selected | whether this item is currently selected (centered). |
| enabled | whether this item is currently enabled. |
| colors | the colors to use for the text content. |