Skip to content

[정현수_Android] 7주차 과제 제출#8

Open
Rickettsia1234 wants to merge 4 commits into
BCSDLab-Edu:mainfrom
Rickettsia1234:week7
Open

[정현수_Android] 7주차 과제 제출#8
Rickettsia1234 wants to merge 4 commits into
BCSDLab-Edu:mainfrom
Rickettsia1234:week7

Conversation

@Rickettsia1234

Copy link
Copy Markdown

No description provided.

@JaeYoung290 JaeYoung290 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고 많으셨습니다!

MediaStore.Audio.Media.DURATION
)

val query = contentResolver.query(collection, projection, null, null, null)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

현재는 메인 스레드에서 동작합니다. 불러오는 음악 리스트가 많을 경우 ANR 오류가 발생할 수 있으므로 Dispatchers.IO 코루틴 등의 사용이 필요해 보입니다.

Comment on lines +127 to +128
val title = cursor.getString(titleColumn)
val artist = cursor.getString(artistColumn)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

title이나 artist에 null이 들어올 수 있습니다. 하지만 MusicItem 데이터 클래스에서는 non-null 타입으로 선언했으므로 null이 들어올 경우 NPE 오류가 발생합니다. Null check가 필요해 보입니다.

Comment on lines +50 to +51
mediaPlayer = MediaPlayer.create(this, uri).apply {
start()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

create() 함수는 null을 반환할 수 있습니다. 현재 코드에서 safe call 없이 바로 apply를 호출하면 NPE 오류가 발생합니다. null check가 필요해 보입니다.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tvBottomTitle, tvBottomArtist에서 긴 글자에 대한 처리가 필요해 보입니다. maxLines, ellipsize와 같이 글자가 길어질 때에 대한 처리를 알아보시는 것도 좋아보입니다.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tvTitle, tvArtist에서 긴 글자에 대한 처리가 필요해 보입니다. maxLines, ellipsize와 같이 글자가 길어질 때에 대한 처리를 알아보시는 것도 좋아보입니다.

<LinearLayout
android:id="@+id/layoutBottomPlayer"
android:layout_width="match_parent"
android:layout_height="64dp"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

height를 64dp로 고정하실 경우 특정 상황(예: 하위 textView의 height가 64dp를 넘어갈 경우)에서 글자가 잘리는 등의 UI적인 문제가 발생할 수 있습니다. 만약 특정 높이 이상을 보장하고 싶을 경우 minHeight와 wrap_content를 같이 사용하는 방법도 좋아보입니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants