-
Notifications
You must be signed in to change notification settings - Fork 0
Conversation
startActivityForResult(intent, 1000) | ||
} | ||
|
||
private fun createAccount(email: String, password: String, emailText: TextView) { |
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.
Similar blocks of code found in 2 locations. Consider refactoring.
} | ||
} | ||
|
||
private fun signIn(email: String, password: String, emailText: TextView) { |
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.
Similar blocks of code found in 2 locations. Consider refactoring.
return auth.signInWithEmailAndPassword(email, password) | ||
} | ||
|
||
override fun createAccount(email: String, password: String): Task<AuthResult> { |
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.
Similar blocks of code found in 2 locations. Consider refactoring.
TODO("Not yet implemented") | ||
} | ||
|
||
override fun signIn(email: String, password: String): Task<AuthResult> { |
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.
Similar blocks of code found in 2 locations. Consider refactoring.
val password = findViewById<EditText>(R.id.password) | ||
val email = findViewById<TextView>(R.id.email) | ||
|
||
btCreateAcc.setOnClickListener { |
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.
Similar blocks of code found in 2 locations. Consider refactoring.
createAccount(username.text.toString(), password.text.toString(), email) | ||
} | ||
|
||
btLogIn.setOnClickListener { |
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.
Similar blocks of code found in 2 locations. Consider refactoring.
val auth: FirebaseAuth = Firebase.auth | ||
|
||
|
||
fun signIn(email: String, password: String): Task<AuthResult> { |
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.
Similar blocks of code found in 2 locations. Consider refactoring.
return auth.signInWithEmailAndPassword(email, password) | ||
} | ||
|
||
fun createAccount(email: String, password: String): Task<AuthResult> { |
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.
Similar blocks of code found in 2 locations. Consider refactoring.
startActivityForResult(intent, 1000) | ||
} | ||
|
||
private fun createAccount(email: String, password: String) { |
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.
Similar blocks of code found in 2 locations. Consider refactoring.
} | ||
} | ||
|
||
private fun signIn(email: String, password: String) { |
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.
Similar blocks of code found in 2 locations. Consider refactoring.
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.
CodeClimate remarks refactoring but I see different functionalities for these functions. Some refactoring could be done nevertheless, but looks good already to me.
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.
LGTM
Don't forget to use @string for strings and resolve conflicts before merging
@@ -50,6 +50,7 @@ dependencies { | |||
implementation 'androidx.appcompat:appcompat:1.4.1' | |||
implementation 'com.google.android.material:material:1.5.0' | |||
implementation 'androidx.constraintlayout:constraintlayout:2.1.3' | |||
implementation 'com.google.firebase:firebase-auth-ktx:21.0.1' |
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.
implementation 'com.google.firebase:firebase-auth-ktx:21.0.1' | |
implementation 'com.google.firebase:firebase-auth-ktx:21.0.2' |
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.activity_google_log_in) | ||
|
||
// val gso = GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN) |
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.
Consider adding @fixme or explain in the comment why stop using google sign in to remind us later in case
android:layout_width="200dp" | ||
android:layout_height="48dp" | ||
android:layout_marginTop="126dp" | ||
android:text="Create account" |
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.
use @string instead of hard code
Code Climate has analyzed commit 37d3ba4 and detected 6 issues on this pull request. Here's the issue category breakdown:
The test coverage on the diff in this pull request is 100.0% (80% is the threshold). This pull request will bring the total coverage in the repository to 95.1% (0.7% change). View more on Code Climate. |
Added Jiabao's proposals |
No description provided.