132 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
Daniel Frett
4bd83e5fc9 [TextInputLayout] run the captionViewToShow logic whenever there is a view
Resolves https://github.com/material-components/material-components-android/pull/528

GIT_ORIGIN_REV_ID=55964e5f7478903e634e41e223df0575ff57bf1d
PiperOrigin-RevId: 271616982
2019-09-27 14:59:41 -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
9ada97c2be Automated g4 rollback of changelist 268731150
PiperOrigin-RevId: 268920078
2019-09-18 14:06:57 -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
1b6953b92d Automated g4 rollback of changelist 268687909
PiperOrigin-RevId: 268731150
2019-09-12 15:02:38 -04:00
leticiars
e13bd3c02a Clear button icon should not be shown if text field isn't activated/being interacted with.
PiperOrigin-RevId: 268687909
2019-09-12 14:27:21 -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
dniz
8dc2eefd19 Update comments
PiperOrigin-RevId: 259405175
2019-07-22 21:20:09 -04:00
dniz
0512f776c5 Remove sub-package AndroidManifest.xml files from lib directory
PiperOrigin-RevId: 258390736
2019-07-16 13:18:32 -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
Antonin Fouques (CmoaToto)
7787a8257d use .equalsIgnoreCase(...) instead of .toLowerCase().equals(...)
GIT_ORIGIN_REV_ID=173665654ad165cee4c3da64af4fd60afa9a1f61

Resolves https://github.com/material-components/material-components-android/pull/411

PiperOrigin-RevId: 256404636
2019-07-03 15:19:19 -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
326dc8a13a Animating dropdown arrow icon.
PiperOrigin-RevId: 254279577
2019-06-24 17:05:54 -04:00
leticiars
b89a91c710 Animating clear button end icon.
PiperOrigin-RevId: 253852706
2019-06-24 16:45:49 -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
cb5430e117 Some Exposed Dropdown Menu accessibility improvements:
- fixing the layout not responding to TalkBack double click
- making the end icon not be focusable in accessibility mode
- making TalkBack announcement be the same as the Spinner's

PiperOrigin-RevId: 251479580
2019-06-10 08:54:13 -07:00