Skip to content

Commit

Permalink
Merge pull request #23 from Kyash/readme
Browse files Browse the repository at this point in the history
Updated Readme
  • Loading branch information
konifar authored Jan 18, 2018
2 parents 77b67f7 + 206b55f commit 94d0678
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
[![Build Status](https://circleci.com/gh/Kyash/validatable-textinput-layout.svg?style=shield)](https://circleci.com/gh/Kyash/validatable-textinput-layout/tree/master)
[![JitPack](https://jitpack.io/v/Kyash/validatable-textinput-layout.svg)](https://jitpack.io/#Kyash/validatable-textinput-layout)

ValidatableTextInputLayout is the view which extended TextInputLayout to validate the input text easily for .
ValidatableTextInputLayout is the view which extended TextInputLayout to validate the input text easily.

## Download

Project build.gradle
### Project build.gradle

```groovy
allprojects {
Expand All @@ -18,12 +18,12 @@ allprojects {
}
```

App build.gradle
### App build.gradle

```groovy
dependencies {
...
compile 'com.kyash.vtl:validatable-textinput-layout:LATEST_VERSION'
compile 'com.github.Kyash:validatable-textinput-layout:LATEST_VERSION'
}
```

Expand Down Expand Up @@ -76,14 +76,14 @@ focus_changed | Validate when the focus is changed
## Validators
This library provides some common validators

Validator | Screenshot
Validator | Description
:--: | :--:
RequiredValidator | ![required_validator.gif](art/required_validator.gif)
EmailValidator | ![email_validator.gif](art/email_validator.gif)
NumberOnlyValidator |
NumberOnlyValidator | Number only
AsciiOnlyValidator | ![ascii_validator.gif](art/ascii_validator.gif)
HiraganaOnlyValidator |
KatakanaOnlyValidator |
HiraganaOnlyValidator | Jananese Hieragana character
KatakanaOnlyValidator | Japanese Katakana character



Expand Down Expand Up @@ -112,7 +112,7 @@ class MaterialDesignColorsValidator(
}

override fun validate(text: String?): Boolean {
throw UnsupportedOperationException("sync method is not arrowed because this validation uses async API response.")
throw UnsupportedOperationException("Sync method is not arrowed because this validation uses async API response.")
}

override fun getErrorMessage(): String {
Expand Down
2 changes: 1 addition & 1 deletion library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def versionMajor = 0
def versionMinor = 1
def versionPatch = 0

group = 'com.kyash'
group = 'co.kyash'
version = "$versionMajor.$versionMinor.$versionPatch"

android {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ class ValidatableTextInputLayout @JvmOverloads constructor(
a.recycle()
}

val textInputAwareValidationFlowables: ArrayList<Flowable<Any>> = ArrayList()

private val textProcessor: FlowableProcessor<String> = PublishProcessor.create()

private val compositeDisposable: CompositeDisposable = CompositeDisposable()

private val validators: ArrayList<VtlValidator> = ArrayList()

private val textInputAwareValidationFlowables: ArrayList<Flowable<Any>> = ArrayList()

private val mainHandler: Handler = HandlerProvider.createMainHandler()

private val textWatcher = object : TextWatcher {
Expand Down Expand Up @@ -111,7 +111,6 @@ class ValidatableTextInputLayout @JvmOverloads constructor(
private fun initListeners() {
val editText = editText ?: return

// If the text has error, validation should run on realtime.
if (shouldValidateOnTextChanged || shouldValidateOnTextChangedOnce) {
shouldValidateOnTextChangedOnce = TextUtils.isEmpty(error)
editText.removeTextChangedListener(textWatcher)
Expand Down

0 comments on commit 94d0678

Please sign in to comment.