9 Commits

Author SHA1 Message Date
Material Design Team
390a7acbf8 Causes TextInputLayout to expose its AccessibilityNodeInfo as contentInvalid if its character counter has overflowed
PiperOrigin-RevId: 198481505
2018-05-30 17:41:46 -04:00
afohrman
bdb25ff7e3 Use android:padding attributes instead of boxPadding attributes for text field dimensions.
Move to use native android:padding attrs instead of custom boxPadding attributes for text fields. This is accomplished by creating box styles for TextInputEditText, and setting android:padding attributes in those.

The TextInputLayout box styles set the appropriate TextInputEditText style on its child by wrapping the TextInputEditText style in theme overlays. This is kind of neat, since it allows for the user not to have to set a style on both the TextInputLayout and TextInputEditText - the user does not even have to know about the TextInputEditText styles with this pattern. It should also help clear up some confusion over where to set the hint and other areas of haziness between TextInputLayout and TextInputEditText.

The default editTextStyle is set to the filled box style, to match the default TextInputLayout style.

This change removes the box padding attributes, and it also removes the dimension resources in favor of setting them in the style to improve readability.

This commit also changes TextInputEditText constructors to both use a theme attribute in the 3-arg constructor and call through to the TextInputEditText overloaded constructors rather than call the super's constructor from each. This allows the theme attribute set in the theme overlays to take effect.

PiperOrigin-RevId: 198051251
2018-05-30 17:35:13 -04:00
Material Design Team
3e20d0720f Hide TextInputLayout from accessibility services and instead mirror its attributes on its EditText.
PiperOrigin-RevId: 197509011
2018-05-22 13:59:17 -04:00
afohrman
1cad4007dc Roll forward box background fix.
PiperOrigin-RevId: 197041463
2018-05-17 19:45:46 -04:00
afohrman
4700966a38 Roll back box background changes.
PiperOrigin-RevId: 196762626
2018-05-16 11:49:37 -04:00
afohrman
e566a535ac Ensure box background is drawn behind other text field elements.
This commit:
- Moves the draw calls in TextInputLayout#draw to happen in a better order: now, the background is drawn first, then TextInputLayout and its children, then the hint. This prevents the box from drawing on top of other text field elements.
- Updates box background setters and getters to modify boxBackgroundColor instead of defaultBoxBackgroundColor.
- Adds a demo for filled box background color changes to the text field demo.

PiperOrigin-RevId: 196748102
2018-05-16 11:48:54 -04:00
afohrman
886853babb Use start/end for TextInputLayout attributes.
Change attributes, setters, getters, resources, and tests for corner radii and box padding to use start/end instead of left/right. The goal is to make TextInputLayout more RTL friendly; beforehand, RTL use cases would have to directly call padding and corner radii methods with RTL values. After this change, TextInputLayout will determine whether it is in RTL mode and apply the relevant attributes appropriately.

PiperOrigin-RevId: 193565849
2018-04-30 11:35:26 -04:00
afohrman
2eb1f951fc Add feedback when character counter limit is exceeded.
This commit adds feedback once the character counter limit is exceeded (ex: 11/10), and backs off for every other case to avoid spamming the user.

Also adds a content description with a detailed message to the counter view to make it clear what the overflow is.

PiperOrigin-RevId: 193397006
2018-04-30 11:31:45 -04:00
dniz
9ca33544ac Update package name to com.google.android.material
PiperOrigin-RevId: 193236235
2018-04-30 11:24:23 -04:00