Created
July 10, 2017 19:01
-
-
Save theerasan/087879c7e38f720434be59497daa473a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
class LoginDataBindingViewModel : BaseObservable() { | |
@get:Bindable | |
var email: String? = "" | |
set(email) { | |
field = email | |
notifyPropertyChanged(BR.email) | |
notifyPropertyChanged(BR.readyToLogin) | |
} | |
@get:Bindable | |
var password: String? = "" | |
set(password) { | |
field = password | |
notifyPropertyChanged(BR.password) | |
notifyPropertyChanged(BR.readyToLogin) | |
} | |
@get:Bindable | |
var onClickLogin: View.OnClickListener? = null | |
set(onClickLogin) { | |
field = onClickLogin | |
notifyPropertyChanged(BR.onClickLogin) | |
} | |
@get:Bindable | |
var readyToLogin: Boolean? = false | |
get() { | |
val notEmptyStrings = TextHelper.isNotEmptyStrings(email, password) | |
return notEmptyStrings | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment