Common
@ExperimentalMaterialApi
object ExposedDropdownMenuDefaults
Contains default values used by Exposed Dropdown Menu.
Functions
TrailingIcon
@ExperimentalMaterialApi
@Composable
fun TrailingIcon(expanded: Boolean, onIconClick: () -> Unit = {})
Default trailing icon for Exposed Dropdown Menu.
Parameters
| expanded | Whether ExposedDropdownMenuBoxScope.ExposedDropdownMenu is expanded or not. Affects the appearance of the icon. |
| onIconClick | Called when the icon was clicked. |
textFieldColors
@Composable
fun textFieldColors(
textColor: Color = LocalContentColor.current.copy(LocalContentAlpha.current),
disabledTextColor: Color = textColor.copy(ContentAlpha.disabled),
backgroundColor: Color =
MaterialTheme.colors.onSurface.copy(alpha = TextFieldDefaults.BackgroundOpacity),
cursorColor: Color = MaterialTheme.colors.primary,
errorCursorColor: Color = MaterialTheme.colors.error,
focusedIndicatorColor: Color = MaterialTheme.colors.primary.copy(alpha = ContentAlpha.high),
unfocusedIndicatorColor: Color =
MaterialTheme.colors.onSurface.copy(
alpha = TextFieldDefaults.UnfocusedIndicatorLineOpacity
),
disabledIndicatorColor: Color = unfocusedIndicatorColor.copy(alpha = ContentAlpha.disabled),
errorIndicatorColor: Color = MaterialTheme.colors.error,
leadingIconColor: Color =
MaterialTheme.colors.onSurface.copy(alpha = TextFieldDefaults.IconOpacity),
disabledLeadingIconColor: Color = leadingIconColor.copy(alpha = ContentAlpha.disabled),
errorLeadingIconColor: Color = leadingIconColor,
trailingIconColor: Color =
MaterialTheme.colors.onSurface.copy(alpha = TextFieldDefaults.IconOpacity),
focusedTrailingIconColor: Color =
MaterialTheme.colors.primary.copy(alpha = ContentAlpha.high),
disabledTrailingIconColor: Color = trailingIconColor.copy(alpha = ContentAlpha.disabled),
errorTrailingIconColor: Color = MaterialTheme.colors.error,
focusedLabelColor: Color = MaterialTheme.colors.primary.copy(alpha = ContentAlpha.high),
unfocusedLabelColor: Color = MaterialTheme.colors.onSurface.copy(ContentAlpha.medium),
disabledLabelColor: Color = unfocusedLabelColor.copy(ContentAlpha.disabled),
errorLabelColor: Color = MaterialTheme.colors.error,
placeholderColor: Color = MaterialTheme.colors.onSurface.copy(ContentAlpha.medium),
disabledPlaceholderColor: Color = placeholderColor.copy(ContentAlpha.disabled),
): TextFieldColors
Creates a TextFieldColors that represents the default input text, background and content (including label, placeholder, leading and trailing icons) colors used in a TextField.
Parameters
| textColor | Represents the color used for the input text of this text field. |
| disabledTextColor | Represents the color used for the input text of this text field when it's disabled. |
| backgroundColor | Represents the background color for this text field. |
| cursorColor | Represents the cursor color for this text field. |
| errorCursorColor | Represents the cursor color for this text field when it's in error state. |
| focusedIndicatorColor | Represents the indicator color for this text field when it's focused. |
| unfocusedIndicatorColor | Represents the indicator color for this text field when it's not focused. |
| disabledIndicatorColor | Represents the indicator color for this text field when it's disabled. |
| errorIndicatorColor | Represents the indicator color for this text field when it's in error state. |
| leadingIconColor | Represents the leading icon color for this text field. |
| disabledLeadingIconColor | Represents the leading icon color for this text field when it's disabled. |
| errorLeadingIconColor | Represents the leading icon color for this text field when it's in error state. |
| trailingIconColor | Represents the trailing icon color for this text field. |
| focusedTrailingIconColor | Represents the trailing icon color for this text field when it's focused. |
| disabledTrailingIconColor | Represents the trailing icon color for this text field when it's disabled. |
| errorTrailingIconColor | Represents the trailing icon color for this text field when it's in error state. |
| focusedLabelColor | Represents the label color for this text field when it's focused. |
| unfocusedLabelColor | Represents the label color for this text field when it's not focused. |
| disabledLabelColor | Represents the label color for this text field when it's disabled. |
| errorLabelColor | Represents the label color for this text field when it's in error state. |
| placeholderColor | Represents the placeholder color for this text field. |
| disabledPlaceholderColor | Represents the placeholder color for this text field when it's disabled. |
outlinedTextFieldColors
@Composable
fun outlinedTextFieldColors(
textColor: Color = LocalContentColor.current.copy(LocalContentAlpha.current),
disabledTextColor: Color = textColor.copy(ContentAlpha.disabled),
backgroundColor: Color = Color.Transparent,
cursorColor: Color = MaterialTheme.colors.primary,
errorCursorColor: Color = MaterialTheme.colors.error,
focusedBorderColor: Color = MaterialTheme.colors.primary.copy(alpha = ContentAlpha.high),
unfocusedBorderColor: Color =
MaterialTheme.colors.onSurface.copy(alpha = ContentAlpha.disabled),
disabledBorderColor: Color = unfocusedBorderColor.copy(alpha = ContentAlpha.disabled),
errorBorderColor: Color = MaterialTheme.colors.error,
leadingIconColor: Color =
MaterialTheme.colors.onSurface.copy(alpha = TextFieldDefaults.IconOpacity),
disabledLeadingIconColor: Color = leadingIconColor.copy(alpha = ContentAlpha.disabled),
errorLeadingIconColor: Color = leadingIconColor,
trailingIconColor: Color =
MaterialTheme.colors.onSurface.copy(alpha = TextFieldDefaults.IconOpacity),
focusedTrailingIconColor: Color =
MaterialTheme.colors.primary.copy(alpha = ContentAlpha.high),
disabledTrailingIconColor: Color = trailingIconColor.copy(alpha = ContentAlpha.disabled),
errorTrailingIconColor: Color = MaterialTheme.colors.error,
focusedLabelColor: Color = MaterialTheme.colors.primary.copy(alpha = ContentAlpha.high),
unfocusedLabelColor: Color = MaterialTheme.colors.onSurface.copy(ContentAlpha.medium),
disabledLabelColor: Color = unfocusedLabelColor.copy(ContentAlpha.disabled),
errorLabelColor: Color = MaterialTheme.colors.error,
placeholderColor: Color = MaterialTheme.colors.onSurface.copy(ContentAlpha.medium),
disabledPlaceholderColor: Color = placeholderColor.copy(ContentAlpha.disabled),
): TextFieldColors
Creates a TextFieldColors that represents the default input text, background and content (including label, placeholder, leading and trailing icons) colors used in an OutlinedTextField.
Parameters
| textColor | Represents the color used for the input text of this text field. |
| disabledTextColor | Represents the color used for the input text of this text field when it's disabled. |
| backgroundColor | Represents the background color for this text field. |
| cursorColor | Represents the cursor color for this text field. |
| errorCursorColor | Represents the cursor color for this text field when it's in error state. |
| focusedBorderColor | Represents the border color for this text field when it's focused. |
| unfocusedBorderColor | Represents the border color for this text field when it's not focused. |
| disabledBorderColor | Represents the border color for this text field when it's disabled. |
| errorBorderColor | Represents the border color for this text field when it's in error state. |
| leadingIconColor | Represents the leading icon color for this text field. |
| disabledLeadingIconColor | Represents the leading icon color for this text field when it's disabled. |
| errorLeadingIconColor | Represents the leading icon color for this text field when it's in error state. |
| trailingIconColor | Represents the trailing icon color for this text field. |
| focusedTrailingIconColor | Represents the trailing icon color for this text field when it's focused. |
| disabledTrailingIconColor | Represents the trailing icon color for this text field when it's disabled. |
| errorTrailingIconColor | Represents the trailing icon color for this text field when it's in error state. |
| focusedLabelColor | Represents the label color for this text field when it's focused. |
| unfocusedLabelColor | Represents the label color for this text field when it's not focused. |
| disabledLabelColor | Represents the label color for this text field when it's disabled. |
| errorLabelColor | Represents the label color for this text field when it's in error state. |
| placeholderColor | Represents the placeholder color for this text field. |
| disabledPlaceholderColor | Represents the placeholder color for this text field when it's disabled. |