Skip to content
This repository has been archived by the owner on Jan 31, 2024. It is now read-only.

Laurislopata/db refactor #130

Merged
merged 10 commits into from
Mar 31, 2022
Merged

Laurislopata/db refactor #130

merged 10 commits into from
Mar 31, 2022

Conversation

laurislopata
Copy link
Collaborator

No description provided.

@laurislopata laurislopata marked this pull request as ready for review March 31, 2022 20:51
@laurislopata laurislopata force-pushed the laurislopata/DB-refactor branch from 55414ec to d22d274 Compare March 31, 2022 21:23
*/

private fun showDialog(title: String, hint: String, id: Int, textId: Int) {
private fun showDialog(title: String, hint: String, id: Int, textId: Int, name: String) {
Copy link

Choose a reason for hiding this comment

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

Method showDialog has 5 arguments (exceeds 4 allowed). Consider refactoring.

@laurislopata
Copy link
Collaborator Author

Linked auth to user profile and edit username and handle to firebase. Commented the image loading for now to be able to test some parts, will add it next week when I work on user Sign Up form. Deleted unnecessary files that were there before firebase implementation.

Comment on lines +141 to +148
// CoroutineScope(Dispatchers.Main).launch {
// val task = async(Dispatchers.IO) {
// val bit = BitmapGetterApi.download("https://"+user.image)
// bit.get()
// }
// val bm = task.await()
// findViewById<ImageView>(R.id.avatar).setImageBitmap(bm)
// }
Copy link
Collaborator

Choose a reason for hiding this comment

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

I've seen your explanation about commenting the image load. Just wanted to comment on it so that we don't forget it in the future, if we go over the PR's

Copy link
Collaborator

@Tsathogguaa Tsathogguaa left a comment

Choose a reason for hiding this comment

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

Great job! In AuthenticationActivity at lines 89, 94 and 99 there are hardcoded strings. If you can, putting them into the strings.xml resource file and using them like that would be amazing.

@@ -127,9 +141,9 @@ class AuthenticationActivityTest {
onView(withId(R.id.username)).perform(ViewActions.typeText(username), closeSoftKeyboard())
onView(withId(R.id.password)).perform(ViewActions.typeText(password), closeSoftKeyboard())
onView(withId(R.id.createAcc)).perform(click())
Thread.sleep(sleepTime)
onView(withId(R.id.email)).check(matches(withText(randomInt.toString().plus("@gg.com"))))
Thread.sleep(1000)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe change to 1000 the sleepTime constant you defined and use that when calling Thread.sleep.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

will do!

intent.putExtra("userProfile", inputProfile)
val inputProfile = UserProfile("@lisa", "Lalisa Bon","bit.ly/3IUnyAF", "[email protected]", 12, 8, 29, 0)
val intent = Intent(ApplicationProvider.getApplicationContext(), ProfileActivity::class.java)
intent.putExtra("email", inputProfile.email)
val scn: ActivityScenario<ProfileActivity> = ActivityScenario.launch(intent)
Thread.sleep(3_000)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe use a constant for Thread.sleep calls.

Copy link
Collaborator

@zwierski zwierski left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@laurislopata
Copy link
Collaborator Author

Implemented your proposals :)

@codeclimate
Copy link

codeclimate bot commented Mar 31, 2022

Code Climate has analyzed commit 5bca5eb and detected 2 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 2

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 90.6% (-0.3% change).

View more on Code Climate.

@laurislopata laurislopata merged commit 724dddb into main Mar 31, 2022
@laurislopata laurislopata deleted the laurislopata/DB-refactor branch March 31, 2022 23:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants