-
Notifications
You must be signed in to change notification settings - Fork 12
[이건형_Android] 10주차 과제 제출 #76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
kongwoojin
left a comment
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.
고생하셨습니다.
코멘트 확인해주세요
| btnPlayPause = findViewById(R.id.button_play_pause) | ||
|
|
||
| btnRequestPermission.setOnClickListener { | ||
| if (permissionDeniedCount < 2) { |
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.
애플리케이션 재실행 시 permissionDeniedCount가 초기화되기 때문에, 다이얼로그를 띄울 수 없어도 permissionDeniedCount가 0이라 띄우려고 시도를 하게 됩니다.
|
|
||
| override fun getItemCount(): Int = musicList.size | ||
|
|
||
| private fun formatDuration(durationMs: Long): String { |
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.
Long의 확장함수로 작성할 수 있을 것 같습니다
| private fun playMusic(uri: Uri) { | ||
| mediaPlayer?.release() | ||
| try { | ||
| val fd = contentResolver.openFileDescriptor(uri, "r")?.fileDescriptor |
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.
null check를 한 이유가 있을까요?
| private fun createNotificationChannel() { | ||
| val channel = NotificationChannel( | ||
| CHANNEL_ID, | ||
| "음악 재생 채널", |
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.
알림 채널 ID와 이름은 보통 상수로 분리합니다
| "음악 재생 채널", | ||
| NotificationManager.IMPORTANCE_LOW | ||
| ).apply { | ||
| description = "음악 재생 상태를 보여주는 채널" |
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.
string resource 써주세요
No description provided.