###Validate Your Login Email & Password With RxBinding and Kotlin
val emailChgObs = RxTextView.textChangeEvents(etEmail).publish().autoConnect(2)
val pwdChgObs = RxTextView.textChangeEvents(etPassword)
btnLogin.isEnabled = false
var subscriptionEmailValid = emailChgObs
.filter { it.text().length > 4 }
.debounce(400, TimeUnit.MILLISECONDS)
.observeOn(AndroidSchedulers.mainThread())
.map { it.text().isEmail() }
.subscribe { showError(it) }
var subscriptionEmailPwdFilled = Observable
.combineLatest(emailChgObs, pwdChgObs) {
tvEmail, tvPwd ->
validateInputFilled(tvEmail.text().toString(), tvPwd.text().toString())
}
.subscribe { btnLogin.isEnabled = it }
####Methods
fun CharSequence.isEmail() = this.matches("[a-zA-Z0-9._-]+@[a-z]+\\.+[a-z]+".toRegex())
fun validateInputFilled(email: String, password: String) = email.isNotEmpty() && password.isNotEmpty()
fun showError(isEmail: Boolean) {
etEmail.error = if (isEmail) null else "Invalid Email"
}
###Requirement