120 Commits

Author SHA1 Message Date
leticiars
6849bae3e9 [TextInputLayout] Fixing duplicate announcement when character limit is exceeded and adding announcement for when the limit is reached.
PiperOrigin-RevId: 282787253
2019-12-02 17:32:42 -05:00
leticiars
29f3d05fa8 Adding helper text to the hint node so that TalkBack announces it when a text field is selected.
This provides more context for the user since the helper text is located below the text field (which is still focusable via TalkBack for now).

PiperOrigin-RevId: 282560641
2019-12-02 17:26:39 -05:00
leticiars
d2870fbb3f Fixing a11y warning when AutoCompleteTextView inside a TextInputLayout doesn't have a hint.
The hint should be retrieved from the text input layout as it is what takes care of the hint behavior.

PiperOrigin-RevId: 280526998
2019-11-15 15:12:41 -05:00
leticiars
aeb9eea9d8 Allow a content description to be set on a text field error view. This is useful for when the error message has special characters that TalkBack cannot read.
PiperOrigin-RevId: 280508115
2019-11-15 15:12:03 -05:00
leticiars
20f113212d [TextInputLayout] Adding support for the collapsed label position to be determined via the edit text gravity, such as center_horizontal.
Resolves https://github.com/material-components/material-components-android/pull/311
Resolves https://github.com/material-components/material-components-android/issues/609

PiperOrigin-RevId: 279998938
2019-11-12 16:23:41 -05:00
leticiars
4bff089310 Making sure hoveredFilledBackgroundColor defaults to default color if not set on a stateful CSL instead of to the disabled color.
PiperOrigin-RevId: 279120861
2019-11-07 16:11:23 -05:00
Mattia
d29daab572 [TextInputLayout] focusedStrokeColor should take into account the enabled color
Resolves https://github.com/material-components/material-components-android/pull/734

GIT_ORIGIN_REV_ID=36549f1519805be416aaf75cbb67be948c4b02e7
PiperOrigin-RevId: 278910639
2019-11-07 16:07:36 -05:00
leticiars
27f7f4c6ba Fixing text field icons that are not clickable having ripple effect when text field is pressed.
Non clickable ImageViews inherit pressed state of parent views, so icons appeared as pressed even if they were not clickable/focusable.

PiperOrigin-RevId: 278381886
2019-11-04 13:05:10 -05:00
nkotula
8ca8e1bbdd [TextInputLayout] Add support for focused background color
Resolves https://github.com/material-components/material-components-android/pull/724

GIT_ORIGIN_REV_ID=8b272d736167cd0bff236b47049e247e3ec383a5
PiperOrigin-RevId: 277959398
2019-11-04 13:03:21 -05:00
haodong
7708ca4db1 Automated g4 rollback of changelist 277103254
PiperOrigin-RevId: 277545348
2019-11-01 13:28:40 -07:00
haodong
5db6b5f2f8 Automated g4 rollback of changelist 275944003
PiperOrigin-RevId: 277103254
2019-11-01 13:28:40 -07:00
leticiars
5a57937111 Automated g4 rollback of changelist 276353549
PiperOrigin-RevId: 276701861
2019-11-01 13:28:40 -07:00
leticiars
3f170183cb Automated g4 rollback of changelist 276320000
PiperOrigin-RevId: 276353549
2019-11-01 13:28:40 -07:00
leticiars
625f608012 Adding android:enabled attribute to the TextInputLayout.
Resolves https://github.com/material-components/material-components-android/issues/646

PiperOrigin-RevId: 276320000
2019-11-01 13:28:40 -07:00
leticiars
d0307dc974 Error icon should only be visible if error is enabled.
Resolves https://github.com/material-components/material-components-android/issues/587

PiperOrigin-RevId: 276153474
2019-11-01 13:28:40 -07:00
haodong
8c8eaac2b1 Automated g4 rollback of changelist 275859720
PiperOrigin-RevId: 275944003
2019-11-01 13:28:40 -07:00
haodong
69e399f9c4 Updated TextInputLayout to support empty string as error message.
PiperOrigin-RevId: 275859720
2019-11-01 13:28:40 -07:00
marianomartin
115313c0c0 Expose a class for themeoverlay in style
This moves functionality from ThemeEnforcement into a stand alone class.

Resolves https://github.com/material-components/material-components-android/issues/665

PiperOrigin-RevId: 275481343
2019-10-21 10:24:19 -04:00
leticiars
3a21a881d0 Updating filled text fields to use new colors for states a11y.
PiperOrigin-RevId: 275024556
2019-10-21 10:23:14 -04:00
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