Skip to content
This repository has been archived by the owner on Apr 24, 2023. It is now read-only.

Releases: mlykotom/valifi

Form of forms + bugfix

14 Nov 21:59
Compare
Choose a tag to compare

Form of forms

  • you can now create form containing other form!
  • useful when having some multi-step UI and want to validate each part separately, but overall as well.
  • you can mix form with fields

Usage:

public class MyViewModel extends ViewModel {
  public final field1 = ValiFieldText();
  public final field2 = ValiFieldText();
  public final subForm = ValiFiForm(field1, field2);

  public final field3 = ValiFieldText();

  // you can even mix form with fields (e.g. some "accept terms" checkbox?)
  public final overallForm = ValiFiForm(subForm, field3);
}

Bug fixes

  • fixed a bug, when field wouldn't be isValid() when belonging to a form in databinding (form.valid would be called properly, but field.valid wouldn't)

Migration to androidx!

26 Nov 14:22
df68fc5
Compare
Choose a tag to compare

Since this release, the library uses androidx instead of android support dependency.
Please, if you need android.support, refer to older versions of the library.

Changelog:

  • support lib updated to 28.0 (= androidx 1.0)
  • updated gradle build files

Add global validation, setting temporal error, manual validation

21 Sep 13:43
fc84da1
Compare
Choose a tag to compare
  • Add global validator which may be used instead of existing email, phone, etc. validators
  • Field now may set custom error (e.g. message from network) which doesn't change validation and will be replaced with validation error when input changes
  • manual triggering of validation possible

Field is changed in construction flag

30 Apr 11:46
Compare
Choose a tag to compare

Add constructor which makes possible to set default value without marking the field as changed (and thus not validating it in construction). This is useful e.g. when loading data from network and wanting the field to be clear, but "invalid". This is backwards compatible - only new constructor added.

Fixes testability

09 Jan 08:51
Compare
Choose a tag to compare

Removes protected method getContext() which made testing impossible because specific validators were using string resources as errors.

If you used getContext().getString() in your custom fields, you may use getString() method which for tests returns "string-[resource-id]".

Also there are new install() methods for tests (don't need Context).

Adds remove validator

14 Aug 14:42
Compare
Choose a tag to compare

Provides methods:

  • removeValidator()
  • removeAsyncValidator()

which may remove validator and keep the field without reset.

Adds reset()

14 Aug 14:40
Compare
Choose a tag to compare

Adds reset() method on field or form which is useful e.g. after submit of form.
The role is to clear the field and be able to use it again from scratch.

Adds ValiFiValidable interface

14 Jul 21:03
Compare
Choose a tag to compare

Updates IValidable so that it can have destroy() method.

Adds getting/setting number value

14 Jul 20:42
Compare
Choose a tag to compare
1.1.1

Adds getter and setter for number type

Credit Cards, Numbers and Async validation

07 May 21:09
Compare
Choose a tag to compare

Adds new API

  • ValiFieldCard for validating credit cards
  • ValiFieldNumber for validating numbers (Long, Int, Double and Float are implemented)
  • Adds asynchronous validation which may be lasting longer and blocking UI