public void setShouldShowError ( boolean shouldShowError ) { if ( mErrorMessage != null && mErrorMessageListener != null ) { String errorMessage = shouldShowError ? mErrorMessage : null ; mErrorMessageListener . displayErrorMessage ( errorMessage ) ; mShouldShowError = shouldShowError ; } else { mShouldShowError = shouldShowError ; if ( mShouldShowError ) { setTextColor ( mErrorColor ) ; } else { setTextColor ( mCachedColorStateList ) ; } refreshDrawableState ( ) ; } }
Sets whether or not the text should be put into error mode which displays the text in an error color determined by the original text color .