This is preventing completions of attribute names for Chip and the attribute panels shows up empty for Chip.
Rename R.styleable.ChipDrawable to R.styleable.Chip and update ChipDrawable to use it.
AS 3.2 canary > 14 (currently 16) is required to see the attributes in the attribute panel.
PiperOrigin-RevId: 198909123
This commit updates the style names for the outlined text field box from "Outline" to "Outlined.
Widget.MaterialComponents.TextInputLayout.OutlineBox -> Widget.MaterialComponents.TextInputLayout.OutlinedBox, and
Widget.MaterialComponents.TextInputEditText.OutlineBox -> Widget.MaterialComponents.TextInputEditText.OutlinedBox.
This name matches spec and is closer to what is used on the other platforms.
PiperOrigin-RevId: 198768731
The editTextStyle is now implicitly set to Widget.AppCompat.EditText.
The background for this change is that all EditTexts in the theme were getting the filled box text field set on it rather than Widget.AppCompat.EditText. Because the TextInputEditText style is set via a ThemeOverlay, simply setting the correct style on the TextInputEditText wouldn't remove the attributes set in the filled box ThemeOverlay. This commit sets textInputStyle to Widget.Design.TextInputLayout to work around that.
This commit also adds a legacy text field demo. This should help ensure that the pre-existing text field isn't changed as a result of other modifications to the text field.
PiperOrigin-RevId: 198758642
There was extra padding at the bottom of the indicator view (i.e. the helper or error TextView underneath the text field. This commit removes that extra padding.
PiperOrigin-RevId: 198578652
Currently when a user specifies an instance of java.lang.String to ChipDrawable#setText, ChipDrawable#getText incorrectly returns an instance of android.text.SpannableStringBuilder.
PiperOrigin-RevId: 198393803
Move to use native android:padding attrs instead of custom boxPadding attributes for text fields. This is accomplished by creating box styles for TextInputEditText, and setting android:padding attributes in those.
The TextInputLayout box styles set the appropriate TextInputEditText style on its child by wrapping the TextInputEditText style in theme overlays. This is kind of neat, since it allows for the user not to have to set a style on both the TextInputLayout and TextInputEditText - the user does not even have to know about the TextInputEditText styles with this pattern. It should also help clear up some confusion over where to set the hint and other areas of haziness between TextInputLayout and TextInputEditText.
The default editTextStyle is set to the filled box style, to match the default TextInputLayout style.
This change removes the box padding attributes, and it also removes the dimension resources in favor of setting them in the style to improve readability.
This commit also changes TextInputEditText constructors to both use a theme attribute in the 3-arg constructor and call through to the TextInputEditText overloaded constructors rather than call the super's constructor from each. This allows the theme attribute set in the theme overlays to take effect.
PiperOrigin-RevId: 198051251
Override Chip#setText(CharSequence, BufferType) to set the value on the internal chip text and prevent text from being set on Chip's super class because ChipDrawable will handle text rendering.
- This method is called by all overridden versions of TextView#setText except android.widget.TextView#setText(char[], int, int)}, which cannot be overridden. This is not ideal but an incremental change towards supporting all flavors of android.widget.TextView#setText methods.
Deprecate Chip#setChipTextResource(int) and Chip#setText(CharSequence)
PiperOrigin-RevId: 197960701
Rename ChipDrawable#setChipTextResource to ChipDrawable#setTextResource
Rename ChipDrawable#setChipText to ChipDrawable#setText.
PiperOrigin-RevId: 197948000
This is one in a series of planned changes that aim to delegate rendering a Chip's text to TextView instead of ChipDrawable.
PiperOrigin-RevId: 197780081
If caller sets ellipsize to MARQUEE an UnsupportedOperstaionException will be thrown at runtime.
Override ellipsize getters / setters and pass the value to ChipDrawable.
PiperOrigin-RevId: 196813582
This commit:
- Moves the draw calls in TextInputLayout#draw to happen in a better order: now, the background is drawn first, then TextInputLayout and its children, then the hint. This prevents the box from drawing on top of other text field elements.
- Updates box background setters and getters to modify boxBackgroundColor instead of defaultBoxBackgroundColor.
- Adds a demo for filled box background color changes to the text field demo.
PiperOrigin-RevId: 196748102