All Projects → KucherenkoIhor → RxValidationTextInputLayout

KucherenkoIhor / RxValidationTextInputLayout

Licence: other
The easiest way to bring validation to your project

Programming Languages

kotlin
9241 projects
java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to RxValidationTextInputLayout

APK-Downloader
Download latest version of android apps and games from Google Play.
Stars: ✭ 54 (+20%)
Mutual labels:  regex
AndroidTutorials
Ejemplos Android [Dagger2,RxJava,MVP,Retrofit2,SQLite]
Stars: ✭ 22 (-51.11%)
Mutual labels:  rxjava
RxProperty
RxJava binding APIs for observable fields and observable collections from the Data Binding Library
Stars: ✭ 17 (-62.22%)
Mutual labels:  rxjava
librxvm
non-backtracking NFA-based regular expression library, for C and Python
Stars: ✭ 57 (+26.67%)
Mutual labels:  regex
fauton
An ecosystem of packages to work with automaton and parsers (dfa/nfa/e-nfa/regex/cfg/pda)
Stars: ✭ 36 (-20%)
Mutual labels:  regex
RxLocation
Use with rxjava,No memory leak,Simple
Stars: ✭ 52 (+15.56%)
Mutual labels:  rxjava
renameit
Rename-It! is a Windows software to safely rename of thousands of files and folders at once via regex and all kind of other renaming filters. See the wiki section for more details.
Stars: ✭ 94 (+108.89%)
Mutual labels:  regex
RgxGen
Regex: generate matching and non matching strings based on regex pattern.
Stars: ✭ 45 (+0%)
Mutual labels:  regex
rxjava2-http
Transmit RxJava2 Flowable over http with non-blocking backpressure
Stars: ✭ 19 (-57.78%)
Mutual labels:  rxjava
smtplib-bruteforce
bruteforcing gmail (TLS/SSL)
Stars: ✭ 26 (-42.22%)
Mutual labels:  regex
ReactiveConnectivity
ReactiveConnectivity - a library for Listen Connectivity Change on Android
Stars: ✭ 22 (-51.11%)
Mutual labels:  rxjava
rxactivitylauncher
Provide a way to receive the results of the Activity by RxJava.
Stars: ✭ 19 (-57.78%)
Mutual labels:  rxjava
AsyncChain
异步链式库,类似RXJava,可以用于切换主线程,或者执行一串相互依赖的任务
Stars: ✭ 17 (-62.22%)
Mutual labels:  rxjava
one-more-re-nightmare
A fast regular expression compiler in Common Lisp
Stars: ✭ 104 (+131.11%)
Mutual labels:  regex
RxCamera2
Rx Java 2 wrapper for Camera2 google API
Stars: ✭ 27 (-40%)
Mutual labels:  rxjava
lc-data-intro
Library Carpentry: Introduction to Working with Data (Regular Expressions)
Stars: ✭ 16 (-64.44%)
Mutual labels:  regex
cheat-sheet-pdf
📜 A Cheat-Sheet Collection from the WWW
Stars: ✭ 728 (+1517.78%)
Mutual labels:  regex
SQLitePractice
数据库案例:1.使用时间和日期函数,增,查时间字段。2.利用ContentProvider,CursorLoader,SQLite实现数据库的观察者模式。3.RxJava,SQLBrite实现数据库的观察者模式。4.拷贝外部db文件到数据库中
Stars: ✭ 21 (-53.33%)
Mutual labels:  rxjava
nakadi-java
🌀 Client library for the Nakadi Event Broker (examples: http://bit.ly/njc-examples, site: https://dehora.github.io/nakadi-java/)
Stars: ✭ 29 (-35.56%)
Mutual labels:  rxjava
relint
General purpose RegEx based file linter.
Stars: ✭ 33 (-26.67%)
Mutual labels:  regex

RxValidationTextInputLayout

The easiest way to bring validation to EditText with TextInputLayout.

Getting Started

Add dependency to your project using JitPack

allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}
dependencies {
		implementation 'com.github.KucherenkoIhor:RxValidationTextInputLayout:0.2.2'
}

Using in XML:

     <com.kucherenko.RxValidationTextInputLayout
                android:id="@+id/tilFirstName"
                style="@style/TextInputLayout.Counter"
                android:layout_marginTop="@dimen/margin_l"
                app:layout_constraintLeft_toLeftOf="parent"
                app:layout_constraintRight_toRightOf="parent"
                app:layout_constraintTop_toBottomOf="parent"
                app:help="at least 3 letters"
                app:error="@string/invalid_first_name"
                app:errorTextAppearance="@style/TextAppearance.AppCompat.Small.Error"
                app:helperTextAppearance="@style/TextAppearance.AppCompat.Small.Helper"
                app:regex="@string/regex_name">
    
                <android.support.design.widget.TextInputEditText
                    android:id="@+id/etFirstName"
                    style="@style/EditText.SingleLine"
                    android:hint="@string/hint_first_name"
                    android:imeOptions="actionNext"
                    android:inputType="textPersonName" />
    
            </com.kucherenko.RxValidationTextInputLayout>

And get simple boolean result using RxJava2 in Java code:

 tilFirstName.onReady = { observable ->  
            disposable = observable.subscribe { isValid ->
                btnSignIn.isEnabled = isValid
            }
        }

Features

  • Reactive approach using RxJava2:
tilFirstName.onReady = { observable ->
            disposable = observable.subscribe { isValid ->
                btnSignIn.isEnabled = isValid
            }
        }
  • Or if you want to observe several fields:
val textInputLayouts = arrayOf(
                tilFirstName,
                tilLastName,
                tilEmail,
                tilPhone,
                tilYear,
                tilDob,
                tilPassword,
                tilConfirmPassword)

        RxValidationTextInputLayout.combineOnReady(*textInputLayouts) { observable ->
            disposable = observable
                   .debounce { Observable.timer(if (it) 500L else 0L, TimeUnit.MILLISECONDS) }
                   .subscribe { btnSignIn.isEnabled = it }
        }

  • Simple regex support: app:regex="@string/regex_name"
  • You can change configuration as you need:
    • You can allow empty state of input field: app:allowEmpty="true"
    • Or disable error showing when filed is empty app:showErrorIfEmpty="true"
  • Compare input with another one app:equalEditText="@id/etPassword". It's useful for password and confirm password fields:

  • Helper text according to Material Design Guidelines

    app:help="Must be the same with password"

  • Error text appears if input text lose focus: app:error="@string/invalid_password"

  • Custom text styles for help and error states: app:errorTextAppearance="@style/TextAppearance.AppCompat.Small.Error" app:helperTextAppearance="@style/TextAppearance.AppCompat.Small.Helper"

Changelog

Version: 0.2.1

  • Improved equal edit text functionality

Version: 0.1.3

  • Fixed onReady issues

Version: 0.1.2

  • Added the methods to trigger error text immediately

Licenses

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].