Reputation: 43
I have created a login activity with AutoCompleteTextView components for email and password. Once getting auto completed, these fields are getting highlighted. How do I disable this highlighting? Could not find any relevant property for this one.
form inputs are getting highlighted screenshot
Upvotes: 1
Views: 1096
Reputation: 43
Although it's been a while, I finally found the proper answer. This highlight is due to Android's Autofill Framework.
To override the highlight setting -
Upvotes: 3
Reputation: 43
Sadly, I couldn't find any solution via design properties (styles/ layout properties etc.).
I had to use a workaround, which is not the prettiest - but got it done:
mPasswordView.addTextChangedListener(textWatcherWorkAround);
// til is the TextInputLayout wrapping my EditText til.setBackground(getResources().getDrawable(android.R.color.transparent)); mPasswordView.removeTextChangedListener(this); mEmailView.removeTextChangedListener(this); // To avoid infinite loop String original = mPasswordView.getText().toString(); mPasswordView.setText(original + " "); mPasswordView.addTextChangedListener(this); // To next time
It ain't pretty, please let me know if you find any, straight-forward, better approach. For now - I hope it helps who ever encountered this one!
Upvotes: 0