118 Commits

Author SHA1 Message Date
leticiars
d5b2d818c3 Fixing crash happening when password toggle is clicked without the edit text having focus in TalkBack mode.
PiperOrigin-RevId: 286590576
(cherry picked from commit 8ed0ab79647374eef3d6b6d2270a00a4f0645803)
2020-01-17 14:08:45 -05:00
leticiars
6df6a92070 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
(cherry picked from commit 27f7f4c6bacbf94fb31cb48a79723b9b66097ff0)
2019-11-07 10:49:37 -05:00
leticiars
195b176cd9 Error icon should only be visible if error is enabled.
Resolves https://github.com/material-components/material-components-android/issues/587

PiperOrigin-RevId: 276153474
(cherry picked from commit d0307dc9749c3f96043d1f21aea51ed2a0f19a36)
2019-11-07 10:12:05 -05:00
cketcham
53e181b82d 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
(cherry picked from commit 0547d2a06bfa636990c99c74a7a16e02cef41647)
2019-10-04 15:38:10 -04:00
afohrman
d3ef78f55b Fix issues with javadocs.
PiperOrigin-RevId: 269825611
2019-10-03 15:50:23 -04:00
leticiars
0e410d482a Fixing ExposedDropdownMenu crash when device is rotated.
Resolves https://github.com/material-components/material-components-android/issues/561

PiperOrigin-RevId: 268753819
2019-10-03 15:50:23 -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
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
Antonin Fouques (CmoaToto)
ccb7fbe8b3 Simplify Meizu fix by forcing creation of a hintLayout
GIT_ORIGIN_REV_ID=5545bb3920a651e8a2e1f1a0586fbecdad7c55bb

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

PiperOrigin-RevId: 248391866
2019-05-16 17:25:11 -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
650c8ae063 Fixing typo in dropdown content description string.
PiperOrigin-RevId: 247306870
2019-05-16 12:36:32 -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
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
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
afohrman
4476564820 Vertically center the filled text field's expanded label.
PiperOrigin-RevId: 241791031
2019-04-05 15:46:27 -04:00