setValidation

fun setValidation(genericErrorMessage: String?, vararg validations: EnterpriseTextInputField.ValidationType)

Provides support for commonly used error validations - see ValidationType for a list of currently supported types. If input is invalid, on editText focus loss setError will be called with the type-specific error message, or genericErrorMessage if provided (non-null).

If using in combination with a separate View.OnFocusChangeListener, first call this function to set validationFocusChangeListener and then use it as needed.

Parameters

genericErrorMessage

optional String. If provided (non-null), will take priority over all type-specific error messages.

validations

vararg of ValidationType's to be used together.