Source set: Common
@ExperimentalMaterial3ExpressiveApi
object ScrollFieldDefaults
Object to hold defaults used by ScrollField.
Properties
ScrollFieldHeight
Source set: Common
val ScrollFieldHeight = 200.dp
The default height for a ScrollField. This can be used as a reference when providing a Modifier.height to the ScrollField to ensure enough vertical space is available to display the typical three-item layout.
shape
Source set: Common
val shape: Shape
The default shape for the ScrollField container background.
Functions
colors
@Composable fun colors(): ScrollFieldColors
Default colors used by a ScrollField.
colors
@Composable
fun colors(
containerColor: Color = Color.Unspecified,
unselectedContentColor: Color = Color.Unspecified,
selectedContentColor: Color = Color.Unspecified,
) =
MaterialTheme.colorScheme.defaultScrollFieldColors.copy(
containerColor = containerColor,
unselectedContentColor = unselectedContentColor,
selectedContentColor = selectedContentColor,
)
Creates a ScrollFieldColors that represents the default container, unselected, and selected colors used in a ScrollField.
Parameters
| containerColor | The color of the ScrollField container. |
| unselectedContentColor | The color of the numerical value(s) visible on the screen that are not chosen. |
| selectedContentColor | The color of the numerical value that is centered and snapped into place. |
Item
@Composable
fun Item(index: Int, selected: Boolean, colors: ScrollFieldColors = colors())
The default item implementation for ScrollField.
Parameters
| index | the current item index. |
| selected | whether this item is currently selected (centered). |
| colors | the colors to use for the text content. |