Input View
An InputView component with COUI style — the ColorOS Settings "card input".
Mirrors COUICardSingleInputView / COUICardMultiInputView (coui_single_input_card_view.xml / coui_multi_input_card_view.xml): a white card (couiColorCardBackground, couiRoundCornerM 12dp corners) holding an optional 16sp medium title and a bare, undecorated text field (COUIEditText MODE_BACKGROUND_NO_LINE — no underline, no border), with the trailing counter / clear / password buttons overlaid at the end of the field. The error caption sits below the card (10sp couiColorError, 4dp top padding), fades in over 217ms / out over 283ms with the COUI ease curve, and the field plays the COUI error shake while it is shown.
In the multi-line form (singleLine = false, mirroring COUICardMultiInputView) the counter moves to the bottom-end corner of the card (12sp couiColorLabelTertiary) and its color animates to the error color for 1s when the limit is hit.
When maxCount is greater than 0 the input is hard-limited to that many characters.
Parameters
The text to be displayed in the input field.
The callback to be called when the value changes.
The modifier to be applied to the InputView.
The title displayed above the input field, inside the card. Hidden when empty.
The label (hint) of the inner TextField, shown while the field is empty.
Whether the InputView is enabled.
Whether the input field is read-only.
Whether to show the "length/max" counter. Only shown when maxCount is greater than 0 (COUIInputView couiEnableInputCount).
The maximum number of characters. 0 means unlimited.
Whether to show a clear button while the field is focused and not empty (COUIEditText quickDelete).
Whether to show the password eye toggle (COUIInputView couiEnablePassword). While the password is hidden the text is masked.
The error message displayed below the card. Empty hides the error line.
The corner radius of the card (COUI couiRoundCornerM).
The InputViewColors applied to the card, title, counter and error line. Use InputViewDefaults.inputViewColors to customize.
The TextFieldColors applied to the inner TextField.
The text style to be applied to the input text (COUI couiTextBodyL: 16sp regular).
The keyboard options to be applied to the input field.
The keyboard actions to be applied to the input field.
Whether the input field is single line (COUICardSingleInputView). Set to false for the multi-line card form (COUICardMultiInputView).
The maximum number of lines allowed to be displayed (COUIInputView MAX_LINE).
The visual transformation to be applied to the input field.
The leading icon to be displayed in the input field.
The trailing icon to be displayed after the built-in trailing buttons.
The interaction source to be applied to the input field.