Open
Conversation
jusang3057
reviewed
Jun 25, 2025
| 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.
contentResolversms I/O작업이라 백그라운드 스레드를 사용하시면 좋습니다.
| private fun showPermissionDialog() { | ||
| AlertDialog.Builder(this) | ||
| .setTitle(R.string.permdialog_title) | ||
| .setMessage(R.string.permdialog_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.
음악 정보를 저장하는 데이터 클래스를 사용하면 가독성을 높일 수 있습니다!
| @@ -0,0 +1,38 @@ | |||
| package com.example.bcsd_android_2025_1 | |||
| import android.Manifest | |||
| android:layout_height="match_parent"> | ||
|
|
||
| <androidx.recyclerview.widget.RecyclerView | ||
| android:id="@+id/recyclerView" |
kongwoojin
reviewed
Jun 26, 2025
| jvmTarget = "11" | ||
| } | ||
| buildFeatures { | ||
| compose = true |
Contributor
There was a problem hiding this comment.
본 커리큘럼에서는 compose를 사용하지 않습니다.
| import android.widget.TextView | ||
| import androidx.recyclerview.widget.RecyclerView | ||
|
|
||
| class MusicAdapter(private val musicList: List<Triple<String, String, Long>>) : |
Contributor
There was a problem hiding this comment.
Triple을 사용하면, 어떤 값이 무엇을 나타내는건지 알기 어렵습니다.
data class를 만들어주세요
|
|
||
| override fun getItemCount() = musicList.size | ||
|
|
||
| private fun settime(timeMs: Long): String { |
Contributor
There was a problem hiding this comment.
Long의 확장함수로 만드는게 좋아보입니다.
| android:text="@string/text_music_artist" | ||
| android:textSize="14sp"/> | ||
|
|
||
| <TextView |
Contributor
There was a problem hiding this comment.
artist와 같은 줄에 위치하게 해주세요
5fd4b2d to
5585b63
Compare
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.
No description provided.