Last active
July 12, 2017 07:01
-
-
Save theerasan/eec60eb9cb5ad18c3bc250660886cefd 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 LoginArch2WaysBindingViewModel : ViewModel() { | |
var email: ObservableField<String>? = ObservableField("") | |
var password: ObservableField<String>? = ObservableField("") | |
var emailOnChange = TextWatcherAdapter({s -> | |
email.set(s) | |
readyToLogin?.set(isCanLogin()) | |
}) | |
var passwordOnChange = TextWatcherAdapter({s -> | |
password.set(s) | |
readyToLogin?.set(isCanLogin()) | |
}) | |
var onClickLogin: ObservableField<View.OnClickListener>? = ObservableField() | |
var readyToLogin: ObservableField<Boolean>? = ObservableField(false) | |
private fun isCanLogin(): Boolean { | |
return TextHelper.isNotEmptyStrings(password?.get(), email?.get()) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment