-
Notifications
You must be signed in to change notification settings - Fork 0
Conversation
} | ||
|
||
private fun setGenreListeners(){ | ||
vmGameSetup.view.findViewById<Button>(R.id.kpopButton).setOnClickListener { chooseGenre(method = LastfmMethod.BY_TAG.method, tag = "kpop", mode = R.string.kpop) } |
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 5 locations. Consider refactoring.
|
||
private fun setGenreListeners(){ | ||
vmGameSetup.view.findViewById<Button>(R.id.kpopButton).setOnClickListener { chooseGenre(method = LastfmMethod.BY_TAG.method, tag = "kpop", mode = R.string.kpop) } | ||
vmGameSetup.view.findViewById<Button>(R.id.rockButton).setOnClickListener { chooseGenre(method = LastfmMethod.BY_TAG.method, tag = "rock", mode = R.string.rock) } |
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 5 locations. Consider refactoring.
private fun setGenreListeners(){ | ||
vmGameSetup.view.findViewById<Button>(R.id.kpopButton).setOnClickListener { chooseGenre(method = LastfmMethod.BY_TAG.method, tag = "kpop", mode = R.string.kpop) } | ||
vmGameSetup.view.findViewById<Button>(R.id.rockButton).setOnClickListener { chooseGenre(method = LastfmMethod.BY_TAG.method, tag = "rock", mode = R.string.rock) } | ||
vmGameSetup.view.findViewById<Button>(R.id.btsButton).setOnClickListener { chooseGenre(method = LastfmMethod.BY_ARTIST.method, artist = "BTS", mode = R.string.gameGenre_bts) } |
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 5 locations. Consider refactoring.
vmGameSetup.view.findViewById<Button>(R.id.rockButton).setOnClickListener { chooseGenre(method = LastfmMethod.BY_TAG.method, tag = "rock", mode = R.string.rock) } | ||
vmGameSetup.view.findViewById<Button>(R.id.btsButton).setOnClickListener { chooseGenre(method = LastfmMethod.BY_ARTIST.method, artist = "BTS", mode = R.string.gameGenre_bts) } | ||
vmGameSetup.view.findViewById<Button>(R.id.topTracksButton).setOnClickListener { chooseGenre(method = LastfmMethod.BY_CHART.method, mode = R.string.top_tracks) } | ||
vmGameSetup.view.findViewById<Button>(R.id.imagDragonsButton).setOnClickListener{ chooseGenre(method = LastfmMethod.BY_ARTIST.method, artist = "Imagine Dragons", mode = R.string.gameGenre_imagine_dragons) } |
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 5 locations. Consider refactoring.
vmGameSetup.view.findViewById<Button>(R.id.btsButton).setOnClickListener { chooseGenre(method = LastfmMethod.BY_ARTIST.method, artist = "BTS", mode = R.string.gameGenre_bts) } | ||
vmGameSetup.view.findViewById<Button>(R.id.topTracksButton).setOnClickListener { chooseGenre(method = LastfmMethod.BY_CHART.method, mode = R.string.top_tracks) } | ||
vmGameSetup.view.findViewById<Button>(R.id.imagDragonsButton).setOnClickListener{ chooseGenre(method = LastfmMethod.BY_ARTIST.method, artist = "Imagine Dragons", mode = R.string.gameGenre_imagine_dragons) } | ||
vmGameSetup.view.findViewById<Button>(R.id.billieEilishButton).setOnClickListener { chooseGenre(method = LastfmMethod.BY_ARTIST.method, artist = "Billie Eilish", mode = R.string.gameGenre_billie_eilish) } |
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 5 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.
LGTM 👍 Great Job ! Hope it will improve stability!
There is one minor typo that you can correct and two refactor that you may do if you have some time.
app/src/main/java/ch/sdp/vibester/fragment/SearchUserFragment.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/ch/sdp/vibester/fragment/ScoreBoardFragment.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/ch/sdp/vibester/fragment/SearchUserFragment.kt
Outdated
Show resolved
Hide resolved
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.
Good work overall! Just the intentSwitcher stuff that can be changed around, but it's not as severe to complete ASAP. If you have time, would be great to adapt them!
vmScoreBoard.view = view | ||
vmScoreBoard.ctx = view.context | ||
|
||
view.findViewById<Button>(R.id.scoreboard_kpopButton).setOnClickListener { setGenreListeners("Kpop") } |
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 6 locations. Consider refactoring.
vmScoreBoard.ctx = view.context | ||
|
||
view.findViewById<Button>(R.id.scoreboard_kpopButton).setOnClickListener { setGenreListeners("Kpop") } | ||
view.findViewById<Button>(R.id.scoreboard_rockButton).setOnClickListener {setGenreListeners("Rock") } |
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 6 locations. Consider refactoring.
|
||
view.findViewById<Button>(R.id.scoreboard_kpopButton).setOnClickListener { setGenreListeners("Kpop") } | ||
view.findViewById<Button>(R.id.scoreboard_rockButton).setOnClickListener {setGenreListeners("Rock") } | ||
view.findViewById<Button>(R.id.scoreboard_btsButton).setOnClickListener { setGenreListeners("BTS") } |
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 6 locations. Consider refactoring.
view.findViewById<Button>(R.id.scoreboard_kpopButton).setOnClickListener { setGenreListeners("Kpop") } | ||
view.findViewById<Button>(R.id.scoreboard_rockButton).setOnClickListener {setGenreListeners("Rock") } | ||
view.findViewById<Button>(R.id.scoreboard_btsButton).setOnClickListener { setGenreListeners("BTS") } | ||
view.findViewById<Button>(R.id.scoreboard_topTracksButton).setOnClickListener{ setGenreListeners("top tracks") } |
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 6 locations. Consider refactoring.
view.findViewById<Button>(R.id.scoreboard_rockButton).setOnClickListener {setGenreListeners("Rock") } | ||
view.findViewById<Button>(R.id.scoreboard_btsButton).setOnClickListener { setGenreListeners("BTS") } | ||
view.findViewById<Button>(R.id.scoreboard_topTracksButton).setOnClickListener{ setGenreListeners("top tracks") } | ||
view.findViewById<Button>(R.id.scoreboard_imagDragonsButton).setOnClickListener{ setGenreListeners("Imagine Dragons") } |
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 6 locations. Consider refactoring.
Code Climate has analyzed commit cb3b150 and detected 18 issues on this pull request. Here's the issue category breakdown:
The test coverage on the diff in this pull request is 98.9% (80% is the threshold). This pull request will bring the total coverage in the repository to 85.2% (0.7% change). View more on Code Climate. |
Add view model to store view and context in fragment