code: 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();
          }
      }
docs: 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.
  
  @param shouldShowError whether or not we should display text in an error state.