New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changed responsiveness of Login button based on emptiness of field #78
Conversation
|
||
binding.etUsername.addTextChangedListener(object : TextWatcher{ | ||
override fun afterTextChanged(p0: Editable?) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no need for the blank line here.
login_btn.alpha = 1.0F | ||
login_btn.isEnabled = true | ||
} | ||
else{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
else{ | |
else { |
if(et_password.text.toString().isNotEmpty() && et_username.text.toString().isNotEmpty()) { | ||
login_btn.alpha = 1.0F | ||
login_btn.isEnabled = true | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | |
} else { |
|
||
binding.etPassword.addTextChangedListener(object : TextWatcher{ | ||
override fun afterTextChanged(p0: Editable?) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for the blank line.
} | ||
|
||
override fun beforeTextChanged(p0: CharSequence?, p1: Int, p2: Int, p3: Int) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for the blank line.
if(et_password.text.toString().isNotEmpty() && et_username.text.toString().isNotEmpty()) { | ||
login_btn.alpha = 1.0F | ||
login_btn.isEnabled = true | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same changes as above should be made here too.
Continued in #91 |
Fixes #77
Login button becomes responsive only when both the username and password fields are not empty, otherwise it remains translucent and disabled