TextFieldDefaults

Contains default values used by TextField.

Properties

Link copied to clipboard

The default corner radius of the TextField (COUI coui_textinput_corner_radius).

Link copied to clipboard

The character counter font size (COUI coui_input_view input_count: 10sp).

Link copied to clipboard

The default inside margin of the TextField in TextFieldMode.Rectangle. From COUI Widget.COUI.EditText.HintAnim.Rectangle: paddingLeft 16dp / rectModePaddingTop 12dp / paddingBottom 12dp (COUI paddingRight is 10dp to leave room for the trailing delete icon; the symmetric DpSize API keeps 16dp on both sides).

Link copied to clipboard

The default inside margin of the TextField in TextFieldMode.Line. From COUI Widget.COUI.EditText.HintAnim.Line.HintDisable (the style ColorOS Settings uses for dialog inputs): horizontal padding 0dp, coui_input_edit_text_no_title_padding_top / _bottom 15dp.

Link copied to clipboard

The default inside margin of the TextField in TextFieldMode.None. From COUI Widget.COUI.EditText base style: vertical padding 9dp.

Functions

Link copied to clipboard

Returns the default inside margin for the given mode.

Link copied to clipboard
fun textFieldColors(backgroundColor: Color = Color.Transparent, labelColor: Color = COUITheme.colorScheme.onSurfaceSecondary, borderColor: Color = COUITheme.colorScheme.primary, unfocusedBorderColor: Color = COUITheme.colorScheme.dividerLine, errorColor: Color = COUITheme.colorScheme.error, counterColor: Color = COUITheme.colorScheme.onSurfaceContainerHigh, iconColor: Color = COUITheme.colorScheme.onSurfaceSecondary, disabledTextColor: Color = COUITheme.colorScheme.disabledOnSurface): TextFieldColors

Default colors used by the TextField.

Link copied to clipboard

The default input text style for the given mode: 16sp regular (COUI couiEditTextTextAppearance / couiTextBodyL — couiTextAppearanceHeadline6 16sp with fontFamily reset to sans-serif-regular), bold in TextFieldMode.Rectangle (Widget.COUI.EditText.HintAnim.Rectangle sets android:textStyle=bold).