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

Jwen/go to profile on click #299

Merged
merged 33 commits into from
May 16, 2022
Merged

Jwen/go to profile on click #299

merged 33 commits into from
May 16, 2022

Conversation

jiabaow
Copy link
Collaborator

@jiabaow jiabaow commented May 15, 2022

Screen Shot 2022-05-16 at 15 01 26

Now if the user clicks on a player in scoreboard/search user, he can see the player's profile.
(similar to user profile except it cannot be edited)
The scores are displayed by default if he goes from the scoreboard.
Similar things will happen for search users in my next PR.
The coverage is only 79%, but I tested all the new functions I added, so it should not decrease the total much.

* @param textId id of the text in the dialog
* @param name of the dialog
*/
private fun showTextDialog(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 showTextDialog has 5 arguments (exceeds 4 allowed). Consider refactoring.

@jiabaow jiabaow marked this pull request as ready for review May 16, 2022 12:58
@jiabaow jiabaow self-assigned this May 16, 2022
Copy link
Collaborator

@kamilababayeva kamilababayeva left a comment

Choose a reason for hiding this comment

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

The changes look good to me! Thank you for the separation of adapter functions. From the UI point of view, I believe it would be better to display the user's profile (the on clicked in the search) as a popup with a button close in the left upper corner. Creating a new activity to display user's profile is a little heavy. But we can change it in the next pr!


private fun createMockImageGetter() {
every {mockImageGetter.fetchImage(any(), any())} answers {
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
}

}

private fun createMockImageGetter() {
every {mockImageGetter.fetchImage(any(), any())} answers {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
every {mockImageGetter.fetchImage(any(), any())} answers {
every {mockImageGetter.fetchImage(any(), any())} answers {}

}
every {mockUsersRepo.getCurrentUser()} answers {
null
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
}

secondArg<(User) -> Unit>().invoke(mockProfile)
}
every {mockUsersRepo.getCurrentUser()} answers {
null
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
null

every { mockUsersRepo.getUserData(any(), any()) } answers {
secondArg<(User) -> Unit>().invoke(mockProfile)
}
every {mockUsersRepo.getCurrentUser()} answers {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
every {mockUsersRepo.getCurrentUser()} answers {
every {mockUsersRepo.getCurrentUser()} answers { null }

@kamilababayeva
Copy link
Collaborator

Also, the other reason to make it as a popup, is cause now every time the profile is open, and return button is pressed, it goes back to the main actvity (not SearchUserActivity or ScoreBoardActivity)

@jiabaow
Copy link
Collaborator Author

jiabaow commented May 16, 2022

The changes look good to me! Thank you for the separation of adapter functions. From the UI point of view, I believe it would be better to display the user's profile (the on clicked in the search) as a popup with a button close in the left upper corner. Creating a new activity to display user's profile is a little heavy. But we can change it in the next pr!

I didn't think about using a popup, but that seems to be a good idea, we can discuss that in detail during the next meeting.

@jiabaow
Copy link
Collaborator Author

jiabaow commented May 16, 2022

Also, the other reason to make it as a popup, is cause now every time the profile is open, and return button is pressed, it goes back to the main actvity (not SearchUserActivity or ScoreBoardActivity)

That's true, but I thought the red return button is designed to go back to the main, we can go back to the scoreboard using the default back button of the device.

Copy link
Owner

@MaximeZmt MaximeZmt left a comment

Choose a reason for hiding this comment

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

Nice work ! 👍
Just found somewhere with missing docs

Comment on lines 10 to 11

class AdapterHelper {
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
class AdapterHelper {
/**
* Missing Docs
*/
class AdapterHelper {

Copy link
Owner

Choose a reason for hiding this comment

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

Also missing in functions below

@jiabaow jiabaow requested a review from MaximeZmt May 16, 2022 14:28
Copy link
Owner

@MaximeZmt MaximeZmt left a comment

Choose a reason for hiding this comment

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

👍

@codeclimate
Copy link

codeclimate bot commented May 16, 2022

Code Climate has analyzed commit b940e98 and detected 3 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 1
Duplication 2

The test coverage on the diff in this pull request is 79.4% (80% is the threshold).

This pull request will bring the total coverage in the repository to 82.4%.

View more on Code Climate.

@jiabaow jiabaow merged commit 6c35861 into main May 16, 2022
@jiabaow jiabaow deleted the jwen/go-to-profile-onClick branch May 16, 2022 17:08
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.

add a button that leads the user to someone else's profile page in search user activity and scoreboard. (#290)
3 participants