LabTextField extends TextInputLayout from Material components and LabTextFieldEditText extends TextInputEditText.
There are 2 key points that change the default behaviour to achieve the Lab design spec:
- The TextInputLayout is in
filledbackground mode. - The inner EditText has a default background.
- The Material
TextInputLayoutchecks for an existing background and skips drawing its own if one is set. - This allows us to provide our own background implementation. (The Box around the entire EditText)
- The Material
There are some constraints to customising these classes and styles:
- The inner EditText must have a custom background set when the View is inflated.
- The
Widget.Lab.TextFieldandWidget.LabComponents.TextFieldstyles automatically set the innerTextFieldEditText's style.- This style has a default background for the EditText.
- This
filledmode changes how the label is animated.
- The
- If a custom EditText style is needed in a layout for
LabTextFieldEditText, make sure the style extendsWidget.Lab.TextFieldEditTextorWidget.LabComponents.TextFieldEditText