Open
Conversation
yunjaena
reviewed
Jun 21, 2021
| lateinit var runnable: Runnable | ||
| lateinit var mediaPlayer : MediaPlayer | ||
| private var handler = Handler() | ||
| val CHANNELID = "MusicPlayer" |
Collaborator
There was a problem hiding this comment.
공통으로 사용하는 상수는 companion object 로 선언하는게 좋습니다.
companion object{
const val CHANNEL_ID = "MusicPlayer"
}| import android.os.Build | ||
| import androidx.core.app.NotificationCompat | ||
|
|
||
| object MusicNotification { |
Collaborator
There was a problem hiding this comment.
MusicNotification을 사용하는 곳이 안보이네요!! action을 처리하는 부분도 필요할 것 같습니다.
| } | ||
|
|
||
| previous.setOnClickListener { | ||
| seekBar.progress=mediaPlayer.currentPosition-5000 |
Collaborator
There was a problem hiding this comment.
-5000 이면 0 보다 작아질수도 있으니 0보다 작아지면 0초로 돌리거나 이전 곡으로 이동하는 로직을 추가하면 어떨까요?
| } | ||
|
|
||
| next.setOnClickListener { | ||
| seekBar.progress=mediaPlayer.currentPosition+5000 |
Collaborator
There was a problem hiding this comment.
이부분도 마찬가지로 음악 길이를 넘어갈 수 있으니 검사하는 로직이 필요할 것 같습니다.
|
|
||
| runnable = Runnable { | ||
| seekBar.progress = mediaPlayer.currentPosition | ||
| handler.postDelayed(runnable,1000) |
Collaborator
There was a problem hiding this comment.
runnable 안에서 handler를 통해 실행하는 이유는 무엇인가요? 78번째 라인에서 핸들링 될 것 같습니다.
| exitProcess(0) | ||
| } | ||
|
|
||
| fun createNotificationChannel() { |
Collaborator
There was a problem hiding this comment.
MusicNotification class에서 같이 선언해주시면 좋을 것 같습니다 :)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
실습과제 6번입니다.