TextInputLayout.setError() leaves empty space after clearing the error
Check out the docs for
public void setErrorEnabled (boolean enabled)
It says
Whether the error functionality is enabled or not in this layout. Enabling this functionality before setting an error message via setError(CharSequence), will mean that this layout will not change size when an error is displayed.
Well based on this, try setting setErrorEnabled(true)
before setError()
, and, set setErrorEnabled(false)
after setError(null)
.
Method setErrorEnabled(false)
will clear the extra space, so call it after setError(null)
.