Skip to content

Authentication edit#10

Open
Fr1x3 wants to merge 5 commits into
2tanayk:masterfrom
Fr1x3:authentication-edit
Open

Authentication edit#10
Fr1x3 wants to merge 5 commits into
2tanayk:masterfrom
Fr1x3:authentication-edit

Conversation

@Fr1x3
Copy link
Copy Markdown
Contributor

@Fr1x3 Fr1x3 commented Apr 22, 2021

managed to control button state and do some minor refactoring in login/register fragments. Criteria used to determine state is that the text fields should be filled.

@2tanayk
Copy link
Copy Markdown
Owner

2tanayk commented Apr 23, 2021

will review it shortly!

Copy link
Copy Markdown
Owner

@2tanayk 2tanayk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey first and foremost a big thanks to your changes it looks fine and really loved your approach!,
Can you make the changes as requested in the review? Hope to get this merged soon!

): View? {
// Inflate the layout for this fragment
val view = inflater.inflate(R.layout.fragment_login, container, false)
return inflater.inflate(R.layout.fragment_login, container, false)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

although this gets rid of the boilerplate and redundancy, I prefer val view = inflater.inflate(R.layout.fragment_login, container, false) , just incase one needs to instantiate some view from the layout. So can you change it back to the way it was before?

if (TextUtils.isEmpty(email) || TextUtils.isEmpty(password)) {
Toast.makeText(activity, "Some Field is Empty!", Toast.LENGTH_SHORT).show()
return
return false
Copy link
Copy Markdown
Owner

@2tanayk 2tanayk Jun 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since you have disabled the sign in button on an empty email/password, this if statement is effectively redundant so can you remove it?
And really sorry for the delay was caught up with a lot of work :/

}

//textwatcher
private val textWatcher = object : TextWatcher {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you use intuitive and specific names like signInTextWatcher for the sake of code maintenance?

): View? {
// Inflate the layout for this fragment
val view = inflater.inflate(R.layout.fragment_register, container, false)
return inflater.inflate(R.layout.fragment_register, container, false)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as before here, so can you make the requested changes?

}

//textwatcher
val textWatcher : TextWatcher = object : TextWatcher{
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as before here too,use a specific name


// make function independent
private fun validate(name: String, email: String, password: String, confirmPassword: String) : Boolean {
if (TextUtils.isEmpty(name) || TextUtils.isEmpty(email) || TextUtils.isEmpty(password) || TextUtils.isEmpty(
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as before, this is redundant now and must be removed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants