-
Notifications
You must be signed in to change notification settings - Fork 12
[김영찬_Android] 9주차 과제 제출 #65
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
jusang3057
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.
수고하셨습니다!
| val selection = "${MediaStore.Audio.Media.IS_MUSIC} != 0" | ||
| val sortOrder = "${MediaStore.Audio.Media.TITLE} ASC" | ||
|
|
||
| val cursor = contentResolver.query( |
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.
contentResolversms I/O작업이라 백그라운드 스레드를 사용하시면 좋습니다.
| private fun showPermissionDialog() { | ||
| AlertDialog.Builder(this) | ||
| .setTitle(R.string.permdialog_title) | ||
| .setMessage(R.string.permdialog_title) |
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.
_title로 들어가 있네요. 아마 오타인듯합니다.
| val title = it.getString(titleIndex) ?: "제목없음" | ||
| val artist = it.getString(artistIndex) ?: "가수없음" | ||
| val time = it.getLong(timeIndex) | ||
| musicList.add(Triple(title, artist, time)) |
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.
음악 정보를 저장하는 데이터 클래스를 사용하면 가독성을 높일 수 있습니다!
| @@ -0,0 +1,38 @@ | |||
| package com.example.bcsd_android_2025_1 | |||
| import android.Manifest | |||
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.
이 부분은 없어도 될 것 같습니다.
| android:layout_height="match_parent"> | ||
|
|
||
| <androidx.recyclerview.widget.RecyclerView | ||
| android:id="@+id/recyclerView" |
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.
네이밍컨밴션 지켜주세요
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.
고생하셨습니다.
코멘트 확인해주세요
| jvmTarget = "11" | ||
| } | ||
| buildFeatures { | ||
| compose = true |
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.
본 커리큘럼에서는 compose를 사용하지 않습니다.
| import android.widget.TextView | ||
| import androidx.recyclerview.widget.RecyclerView | ||
|
|
||
| class MusicAdapter(private val musicList: List<Triple<String, String, Long>>) : |
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.
Triple을 사용하면, 어떤 값이 무엇을 나타내는건지 알기 어렵습니다.
data class를 만들어주세요
|
|
||
| override fun getItemCount() = musicList.size | ||
|
|
||
| private fun settime(timeMs: 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의 확장함수로 만드는게 좋아보입니다.
| android:text="@string/text_music_artist" | ||
| android:textSize="14sp"/> | ||
|
|
||
| <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.
artist와 같은 줄에 위치하게 해주세요
5fd4b2d to
5585b63
Compare
No description provided.