How can I change the colour of the error message that can be set to appear below the text field in a TextInputLayout (via setError(...) – see error
One side note. I have tried the accepted solution one with errorTextAppereance.
It works really good but at first, the input underline color was not changing after applying a new errorTextAppereance style. I see there are a few comments and that other people are experiencing the same issue.
In my case, this was happening when I was setting a new style after setting a new error text. Like this:
passwordInputLayout.error = "Password strength"
passwordInputLayout.setErrorTextAppearance(R.style.InputError_Purple)
After switching the order of this two methods the text and underline color changes as expected.
passwordInputLayout.setErrorTextAppearance(R.style.InputError_Purple)
passwordInputLayout.error = "Password strength"
And the error text appearance style looks something like this: