Releases: Ilhasoft/data-binding-validator
Releases · Ilhasoft/data-binding-validator
2.0.0
1.0.0
Updates
- Android Build tools 3.0.0 and Gradle 4.3
- Add Apacha License
Fixes
- Fix CPF validation
Validation listener
Now you can get validation result through a ValidationListener
:
...
Validator validator = new Validator(binding);
validator.setValidationListener(this);
//Call this method to invoke listener
validator.toValidate();
...
Receive the result:
...
@Override
public void onValidationSuccess() {
saveToDatabase();
}
@Override
public void onValidationError() {
Toast.makeText(YourActivity.this, "Invalid data!", Toast.LENGTH_SHORT).show();
}
...
Validation methods for specific views
Now you can apply validation on single or multiple views:
...
Validator validator = new Validator(binding);
validator.validate(binding.nameText);
...
or
...
Validator validator = new Validator(binding);
validator.validate(Arrays.asList(binding.usernameText, binding.emailText));
...
Refactor auto dismiss behavior
The version 0.6.2 includes:
- Refactor auto dismiss binding adapter to avoid nullable parameter and receive
false
by default; - Update support libraries;