TextFieldColors
-
Cmn
interface TextFieldColors
TextFieldColorsWithIcons |
This interface is deprecated. Empty interface; use parent TextFieldColors instead |
Represents the colors of the input text, background and content (including label, placeholder, leading and trailing icons) used in a text field in different states.
See TextFieldDefaults.textFieldColors for the default colors used in TextField. See TextFieldDefaults.outlinedTextFieldColors for the default colors used in OutlinedTextField.
Summary
Public functions |
||
|---|---|---|
State<Color> |
@ComposableRepresents the background color for this text field. |
Cmn
|
State<Color> |
@ComposableRepresents the color used for the cursor of this text field. |
Cmn
|
State<Color> |
@ComposableRepresents the color used for the border indicator of this text field. |
Cmn
|
State<Color> |
@ComposableRepresents the color used for the label of this text field. |
Cmn
|
State<Color> |
@ComposableThis function is deprecated. Use/implement overload with interactionSource parameter |
Cmn
|
open State<Color> |
@ComposableRepresents the color used for the leading icon of this text field. |
Cmn
|
State<Color> |
@ComposableRepresents the color used for the placeholder of this text field. |
Cmn
|
State<Color> |
@ComposableRepresents the color used for the input text of this text field. |
Cmn
|
State<Color> |
@ComposableThis function is deprecated. Use/implement overload with interactionSource parameter |
Cmn
|
open State<Color> |
@ComposableRepresents the color used for the trailing icon of this text field. |
Cmn
|
Public functions
backgroundColor
@Composable
fun backgroundColor(enabled: Boolean): State<Color>
Represents the background color for this text field.
| Parameters | |
|---|---|
enabled: Boolean |
whether the text field is enabled |
cursorColor
@Composable
fun cursorColor(isError: Boolean): State<Color>
Represents the color used for the cursor of this text field.
| Parameters | |
|---|---|
isError: Boolean |
whether the text field's current value is in error |
indicatorColor
@Composable
fun indicatorColor(
enabled: Boolean,
isError: Boolean,
interactionSource: InteractionSource
): State<Color>
Represents the color used for the border indicator of this text field.
| Parameters | |
|---|---|
enabled: Boolean |
whether the text field is enabled |
isError: Boolean |
whether the text field's current value is in error |
interactionSource: InteractionSource |
the |
labelColor
@Composable
fun labelColor(
enabled: Boolean,
error: Boolean,
interactionSource: InteractionSource
): State<Color>
Represents the color used for the label of this text field.
| Parameters | |
|---|---|
enabled: Boolean |
whether the text field is enabled |
error: Boolean |
whether the text field should show error color according to the Material specifications. If the label is being used as a placeholder, this will be false even if the input is invalid, as the placeholder should not use the error color |
interactionSource: InteractionSource |
the |
leadingIconColor
@Composable
funleadingIconColor(enabled: Boolean, isError: Boolean): State<Color>
Represents the color used for the leading icon of this text field.
leadingIconColor
@Composable
open fun leadingIconColor(
enabled: Boolean,
isError: Boolean,
interactionSource: InteractionSource
): State<Color>
Represents the color used for the leading icon of this text field.
| Parameters | |
|---|---|
enabled: Boolean |
whether the text field is enabled |
isError: Boolean |
whether the text field's current value is in error |
interactionSource: InteractionSource |
the |
placeholderColor
@Composable
fun placeholderColor(enabled: Boolean): State<Color>
Represents the color used for the placeholder of this text field.
| Parameters | |
|---|---|
enabled: Boolean |
whether the text field is enabled |
textColor
@Composable
fun textColor(enabled: Boolean): State<Color>
Represents the color used for the input text of this text field.
| Parameters | |
|---|---|
enabled: Boolean |
whether the text field is enabled |
trailingIconColor
@Composable
funtrailingIconColor(enabled: Boolean, isError: Boolean): State<Color>
Represents the color used for the trailing icon of this text field.
trailingIconColor
@Composable
open fun trailingIconColor(
enabled: Boolean,
isError: Boolean,
interactionSource: InteractionSource
): State<Color>
Represents the color used for the trailing icon of this text field.
| Parameters | |
|---|---|
enabled: Boolean |
whether the text field is enabled |
isError: Boolean |
whether the text field's current value is in error |
interactionSource: InteractionSource |
the |