-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TextInputLayout] boxStrokeColor doesn't work with ColorStateLists for a variety of states. #593
Comments
This is an issue with v1.0 also. Any progress on it or temporary workaround to change the |
Just overriding the
|
This is really a BAD idea.
If you want to change the color right now create a color selector and use it to set the color:
|
Not really if you want to reflect the change everywhere for single state only. Thanks for the suggestion though! |
That's a big IF :-) better to make sure people who come across your suggestion understand it ;-) |
Tracking that PR #524 is related to this. |
This solution does not work |
The TextInputLayout does not respect defined colors. I am using a filled text input layout but the floating label, underline and cursor colors, when focused is always the colorPrimary even after trying to change it. I have tried setting the color of choice using colorControlActivated but it doesn't work |
Using boxStrokeColor makes the floating label transparent I think it uses white color because my background color is also white |
yes it does?! are you creating a COLOR selector or a drawable selector? |
@ymarian any chances of this fix entering on the |
Even with using that exact color selector (suggested above), I am not able to override the cursor color in Is it intentional that the cursor is based on |
Any updates on this? |
@amatkivskiy you should use this workaround if you want to change cursor color. |
Can we re-open this issue? Its clearly broken and the workaround doesn't work. |
Heya all, I can confirm issue is still present in So, in your layout xml:
|
Hey,
|
I can confirm this is still not working on 1.1.0 or 1.2.0-alpha06 with either the ColorSelector or setting the color to a static color. This issue needs to be reopened. |
I'm currently experiencing the same issues. I can override boxStrokeColor in the xml like so: However, doing it via code like I need does not change the boxStrokeColor: This is what my color state list looks like:
I need to override boxStrokeColor programmatically so any guidance would be greatly appreciated |
Still broken on 1.2.0-beta01. I've been waiting for the fix for a year now. |
@damon-beaven please open a separate issue about changing this cursor color. |
To all the people who say that it is still broken, can you provide more info? The fix introduced in dc88b3e was a setter to set a CSL to change the stroke color. Are you creating a CSL and calling The CSL should follow the format of @platramos if you call |
@leticiarossi That worked like a charm, thanks for the help :) |
Hi @leticiarossi, My CSL being
And my
Material 1.3.0-rc01 works with NOTE: In one case, disabling the
However, if I declare :
the [enabled=false] state is not handled - just like before, when only the [focused=false | true] state was handled. 👎 Thank you. |
Description:
According to the documentation we can change the box color of a
TextInputLayout
using the attributeboxStrokeColor
.in truth, unless this is defined as a color selector, this only alter the focused color.
It looks usually ok on white background but it's really bad in dark background.
Instead the focused color change and the non focused color stay the default, which is
mtrl_textinput_default_box_stroke_color
mtrl_textinput_disabled_color
mtrl_textinput_hovered_box_stroke_color
Expected behavior:
the
boxStrokeColor
should be taken and be used to generatedefaultStrokeColor
,focusedStrokeColor
,hoveredStrokeColor
anddisabledColor
according to https://material.io/design/interaction/states.html#anatomySource code:
Android API version:
Any. We tried on P, Q.
Material Library version:
1.1.0-alpha10
Device:
Pixel 2, Pixel 3
The text was updated successfully, but these errors were encountered: