101 Commits

Author SHA1 Message Date
leticiars
a58a82354e Fixing outlined error color when focused.
PiperOrigin-RevId: 273742930
2019-10-10 15:51:01 -04:00
leticiars
dc88b3e45f Adding setBoxStrokeColorStateList method so that the outlined text field stroke color accepts a color state list.
Resolves https://github.com/material-components/material-components-android/issues/593

PiperOrigin-RevId: 273577122
2019-10-10 15:50:02 -04:00
ldjesper
7dc56dfcdd Simplify TextField drawable resources
https://github.com/material-components/material-components-android/issues/611

PiperOrigin-RevId: 273544807
2019-10-10 15:48:39 -04:00
cketcham
0547d2a06b Uncouple CornerSize from CornerTreatment
This allows for more easily updating the CornerSize independently from the CornerTreatment and makes it possible to create different types of CornerSizes such as percentage based corners. However, this means corner sizes can be different depending on the bounds of the shape, so the bounds need to be provided. MaterialShapeDrawable has bounds and the ShapeAppearanceModel, so there are new convenience methods there which return the current corner size for the current bounds of the drawable.

PiperOrigin-RevId: 272908508
2019-10-04 15:23:16 -04:00
leticiars
c74120d3d7 Automated g4 rollback of changelist 271432476
PiperOrigin-RevId: 272057811
2019-10-01 04:10:55 -04:00
leticiars
544c2af103 Adding hintTextErrorColor color attribute to be used for the collapsed hint text color when an error is being displayed.
PiperOrigin-RevId: 271432476
2019-09-26 17:58:11 -04:00
leticiars
107294f810 Fix stroke not using stroke error color when in overflow state (noop).
PiperOrigin-RevId: 271406453
2019-09-26 17:57:07 -04:00
leticiars
9ab640f83e Adding null check for updateIconColorOnState method
PiperOrigin-RevId: 270319995
2019-09-24 12:17:11 -04:00
leticiars
b17d042f9a Updating outlined text fields to use new colors for states a11y.
PiperOrigin-RevId: 270297081
2019-09-24 12:14:23 -04:00
leticiars
88d316e0f4 Adding boxStrokeErrorColor color attribute to be used for the outlined text field stroke color when an error is being displayed.
PiperOrigin-RevId: 270088868
2019-09-20 11:00:03 -04:00
afohrman
f6a67eb9f6 Fix issues with javadocs.
PiperOrigin-RevId: 269825611
2019-09-18 14:24:31 -04:00
leticiars
6e5ddcfb0e Adding support for prefix and suffix in text fields.
Prefix text can be set via the prefixText attribute or via the setPrefixText(CharSequence) method.
Similarly, suffix text can be set via the suffixText attribute or via setSuffixText(CharSequence)

PiperOrigin-RevId: 269799139
2019-09-18 14:21:37 -04:00
leticiars
784fb9ba24 Fixing ExposedDropdownMenu crash when device is rotated.
Resolves https://github.com/material-components/material-components-android/issues/561

PiperOrigin-RevId: 268753819
2019-09-18 13:55:15 -04:00
leticiars
6f35a22359 Automated g4 rollback of changelist 268680301
PiperOrigin-RevId: 268740076
2019-09-18 13:53:59 -04:00
leticiars
55f85bcc6e Adding support for prefix and suffix in text fields.
Prefix text can be set via the prefixText attribute or via the setPrefixText(CharSequence) method.
Similarly, suffix text can be set via the suffixText attribute or via setSuffixText(CharSequence)

PiperOrigin-RevId: 268680301
2019-09-12 14:26:15 -04:00
marianomartin
215a839598 Internal cleanup
PiperOrigin-RevId: 267504117
2019-09-12 13:48:16 -04:00
cketcham
7bb525ff59 Update usages of ShapeAppearanceModel to use Builder pattern
PiperOrigin-RevId: 266144471
2019-08-29 15:39:51 -04:00
marianomartin
0d4515cb46 Internal cleanup
PiperOrigin-RevId: 265971745
2019-08-29 14:59:20 -04:00
cketcham
440b6e7753 Add @NonNull and @Nullable annotations
PiperOrigin-RevId: 265057396
2019-08-29 10:30:58 -04:00
Material Design Team
322cbaae8a Automated g4 rollback of changelist 264230778
PiperOrigin-RevId: 264382083
2019-08-20 11:22:09 -04:00
afohrman
04955f6421 Add placeholder text functionality to TextInputLayout.
This is the initial implementation of placeholder text; it does not contain motion. At this stage, TextInputLayout sets the placeholder text visibility based on whether or not it should show.

PiperOrigin-RevId: 264230778
2019-08-20 11:19:02 -04:00
leticiars
48d775dc0e Adding OnLongClickListener setters for text field icons.
PiperOrigin-RevId: 263429758
2019-08-16 16:13:44 -04:00
leticiars
58ccce1211 Fixing TextInputLayout not parsing boxStrokeWidth attr and adding boxFocusedStrokeWidth attr.
For the outlined textfields, those attrs control the outline stroke, while for the filled textfields, they control the underline width.

PiperOrigin-RevId: 262933557
2019-08-16 15:57:25 -04:00
leticiars
631c320dea Adding error icon documentation.
PiperOrigin-RevId: 261348566
2019-08-02 15:58:54 -04:00
leticiars
1c4f77c00e Adding a frame wrapper for the TextInputLayout end icon so it simplifies the error icon implementation.
PiperOrigin-RevId: 260934634
2019-08-02 15:53:43 -04:00
leticiars
896e432945 Refactoring TextInputLayout.On*Listeners and restricting EndIconMode annotation.
PiperOrigin-RevId: 260516099
2019-07-29 16:47:05 -04:00
leticiars
3f73804b57 Implementing error icon for text fields.
They are set by default when the text field is on error state, but can be disabled by setting the error icon drawable to null via the errorIconDrawable attribute or the setErrorIconDrawable method.

PiperOrigin-RevId: 260495196
2019-07-29 16:43:16 -04:00
marianomartin
2241380dba Internal cleanup
PiperOrigin-RevId: 259753640
2019-07-24 15:09:18 -04:00
leticiars
6a88f2b7d7 Adding option to set TextInputLayout icons to be not checkable.
Also updating clear text end icon to be not checkable, so that screen readers don't announce the icon's checked state as it's not relevant (differently from the password toggle icon, for example).

PiperOrigin-RevId: 259532643
2019-07-23 11:14:44 -04:00
isabellekim
a628bf516b Revert the library to compile with Java 7: revert lambdas, add necessary casts, and make some variables final.
Continue compile shrine demo, catalog, and tests with Java 8.

PiperOrigin-RevId: 257874888
2019-07-15 19:19:23 -04:00
leticiars
413021576e Fixing extra padding being added to icon views.
PiperOrigin-RevId: 257045498
2019-07-09 12:59:05 -04:00
leticiars
15b721c750 Fixing input text not adjusting to start/end icons in some cases.
PiperOrigin-RevId: 256369941
2019-07-03 14:14:06 -04:00
marianomartin
164bf0fabd Internal cleanup
PiperOrigin-RevId: 255609320
2019-07-03 14:02:53 -04:00
marianomartin
367b295624 Internal cleanup
PiperOrigin-RevId: 254414602
2019-06-24 17:12:42 -04:00
leticiars
1ba8a45332 Fixing TextInputLayout wrongly announcing "End of field" message in TalkBack mode.
PiperOrigin-RevId: 253242183
2019-06-18 13:29:19 -04:00
cketcham
bff75f2d3e Update to lamdas
PiperOrigin-RevId: 252846439
2019-06-18 13:21:02 -04:00
marianomartin
5a5d311a36 Check more lint warnings, show warnings as errors.
PiperOrigin-RevId: 252822573
2019-06-18 13:20:15 -04:00
afohrman
569d33a055 Remove corner radius adjustment from outline text fields.
PiperOrigin-RevId: 252682213
2019-06-18 12:04:27 -04:00
leticiars
34e9ab24fb Only make filled text field hint vertically centered if edit text's min lines is 1.
In APIs > 15.

PiperOrigin-RevId: 252630869
2019-06-18 11:56:16 -04:00
leticiars
2ec8717f9f Make decorative icons in text fields not focusable in TalkBack mode.
PiperOrigin-RevId: 252405963
2019-06-18 11:51:17 -04:00
leticiars
16a6e72ecc Fixing passwordToggleEnabled="false" not working as expected.
Note: it's advised to use endIconMode instead of passwordToggleEnabled.
PiperOrigin-RevId: 250892878
2019-06-10 08:22:56 -07:00
leticiars
0c0951ce6d Fixing requestLayout() being incorrectly called multiple times.
The end icon dummy drawable should only be set if it's not yet set.

PiperOrigin-RevId: 249462027
2019-05-24 14:18:31 -04:00
marianomartin
90837ec485 Internal cleanup
PiperOrigin-RevId: 249243403
2019-05-21 12:15:07 -04:00
leticiars
837febea61 Adding the EditText as a parameter for onEditTextAttached().
PiperOrigin-RevId: 248218371
2019-05-16 17:17:14 -04:00
leticiars
5f8f60457a Changing how password toggle end icon updates its checked state.
Now it will automatically change to checked or not checked depending if the EditText's transformation method is changed.

PiperOrigin-RevId: 248185643
2019-05-16 17:12:39 -04:00
leticiars
c71b6ccb13 Exposed Dropdown Menu (https://material.io/design/components/menus.html#exposed-dropdown-menu).
An AutoCompleteTextView should be used in the place of a TextInputEditText, along with with a Widget.MaterialComponents.TextInputLayout.(...).ExposedMenuDropdown style.

PiperOrigin-RevId: 246343749
2019-05-03 10:58:36 -04:00
marianomartin
0e9513a86f Fix getter in text input layout
PiperOrigin-RevId: 245479204
2019-04-29 15:57:13 -07:00
leticiars
aa84ca93be Creating EndIconDelegate abstract class and subclasses to refactor how TextInputLayout initialize its end icons.
PiperOrigin-RevId: 244058404
2019-04-19 21:35:40 -04:00
afohrman
db408ee4ce Add clearer documentation that box background colors are only supported for filled text fields.
PiperOrigin-RevId: 242870719
2019-04-19 15:24:13 -04:00
leticiars
27eac541b0 Fixing end and start icon ripples appearing behind text input layout.
PiperOrigin-RevId: 242660816
2019-04-19 13:09:03 -04:00