material-components-android icon indicating copy to clipboard operation
material-components-android copied to clipboard

[TextInputLayout] Support boxBackgroundColor state for style OutlinedBox

Open pedronveloso opened this issue 5 years ago • 5 comments
trafficstars

I'm using version 1.2.0 of the library, and I can get the background of a TextInputLayout to react to changes of focused state if using the FilledBox style, but it doesn't work if using the OutlinedBox style.

pedronveloso avatar Aug 31 '20 02:08 pedronveloso

It seems a wanted result:

https://github.com/material-components/material-components-android/blob/34df6d91f1164ec981616346e7b675c1e69d4134/lib/java/com/google/android/material/textfield/TextInputLayout.java#L3917-L3926

gabrielemariotti avatar Aug 31 '20 07:08 gabrielemariotti

Why would we restrict this to only FilledBox and exclude OutlinedBox ? Specially where the former we can set a background color, but cannot have it react to changes in focus state - that seems odd.

pedronveloso avatar Sep 01 '20 17:09 pedronveloso

Why is this still not changed? Does devs does not want us to set OutlinedBox background depending on state?

Baterka avatar Aug 25 '22 17:08 Baterka

Same need however i can set the boxBackgroundColor in the xml.

After doing it, render is ugly due to the label position. I think that's why this property is not compatible with OutlinedBox.

image

stratdev3 avatar Jul 04 '24 13:07 stratdev3