Validator
A tool to validate text inside TextInputLayout.
Download
Step 1. Add it in your root build.gradle at the end of repositories:
Step 2. Add the dependency
Usage
Available rules
- LengthRule
- MaxRule
- MinRule
- NotEmptyRule
- NotNullRule
- RegexRule
- AlphabetRule
- AlphanumericRule
- DigitsRule
- EmailRule
- PasswordRule
- FutureRule
- PastRule
- CreditCardRule
- ContainRule
- NotContainRule
- EqualRule
- NotEqualRule
Additional predefined rules to use in Validation or Condition
- contain
- notContain
- notEqualTo
- withinRange
- minimumLength
- maximumLength
- alphanumericOnly
- alphabetOnly
- digitsOnly
- symbolsOnly
- allUppercase
- allLowercase
- startsWith
- endsWith
- withCreditCard
- withPassword
- matchAtLeastOneRule (Only for Validation)
- matchAllRules (Only for Validation)
You can create your own Predefined Rules
Beside from using the provided Rules, you can create your own Rule by extending BaseRule (Create as many as you want)
Add it to your Activity class
Condition
Mode
Single | Continuous |
---|---|
![]() |
![]() |