Closed EinNarr closed 2 years ago
I think this is a duplicate of https://github.com/material-components/material-components-android/issues/366. Can you try the workarounds mentioned there for now? (Finding the icon view and setting margins on it)
I am afraid it is not a handy way in my case. I am trying to provide a modified style set upon M3 styles to all my teams to give all our apps a unified appearance. I would have to make it a new class inheriting TextInputLayout, all telling my collegues to set a margin before use.
Would you be able to try this workaround?
<style name="Widget.MyApp.TextInputLayout.OutlinedBox" parent="Widget.Material3.TextInputLayout.OutlinedBox">
<item name="materialThemeOverlay">@style/ThemeOverlay.MyApp.TextInputEditText.OutlinedBox</item>
</style>
<style name="ThemeOverlay.MyApp.TextInputEditText.OutlinedBox" parent="ThemeOverlay.Material3.TextInputEditText.OutlinedBox">
<item name="imageButtonStyle">@style/Widget.MyApp.TextField.ImageButton</item>
</style>
<style name="Widget.MyApp.TextField.ImageButton" parent="Widget.AppCompat.ImageButton">
<item name="android:paddingLeft">8dp</item>
<item name="android:paddingRight">8dp</item>
</style>
It will add an extra 8dp of padding to both the start and end icons.
I think this is a duplicate of #366. Can you try the workarounds mentioned there for now? (Finding the icon view and setting margins on it)
it doesn't work, the 4dp margin will always be there
Is your feature request related to a problem? Please describe. Although the paddings of the EditText is editable, they are overwritten by code when start/end icon is shown. If I modify the shape of the TextField box, the positioning of the icon could be too close to the edge when the corner size gets larger.
Describe the solution you'd like May I kindly ask for attributes that could control the padding with icons? Or maybe make the calculation in the java code relevant with the padding set on the EditText?
Describe alternatives you've considered Maybe make the whole start/end-icon layout customizable?