ExposedDropdownMenuDefaults


Contains default values used by Exposed Dropdown Menu.

Summary

Public functions

Unit
@ExperimentalMaterialApi
@Composable
TrailingIcon(expanded: Boolean, onIconClick: () -> Unit)

Default trailing icon for Exposed Dropdown Menu.

android
TextFieldColors
@Composable
outlinedTextFieldColors(
    textColor: Color,
    disabledTextColor: Color,
    backgroundColor: Color,
    cursorColor: Color,
    errorCursorColor: Color,
    focusedBorderColor: Color,
    unfocusedBorderColor: Color,
    disabledBorderColor: Color,
    errorBorderColor: Color,
    leadingIconColor: Color,
    disabledLeadingIconColor: Color,
    errorLeadingIconColor: Color,
    trailingIconColor: Color,
    focusedTrailingIconColor: Color,
    disabledTrailingIconColor: Color,
    errorTrailingIconColor: Color,
    focusedLabelColor: Color,
    unfocusedLabelColor: Color,
    disabledLabelColor: Color,
    errorLabelColor: Color,
    placeholderColor: Color,
    disabledPlaceholderColor: Color
)

Creates a TextFieldColors that represents the default input text, background and content (including label, placeholder, leading and trailing icons) colors used in an OutlinedTextField.

android
TextFieldColors
@Composable
textFieldColors(
    textColor: Color,
    disabledTextColor: Color,
    backgroundColor: Color,
    cursorColor: Color,
    errorCursorColor: Color,
    focusedIndicatorColor: Color,
    unfocusedIndicatorColor: Color,
    disabledIndicatorColor: Color,
    errorIndicatorColor: Color,
    leadingIconColor: Color,
    disabledLeadingIconColor: Color,
    errorLeadingIconColor: Color,
    trailingIconColor: Color,
    focusedTrailingIconColor: Color,
    disabledTrailingIconColor: Color,
    errorTrailingIconColor: Color,
    focusedLabelColor: Color,
    unfocusedLabelColor: Color,
    disabledLabelColor: Color,
    errorLabelColor: Color,
    placeholderColor: Color,
    disabledPlaceholderColor: Color
)

Creates a TextFieldColors that represents the default input text, background and content (including label, placeholder, leading and trailing icons) colors used in a TextField.

android

Public functions

TrailingIcon

@ExperimentalMaterialApi
@Composable
fun TrailingIcon(expanded: Boolean, onIconClick: () -> Unit = {}): Unit

Default trailing icon for Exposed Dropdown Menu.

Parameters
expanded: Boolean

Whether ExposedDropdownMenuBoxScope.ExposedDropdownMenu is expanded or not. Affects the appearance of the icon.

onIconClick: () -> Unit = {}

Called when the icon was clicked.

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: Color = LocalContentColor.current.copy(LocalContentAlpha.current)

Represents the color used for the input text of this text field.

disabledTextColor: Color = textColor.copy(ContentAlpha.disabled)

Represents the color used for the input text of this text field when it's disabled.

backgroundColor: Color = Color.Transparent

Represents the background color for this text field.

cursorColor: Color = MaterialTheme.colors.primary

Represents the cursor color for this text field.

errorCursorColor: Color = MaterialTheme.colors.error

Represents the cursor color for this text field when it's in error state.

focusedBorderColor: Color = MaterialTheme.colors.primary.copy(alpha = ContentAlpha.high)

Represents the border color for this text field when it's focused.

unfocusedBorderColor: Color = MaterialTheme.colors.onSurface.copy(alpha = ContentAlpha.disabled)

Represents the border color for this text field when it's not focused.

disabledBorderColor: Color = unfocusedBorderColor.copy(alpha = ContentAlpha.disabled)

Represents the border color for this text field when it's disabled.

errorBorderColor: Color = MaterialTheme.colors.error

Represents the border color for this text field when it's in error state.

leadingIconColor: Color = MaterialTheme.colors.onSurface.copy(alpha = TextFieldDefaults.IconOpacity)

Represents the leading icon color for this text field.

disabledLeadingIconColor: Color = leadingIconColor.copy(alpha = ContentAlpha.disabled)

Represents the leading icon color for this text field when it's disabled.

errorLeadingIconColor: Color = leadingIconColor

Represents the leading icon color for this text field when it's in error state.

trailingIconColor: Color = MaterialTheme.colors.onSurface.copy(alpha = TextFieldDefaults.IconOpacity)

Represents the trailing icon color for this text field.

focusedTrailingIconColor: Color = MaterialTheme.colors.primary.copy(alpha = ContentAlpha.high)

Represents the trailing icon color for this text field when it's focused.

disabledTrailingIconColor: Color = trailingIconColor.copy(alpha = ContentAlpha.disabled)

Represents the trailing icon color for this text field when it's disabled.

errorTrailingIconColor: Color = MaterialTheme.colors.error

Represents the trailing icon color for this text field when it's in error state.

focusedLabelColor: Color = MaterialTheme.colors.primary.copy(alpha = ContentAlpha.high)

Represents the label color for this text field when it's focused.

unfocusedLabelColor: Color = MaterialTheme.colors.onSurface.copy(ContentAlpha.medium)

Represents the label color for this text field when it's not focused.

disabledLabelColor: Color = unfocusedLabelColor.copy(ContentAlpha.disabled)

Represents the label color for this text field when it's disabled.

errorLabelColor: Color = MaterialTheme.colors.error

Represents the label color for this text field when it's in error state.

placeholderColor: Color = MaterialTheme.colors.onSurface.copy(ContentAlpha.medium)

Represents the placeholder color for this text field.

disabledPlaceholderColor: Color = placeholderColor.copy(ContentAlpha.disabled)

Represents the placeholder color for this text field when it's disabled.

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: Color = LocalContentColor.current.copy(LocalContentAlpha.current)

Represents the color used for the input text of this text field.

disabledTextColor: Color = textColor.copy(ContentAlpha.disabled)

Represents the color used for the input text of this text field when it's disabled.

backgroundColor: Color = MaterialTheme.colors.onSurface.copy(alpha = TextFieldDefaults.BackgroundOpacity)

Represents the background color for this text field.

cursorColor: Color = MaterialTheme.colors.primary

Represents the cursor color for this text field.

errorCursorColor: Color = MaterialTheme.colors.error

Represents the cursor color for this text field when it's in error state.

focusedIndicatorColor: Color = MaterialTheme.colors.primary.copy(alpha = ContentAlpha.high)

Represents the indicator color for this text field when it's focused.

unfocusedIndicatorColor: Color = MaterialTheme.colors.onSurface.copy( alpha = TextFieldDefaults.UnfocusedIndicatorLineOpacity )

Represents the indicator color for this text field when it's not focused.

disabledIndicatorColor: Color = unfocusedIndicatorColor.copy(alpha = ContentAlpha.disabled)

Represents the indicator color for this text field when it's disabled.

errorIndicatorColor: Color = MaterialTheme.colors.error

Represents the indicator color for this text field when it's in error state.

leadingIconColor: Color = MaterialTheme.colors.onSurface.copy(alpha = TextFieldDefaults.IconOpacity)

Represents the leading icon color for this text field.

disabledLeadingIconColor: Color = leadingIconColor.copy(alpha = ContentAlpha.disabled)

Represents the leading icon color for this text field when it's disabled.

errorLeadingIconColor: Color = leadingIconColor

Represents the leading icon color for this text field when it's in error state.

trailingIconColor: Color = MaterialTheme.colors.onSurface.copy(alpha = TextFieldDefaults.IconOpacity)

Represents the trailing icon color for this text field.

focusedTrailingIconColor: Color = MaterialTheme.colors.primary.copy(alpha = ContentAlpha.high)

Represents the trailing icon color for this text field when it's focused.

disabledTrailingIconColor: Color = trailingIconColor.copy(alpha = ContentAlpha.disabled)

Represents the trailing icon color for this text field when it's disabled.

errorTrailingIconColor: Color = MaterialTheme.colors.error

Represents the trailing icon color for this text field when it's in error state.

focusedLabelColor: Color = MaterialTheme.colors.primary.copy(alpha = ContentAlpha.high)

Represents the label color for this text field when it's focused.

unfocusedLabelColor: Color = MaterialTheme.colors.onSurface.copy(ContentAlpha.medium)

Represents the label color for this text field when it's not focused.

disabledLabelColor: Color = unfocusedLabelColor.copy(ContentAlpha.disabled)

Represents the label color for this text field when it's disabled.

errorLabelColor: Color = MaterialTheme.colors.error

Represents the label color for this text field when it's in error state.

placeholderColor: Color = MaterialTheme.colors.onSurface.copy(ContentAlpha.medium)

Represents the placeholder color for this text field.

disabledPlaceholderColor: Color = placeholderColor.copy(ContentAlpha.disabled)

Represents the placeholder color for this text field when it's disabled.