-
Notifications
You must be signed in to change notification settings - Fork 0
Conversation
*/ | ||
fun downloadListener(songView: TextView?, songName0: String?) { | ||
if (downloadStarted) { | ||
Toast.makeText(applicationContext, getString(R.string.download_already_downloading), Toast.LENGTH_LONG).show() |
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.
if (!properties.exists()) { | ||
properties.createNewFile() | ||
} | ||
Helper().setReturnToMainListener(findViewById<FloatingActionButton>(R.id.download_returnToMain), this) |
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.
findViewById<FloatingActionButton>(R.id.delete_returnToMain).setOnClickListener { | ||
IntentSwitcher.switch(this, MainActivity::class.java) | ||
} | ||
Helper().setReturnToMainListener(findViewById<FloatingActionButton>(R.id.delete_returnToMain), this) |
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.
findViewById<FloatingActionButton>(R.id.end_returnToMain).setOnClickListener { | ||
IntentSwitcher.switch(this, MainActivity::class.java) | ||
} | ||
Helper().setReturnToMainListener(findViewById<FloatingActionButton>(R.id.end_returnToMain), this) |
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.
val broadcast = object: BroadcastReceiver() { | ||
override fun onReceive(context: Context?, intent: Intent?) { | ||
val id = intent?.getLongExtra(DownloadManager.EXTRA_DOWNLOAD_ID, -1) | ||
if (id == downloadId) { |
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.
var downloadStarted = false | ||
} | ||
|
||
private val STORAGE_PERMISSION_CODE = 1000 |
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 use of constants
@@ -140,4 +142,32 @@ class GameEndingActivity : AppCompatActivity() { | |||
} | |||
} | |||
} | |||
|
|||
override fun onItemClick(position: Int) { |
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.
Maybe use some empty lines to separate logic and improve readability
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.
Will be on the next commit!
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.
Looks good to me, just added a small comment, if you want you can fix it another time
Thanks! Noticed I forgot to add documentation for some of the methods which I will be doing now! |
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.
Nice work, small details below
|
||
fun createDownloadReceiver(songNameView: 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.
fun createDownloadReceiver(songNameView: TextView?) { | |
/** | |
Missing doc for public function | |
*/ | |
fun createDownloadReceiver(songNameView: TextView?) { |
|
||
open class DownloadFunctionalityActivity : AppCompatActivity() { |
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.
open class DownloadFunctionalityActivity : AppCompatActivity() { | |
/** | |
Missing doc for class | |
*/ | |
open class DownloadFunctionalityActivity : AppCompatActivity() { |
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 think you forgot that one 😅
songName = songName0 | ||
} | ||
|
||
if (checkExistingSong()) { |
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.
missing one
|
||
open class DownloadFunctionalityActivity : AppCompatActivity() { |
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 think you forgot that one 😅
…2-Vibester into jwen/end-game-download
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 👍 😃
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!
Code Climate has analyzed commit 2cb3206 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 89.5% (80% is the threshold). This pull request will bring the total coverage in the repository to 85.7%. View more on Code Climate. |
No description provided.