Skip to content

[정현수_Android] 6-1주차 과제 제출#5

Open
Rickettsia1234 wants to merge 1 commit into
BCSDLab-Edu:mainfrom
Rickettsia1234:week6-1
Open

[정현수_Android] 6-1주차 과제 제출#5
Rickettsia1234 wants to merge 1 commit into
BCSDLab-Edu:mainfrom
Rickettsia1234:week6-1

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.

수고 많으셨습니다!


binding.floatingActionButton.setOnClickListener {
val inputName = binding.editTextText.text.toString()
if (inputName.isNotEmpty()) {

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.

요구 사항에는 없었지만 isNotEmpty()는 공백이 있을 경우 검증하지 못합니다. 따라서 trim()을 사용해서 공백 제거 후 검증하는 것이 좋아보입니다.

holder.binding.tvName.text = nameList[position]

holder.itemView.setOnClickListener {
onItemClick(position)

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.

중간에 있는 아이템을 삭제하고 그 뒤에 있는 아이템을 빠르게 클릭했을 때, 만약 뒤에 있는 아이템이 재바인딩되지 않은 상태라면 유효하지 않은 position이 전달되어 버그가 발생할 수 있습니다. 클릭했을 때 유효성 검사를 하는 것이 좋아보입니다.

Comment on lines +34 to +35
android:layout_width="409dp"
android:layout_height="610dp"

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.

dp 고정값을 주신 이유가 따로 있으실까요?
보통은 제약 조건으로 조절하는 것이 좋습니다.

Comment on lines +5 to +8
android:layout_marginStart="16dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="4dp"

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.

layout_marginHorizontal, layout_marginVertical도 사용해보시면 좋을 것 같습니다.

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