mirror of
https://github.com/material-components/material-components-android.git
synced 2026-02-20 08:39:55 +08:00
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
Material Components for Android
Material Components for Android (MDC-Android) help developers execute Material Design. Developed by a core team of engineers and UX designers at Google, these components enable a reliable development workflow to build beautiful and functional Android apps.
Material Components for Android is a drop-in replacement for Android's Design Support Library.
Getting Started
For information on how to get started with Material Components for Android, take a look at our Getting Started guide.
Useful Links
- All Components
- Getting Started
- Contributing
- Building From Source
- Catalog App
- Class documentation (external site)
- MDC-Android on Stack Overflow (external site)
- Android Developer’s Guide (external site)
- Material.io (external site)
- Material Design Guidelines (external site)
Documentation
Description
Languages
Java
99.9%
Kotlin
0.1%