form-validator
alexfu
28
Visit GitHub RepoValidation

form-validator

A simple, easy to use, no frills, form validator for Android.

Usage

EmailRule emailRule = new EmailRule("Invalid email address.");

Validator validator = new Validator();
validate.setCallback(this);
validator.addRule(myEditText, emailRule); // Add rules to your EditText
validator.validate();

If you want to have multiple rules...

EmailRule emailRule = new EmailRule("Invalid email address.");
MinLengthRule minLengthRule = new MinLengthRule(5, "Must be at least 5 characters long.")

Validator validator = new Validator();
validate.setCallback(this);
validator.addRule(myEditText, emailRule, minLengthRule); // Add rules to your EditText
validator.validate();

Adding rules will also bind a TextWatcher to the given EditText and validate it on the fly.

Installation

allprojects {
  repositories {
    maven { url 'https://jitpack.io' }
  }
}

dependencies {
  compile 'com.github.alexfu:form-validator:1.0'
}

Rx

Fancy an Rx API? Take a look at form-validator-rx.

Become a better Android Developer
Millions of developers are learning at MindOrks

Online Training Program

Featured Blogs

Our Team

MindOrks is Certainly one of the best online blog to stay on top of all the Android development news, coding and design patterns. Finally a blog I can count on to keep myself updated with latest and greatest things happening in Android world.

Vipul Shah
Android Developer
Microsoft

Become Pro in Android by watching videos

OUR LEARNERS WORK AT