I have an EditText in my app that checks the user’s input on each change, and sets the text color to R.color.red_error_text
when the input is malformatted. When the input is fine again, the color should change back to the default, which depends on the currently set theme. Is there a way to unset the value, i.e. a code equivalent to clearing the textColor field in the design editor or deleting the corresponding entry from the XML?
Alternatively, can I set the text color to ?attr/textColorPrimary
from the code?
I’m aware I can query the currently set theme whenever the color should change, and then set the color manually; but then the code would have to be changed whenever a new theme is introduced or the app’s color scheme changes for some reason.
Any help would be appreciated!