35 Commits

Author SHA1 Message Date
rightnao
c98480c019 [TextInputLayout] Update motion attributes for textfield animations
PiperOrigin-RevId: 472525831
2022-09-08 13:24:09 -04:00
conradchen
ac74bc3bfd [CleanUp][TextField] Centralize icon view state handling logic
Note that there are a slight behavior changes - when a new end icon mode is set, the state will always be reset, if applicable. This should be logically more consistent and correct than the current behavior.

PiperOrigin-RevId: 449027939
2022-05-16 16:09:50 -04:00
conradchen
86b512a81c [CleanUp][TextField] Move end icon and content description logic to the layout class
PiperOrigin-RevId: 448036109
2022-05-11 14:59:46 -04:00
conradchen
7b2f92443a [CleanUp][TextField] Remove TextInputLayout.getEditText() calls from EndIconDelegates
PiperOrigin-RevId: 446240046
2022-05-03 15:06:11 -04:00
conradchen
a0e8c35470 [CleanUp][TextField] Create EndIconDelegate.deactivate() method and remove the relevant listener
PiperOrigin-RevId: 442846789
2022-04-19 13:57:46 -04:00
conradchen
26308d97d8 [CleanUp][TextField] Centralize EndIconDelegate listener logic
It provides better performance and memory management.

PiperOrigin-RevId: 441566824
2022-04-14 13:15:33 -04:00
conradchen
6cdf7b5155 [CleanUp][TextField] Extract end components from TextInputLayout
PiperOrigin-RevId: 435390505
2022-03-17 18:51:39 +00:00
leticiars
ae16efd5da [TextInputLayout] Fixed icons behaving unexpectedly when switching modes + bug of wrong icon tint state when setting an icon programmatically.
Resolves https://github.com/material-components/material-components-android/issues/503
Resolves https://github.com/material-components/material-components-android/issues/1849

PiperOrigin-RevId: 427268349
2022-02-09 15:58:45 +00:00
conradchen
717774ec7f [TextField] Do not load default drawable if custom end icon is being used
Resolves https://github.com/material-components/material-components-android/issues/2085

PiperOrigin-RevId: 382785324
2021-07-07 19:21:28 +00:00
conradchen
8a4f42aca7 [TextField] Make clear text icon focusable
The current logic hides clear text icon whenever edit text loses its
focus. Therefore, the clear text icon can never be focused. Changes
the logic so it retains clear text icon if it has focus.

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

PiperOrigin-RevId: 380802379
2021-06-24 13:00:34 -07:00
Adrien Vitti
740a3d247b [TextInputLayout] Fixed clear icon being displayed when the text field is not focused.
Resolves https://github.com/material-components/material-components-android/pull/2025
Resolves https://github.com/material-components/material-components-android/issues/2024

GIT_ORIGIN_REV_ID=19a520a8d44cbb62e307fd4dde251cd7ca97da42
PiperOrigin-RevId: 366032778
2021-03-31 10:54:43 -04:00
Amr
dd0e697aca [TextInputLayout] Fix IndexOutOfBoundsException when trying to change end icon
Resolves https://github.com/material-components/material-components-android/pull/1788
Resolves https://github.com/material-components/material-components-android/issues/1724
Resolves https://github.com/material-components/material-components-android/issues/1748

PiperOrigin-RevId: 345541684
2020-12-04 09:47:38 -05:00
rlatapy-luna
8ab270eba5 [TextInputLayout] Fixed clear text icon hide on double click
Resolves https://github.com/material-components/material-components-android/pull/1778

GIT_ORIGIN_REV_ID=add326dcc2cf85ad8c1f5354c0b6c4c6e1e31d45
PiperOrigin-RevId: 335700378
2020-10-08 15:59:57 +00:00
marianomartin
555356b03f Internal cleanup
PiperOrigin-RevId: 318134343
2020-06-26 14:06:52 -04:00
leticiars
9b0a8d90e6 [TextInputLayout] Fixed clear icon and placeholder text being displayed when the text field is initialized with input text.
Resolves https://github.com/material-components/material-components-android/issues/1379

PiperOrigin-RevId: 315317199
2020-06-08 16:28:34 -04:00
leticiars
e315754617 [TextInputLayout] Fixing end icon having unexpected behaviors when it's switched from another end icon mode.
Resolves https://github.com/material-components/material-components-android/issues/503

PiperOrigin-RevId: 312129467
2020-05-19 10:06:36 -04:00
Rafael Wolf de Goes
33700b0cd3 [TextInputLayout] Fix: merge icon and view state when setting icon color.
Resolves https://github.com/material-components/material-components-android/pull/1237
Resolves https://github.com/material-components/material-components-android/issues/1235
Resolves https://github.com/material-components/material-components-android/issues/879

GIT_ORIGIN_REV_ID=186c8f0786b57c406694501389ba31c91bc128e2
PiperOrigin-RevId: 310460890
2020-05-08 15:19:02 -04:00
leticiars
2bf42a74bb [TextInputLayout] Calling clear() instead of setting text to null in ClearTextEndIconDelegate so that TalkBack announces that text was cleared.
PiperOrigin-RevId: 299417412
2020-03-09 09:39:10 -07: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
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
cketcham
440b6e7753 Add @NonNull and @Nullable annotations
PiperOrigin-RevId: 265057396
2019-08-29 10:30:58 -04:00
leticiars
896e432945 Refactoring TextInputLayout.On*Listeners and restricting EndIconMode annotation.
PiperOrigin-RevId: 260516099
2019-07-29 16:47:05 -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
marianomartin
367b295624 Internal cleanup
PiperOrigin-RevId: 254414602
2019-06-24 17:12:42 -04:00
leticiars
b89a91c710 Animating clear button end icon.
PiperOrigin-RevId: 253852706
2019-06-24 16:45:49 -04:00
cketcham
bff75f2d3e Update to lamdas
PiperOrigin-RevId: 252846439
2019-06-18 13:21:02 -04:00
leticiars
837febea61 Adding the EditText as a parameter for onEditTextAttached().
PiperOrigin-RevId: 248218371
2019-05-16 17:17:14 -04:00
leticiars
9a53656172 Renaming clear text button drawable file for consistency.
PiperOrigin-RevId: 245057763
2019-04-29 15:35:11 -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