Open
Conversation
added 2 commits
June 24, 2025 03:31
KYM-P
approved these changes
Jul 1, 2025
| ) { isGranted -> | ||
| if (isGranted) { | ||
| loadMusicFiles() | ||
| Toast.makeText(this, "Permission granted", Toast.LENGTH_SHORT).show() |
| } | ||
| } | ||
| currentlyPlaying = item | ||
| Toast.makeText(this, "\"${item.title}\" playing now", Toast.LENGTH_SHORT).show() |
|
|
||
| private fun pauseMusic() { | ||
| mediaPlayer?.pause() | ||
| Toast.makeText(this, "일시정지", Toast.LENGTH_SHORT).show() |
| private fun showPermissionDeniedDialog() { | ||
| AlertDialog.Builder(this) | ||
| .setTitle("권한 필요") | ||
| .setMessage("음악 파일을 표시하려면 권한이 필요합니다.\n\n설정에서 권한을 허용해주세요.") |
|
|
||
| while (it.moveToNext()) { | ||
| val id = it.getLong(idColumn) | ||
| val title = it.getString(titleColumn) ?: "Unknown Title" |
There was a problem hiding this comment.
이런 부분도 전부 strings.xml 이용해주세요
사용자에게 보이는 부분은 모두 strings.xml 에 넣어주는게 좋습니다.
이 외에도 "" 를 이용하는게 아닌 Constant 를 하나 만들어 상수를 모아 만든 후
해당 함수를 참조하는 형태로 Activity 나 viewModel 에서는 참조의 형태가 좋습니다.
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.
TT