Skip to content

mission3_miles (1)#11

Open
jihyun-p wants to merge 1 commit intomiles-flo-clonefrom
miles-flo-clone-new
Open

mission3_miles (1)#11
jihyun-p wants to merge 1 commit intomiles-flo-clonefrom
miles-flo-clone-new

Conversation

@jihyun-p
Copy link
Collaborator

#️⃣연관된 이슈

#10

📝작업 내용

미션 1차 업로드.. 확인용

@jihyun-p jihyun-p self-assigned this Oct 11, 2024
Copy link
Contributor

@tristanjung1006 tristanjung1006 left a comment

Choose a reason for hiding this comment

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

고생하셨어요~

Copy link
Contributor

Choose a reason for hiding this comment

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

defaultConfig {
}

buildFeatures {
    viewBinding = true
}

defaultConfig랑 같은 라인에 buildFeatures 안에 viewBinding을 선언하면 가독성이 더 좋습니다!

Copy link
Contributor

@tristanjung1006 tristanjung1006 Oct 13, 2024

Choose a reason for hiding this comment

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

나중에 Fragment의 생명주기에서 다룰 내용이긴 하지만 Fragment의 생성 단계가 onCreateView -> onViewCreated가 있습니다.

onCreateView에서는 View가 처음 생성되고 초기화되는 부분을 담당하고
onViewCreated에서는 View와의 상호작용이 이루어지는 곳이라서 onCreateView 말고
onViewCreated를 override 받아서 setOnClickListener 메서드를 선언하는 것이 좋습니다!

import com.jihyun.floclonecoding.databinding.ActivitySongBinding

class SongActivity :
AppCompatActivity() {
Copy link
Contributor

Choose a reason for hiding this comment

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

줄바꿈은 안하시는 것이 가독성이 좋아보입니다!

setPlayerStatus(true)

}
if (intent.hasExtra("title") && intent.hasExtra("singer")){
Copy link
Contributor

Choose a reason for hiding this comment

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

val title = intent.getStringExtra("title")
val singer = intent.getStringExtra("singer")

if (title != null && singer != null) {
    binding.songMusicTitleTv.text = title
    binding.songSingerNameTv.text = singer
}

intent에 들어있는 변수의 존재 여부를 판별하고 저장하는 것보다는 if문에서는 null 체크만 하고 값을 사용하는 편이 더 좋아보입니다!

}
}
private fun setPlayerStatus(isPlaying: Boolean) {
if(isPlaying){
Copy link
Contributor

Choose a reason for hiding this comment

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

if문 판별식은 띄워쓰는 것이 일반적입니다~

Copy link
Contributor

@tristanjung1006 tristanjung1006 Oct 13, 2024

Choose a reason for hiding this comment

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

이미지 파일을 png로 많이 갖고 오신 것 같은데 Chapter 1에 png 말고 svg로 다운로드받고 다시 xml 형식으로 변환하는 과정을 다시 한 번 정독해주세요~ 물론 Udemy 강의의 이미지 파일들이 너무 많은 관계로 일일이 못하신 것 같지만 실제 프로젝트에서는 png로 할 경우 이미지의 해상도가 깨지는 경우들이 많아서 방법 정도만 숙지해놓으셔도 됩니다!


<TextView
android:layout_width="wrap_content"
<FrameLayout
Copy link
Contributor

Choose a reason for hiding this comment

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

만약 FrameLayout이 Fragment 교체용으로 사용하시는 위젯이시라면 이것 대신에 FragmentContainerView를 사용하시는 것을 권장드려요~

Copy link
Contributor

Choose a reason for hiding this comment

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

이렇게 앱에서 쓰이는 메인 컬러들은 resources에 일괄 저장해두시는 것 아주 좋습니다~

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