Andrew Overton eaf2489303
[Dialogs, TextFields] Update docs (#7209)
#7187 and #7184 graduated Buttons and TextFields theming extensions to ready, but didn't update the docs. Similarly, #7190, which has not yet been merged in, is not updating the docs to reflect the graduation of the Dialogs theming extension to ready.

This PR updates docs for Dialogs and TextFields theming extensions to reflect them being marked ready. Once #7190 is merged in the Dialogs changes here will be accurate.

I will address the out-of-date Buttons docs once #7206 is merged in.
2019-04-22 14:12:04 -04:00
..

Text fields

Text fields allow users to input text into your app. They are a direct connection to your users' thoughts and intentions via on-screen, or physical, keyboard. The Material Design Text Fields take the familiar element to new levels by adding useful animations, character counts, helper text, error states, and styles.

Text Fields

MDC's text fields come in several styles and have a great range of customization. Google's UX research has determined that Outlined and Filled (aka 'text box') styles perform the best by a large margin. So use MDCTextInputControllerFilled, MDCTextInputControllerOutlined, and MDCTextInputControllerOutlinedTextArea if you can and set colors and fonts that match your company's branding.

For more information on text field styles, and animated images of each style in action, see Text Field Styles.


Overview

Text Fields provides both a single-line version based on UITextField and a multi-line version backed by UITextView as well as objects that customize the text fields' behavior and appearance called 'Text Input Controllers'.

The actual components (MDCTextField & MDCMultilineTextField) are 'dumb': they do not have styles, animations, or advanced features. They are designed to be controlled from the outside, via very liberal public API, with a text input controller.

Most text input controllers included are based on MDCTextInputControllerBase which manipulates the exposed elements of the text field to make placeholders float.

There is also a text input controller for full-width forms (MDCTextInputControllerFullWidth). Like MDCTextInputControllerBased controllers, it also handles errors and character counting but has not been thoroughly tested with UX research.

Customize the included text input controllers via their parameters or create your own to express your app's brand identity thru typography, color, and animation: if the placeholder should move, add constraints or change the frame. If the trailing label should display validation information, change the text and color it.

This pattern is not a delegation or data source-like relationship but rather a controller-to-view relationship: the text field does not require nor expect to be served data or instruction but is instead malleable and easily influenced by outside interference.

Installation

Usage

Extensions

Accessibility