0

I tried this solution like added attributes in main theme but unable to change color of bottom line in TextInputLayout, by default its taking up color of status bar (its probably called primarydark), also I dont want to change color of bottom line when error text appear below TextInputLayout meaning instead of changing red when error occurs it should be of that color when it gets focus

blackHawk
  • 6,047
  • 13
  • 57
  • 100

1 Answers1

0

When there is any error occur and you want to reset your editText and your bottom line color, then just use below code

textInputLayout.setError(null);
                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
                    textEditText.getBackground().setColorFilter(getResources().getColor(R.color.your_color,getTheme()), PorterDuff.Mode.SRC_ATOP);
                }else {
                    //noinspection deprecation
                    textEditText.getBackground().setColorFilter(getResources().getColor(R.color.your_color), PorterDuff.Mode.SRC_ATOP);
                }
shahid17june
  • 1,441
  • 1
  • 10
  • 15