We already had class documentation that explains that TextInputEditText should be instantiated with the parent TextInputLayout's context for proper theming, but this information is important enough to the basic usage of TextInputLayout and TextInputEditText that it's best to have it the class documentation, as well.
Added the guidance in both TextInputLayout and TextInputEditText because it's relevant to both classes.
PiperOrigin-RevId: 432244388
Add an expanding animation for the focused underline that's triggered when the edit text gains focus. The line mask animation is built to calculate its bounds based on the hint CollapsingTextHelper's expansion fraction, so it seamlessly follows that animation.
PiperOrigin-RevId: 424703815
Changes are mostly to keep start/end layouts and icon views hidden (visibility = gone) when they are not needed.
Resolves https://github.com/material-components/material-components-android/pull/2326
GIT_ORIGIN_REV_ID=0393ac65d562bc87d340ec7bb260ebba99a1ac3b
Co-authored-by: leticiarossi <9288695+leticiarossi@users.noreply.github.com>
PiperOrigin-RevId: 418038435
The setLabelFor calls were made in the call to populate the accessibility node but they were made after calling super (one of them was actually nested inside of a getter!), this is too late, the accessibility node is populated with the label for by the super class
PiperOrigin-RevId: 407178334
Before, when swiping with TalkBack on, the placeholder text would be mistakenly announced. This change makes it so it's only announced when it appears, for API >= 16. It's still announced as part of the description announcement when the text field is selected, as before, so it's still accessible for APIs < 16.
PiperOrigin-RevId: 405668594
Before, when swiping with TalkBack on, the placeholder text would be mistakenly announced. This change makes it so it's only announced when it appears, for API >= 16. It's still announced as part of the description announcement when the text field is selected, as before, so it's still accessible for APIs < 16.
PiperOrigin-RevId: 404871534
The box background of text fields are applied to EditTexts instead of the TextInputLayout. So when there are paddings in TextInputLayout, we will need to adjust cutout bounds, which is calculated based on TextInputLayout's coordinates, according to the paddings.
PiperOrigin-RevId: 404281248
Before, when swiping with TalkBack on, the placeholder text would be mistakenly announced. This change makes it so it's only announced when it appears, for API >= 16. It's still announced as part of the description announcement when the text field is selected, as before, so it's still accessible for APIs < 16.
PiperOrigin-RevId: 404266249
When a collapsed label is showing, we cutout part of the border of an outlined text input box according to the exact stroke width. However when using rounded corners, there can be slight offsets from where the border is really drawn. Also, if the corner size is large, the part of border we need to cutout might not just be a straight line but contains part of the corner.
However, with the existing cutout logic, we cannot just cutout the whole label area, which will cause the area inside the border also gets cutout, if it has color. This CL changes the cutout drawing logic to only apply the cutout on stroke drawing to fix the issue.
This CL also fixes the bug that when the label is too long, we didn't take the ellipsized text length into account. Creates a variable to store the calculated collapsed text width to fix the issue.
Resolves https://github.com/material-components/material-components-android/issues/2145
PiperOrigin-RevId: 402316057
If startIconTint is a plain color, refreshStartIconDrawableState() won't update the tint to the new drawable. To solve the issue and make the logic be consistent, calls applyStartIconTint() when a new icon is set.
Resolves https://github.com/material-components/material-components-android/issues/2141
PiperOrigin-RevId: 383632467
The placeholder TextView previously appeared and disappeared with no fade, which led to a jarring effect and an overlap between the hint text and the placeholder text.
PiperOrigin-RevId: 373713144
- updated top and bottom padding (updating the heights) except of dense outlined
- updated start and end paddings of layout and helper/error/counter view area
- updated label position of filled
- added padding between prefix/suffix and text input
PiperOrigin-RevId: 334955916