throrin19/Android-Validator — pull request #35 by Exikle (2014-06-21 01:27:31+00:00)
Title: Development

====
Created 3 validators (MockValidator, NumericValidator and IP Validator).
### NumericValidator :
`Checks whether the field contains only numeric digits`

### IPAddressValidator :
`Checks whether the field contains a valid IP Address`

### MockValidator :
`Used by dev as a placeholder while testing validation`

====
Can now close the error using the form. Can close all errors or just one.

public void closeError(TextView sourceTextView) {
for (AbstractValidate av : mValidates) {
Validate v = (Validate) av;
if (v.getSource().equals(sourceTextView))
v.getSource().setError(null);
}
}
public void closeAllErrors() {
for (AbstractValidate av : mValidates) {
Validate v = (Validate) av;
v.getSource().setError(null);
}
}

====
Fixed up the range validator to match your other validators.

private static final int DEFAULT_ERROR_MESSAGE_RESOURCE = R.string.validator_range;

====
Made it so dev can either set the error message by resId or by specifying a string.

private int mErrorMessageRes;

private String mErrorMessageString;

public AbstractValidator(Context c, int errorMessageRes) {
mContext = c;
mErrorMessageRes = errorMessageRes;
mErrorMessageString = mContext.getString(mErrorMessageRes);
}

public AbstractValidator(Context c, String errorMessageString) {
mContext = c;
mErrorMessageString = errorMessageString;
}