After migrating to newest version of Material Components (1.1.0-alpha09
), I've noticed that TextInputLayout
has some padding horizontal padding. My goal is to achieve the old style of text fields, where there is no background or outline box. So I extended one of the styles, i.e. Widget.MaterialComponents.TextInputLayout.FilledBox
and set background color to transparent.
<style name="Widget.MyApp.TextInputLayout" parent="Widget.MaterialComponents.TextInputLayout.FilledBox.Dense">
<item name="boxBackgroundColor">@color/transparent</item>
</style>
Now the problem is that this input field looks weird in my app with such horizontal padding (which was necessary for filled or outline box).
So my question is, how can I remove this padding?
You can use something like:
Then you can define (it requires the version 1.1.0) a custom style using the
materialThemeOverlay
attribute:Here the results (with a default style and the custom style):