Created
January 4, 2017 11:24
-
-
Save rohmanhakim/4c1b554c3a7fb2493029cb99d8b17662 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Observable<Boolean> emptyFieldStream = Observable.combineLatest( | |
RxTextView.textChanges(etEmail) | |
.map(new Func1<CharSequence, Boolean>() { | |
@Override | |
public Boolean call(CharSequence charSequence) { | |
return TextUtils.isEmpty(charSequence); | |
} | |
}), | |
RxTextView.textChanges(etPassword) | |
.map(new Func1<CharSequence, Boolean>() { | |
@Override | |
public Boolean call(CharSequence charSequence) { | |
return TextUtils.isEmpty(charSequence); | |
} | |
}), | |
RxTextView.textChanges(etPasswordConfirmation) | |
.map(new Func1<CharSequence, Boolean>() { | |
@Override | |
public Boolean call(CharSequence charSequence) { | |
return TextUtils.isEmpty(charSequence); | |
} | |
}), | |
new Func3<Boolean, Boolean, Boolean, Boolean>() { | |
@Override | |
public Boolean call(Boolean emailEmpty, Boolean passwordEmpty, Boolean passwordConfirmationEmpty) { | |
return emailEmpty || passwordEmpty || passwordConfirmationEmpty; | |
} | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment