-
Notifications
You must be signed in to change notification settings - Fork 0
Refactor of intent fireing + LyricsBelongGameTest #268
Conversation
…DP_2022-Vibester into maximezmt/fireIntentRefactor
@@ -55,6 +56,10 @@ class DownloadActivity : AppCompatActivity() { | |||
downloadListener(songNameView) | |||
} | |||
|
|||
findViewById<FloatingActionButton>(R.id.download_returnToMain).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 3 locations. Consider refactoring.
@@ -32,6 +33,10 @@ class DeleteSongsActivity : AppCompatActivity() { | |||
|
|||
setContentView(R.layout.activity_delete_songs) | |||
|
|||
findViewById<FloatingActionButton>(R.id.delete_returnToMain).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 3 locations. Consider refactoring.
@@ -30,6 +31,11 @@ class IncorrectSongsActivity : AppCompatActivity() { | |||
|
|||
val layout: LinearLayout = findViewById(R.id.incorrect_songs_linear) | |||
|
|||
findViewById<Button>(R.id.incorrect_songs_back_to_welcome) |
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 3 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.
I have some questions regarding testing some lines!
Thank you for your changes! Looks good to me
if(this::currentSong.isInitialized) { | ||
return currentSong | ||
} else { | ||
return Song.songBuilder("http://example.com", "http://example.com", songName, artistName) |
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.
what is the purpose if this song.builder?
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.
The purpose of this song builder is that when the currentSong is not initialized yet (mean no web connection for instance/low connection), it does not crash and has song title and name
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.
I am not sure whether we should put a fake song. maybe we can put some text to screen. lets fix it next pr!
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.
this was not a fakesong. Just a fake url, but title and artist name is truth.
Indeed there is maybe another solution.
app/src/main/java/ch/sdp/vibester/activity/LyricsBelongGameActivity.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/ch/sdp/vibester/activity/AuthenticationActivity.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.
LGTM, just a tiny comment but I think you can add it later if you want :)
Code Climate has analyzed commit ccc44b5 and detected 3 issues on this pull request. Here's the issue category breakdown:
The test coverage on the diff in this pull request is 88.3% (80% is the threshold). This pull request will bring the total coverage in the repository to 82.1%. View more on Code Climate. |
Refactor of intent fireing + LyricsBelongGameTest