-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ui] 다이얼로그 / 다이얼로그 디자인 통일 #116
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
다이얼로그 디자인 통일되니까 좋다!! 고생했어 👍👍
app:layout_constraintStart_toEndOf="@id/btn_dialog_negative" | ||
app:layout_constraintTop_toBottomOf="@id/tv_dialog_sub" /> | ||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ctrl + Alt + L 로 코드 자동 정렬하는 습관 들입시다~!
그리고 tools:text
속성에 하드코딩 한 문자열도 strings.xml 파일에 따로 추출하는 게 좋을 거 같네용
private const val DIALOG_TITLE = "정말 로그아웃 하시겠어요?" | ||
private const val DIALOG_SUB_TITLE = "로그아웃 후 장기간 미접속 시\n레벨이 내려갈 수 있습니다." | ||
private const val DIALOG_NEGATIVE_BUTTON_LABEL = "취소" | ||
private const val DIALOG_POSITIVE_BUTTON_LABEL = "로그아웃하기" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
프래그먼트에서는 컨텍스트를 참조할 수 있으니까 util 패키지에 있는 stringOf 확장함수 사용해서
strings.xml 파일에 정의한 문자열을 가져오는 방식은 어떨까요??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ui에 쓰이는 문자열은 string.xml 리소스에 추가해주는편이 더 좋을것 같습니다 감사합니다 !
handleNegativeButton = {}, | ||
handlePositiveButton = { viewModel.postLogout() } | ||
) | ||
dialog.show(this.childFragmentManager, dialog.tag) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
로그아웃에 성공했을 때만 로그인 화면으로 넘어가는 코드는 메인 액티비티에 있네요! 화긴화긴
|
||
initDialogText(title, subTitle, positiveButtonLabel, negativeButtonLabel) | ||
initNegativeButton(handleNegativeButton) | ||
initPositiveButton(handlePositiveButton) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
init[what]ButtonClickListener 라는 네이밍이 좀더 구체적이어서 좋은 거 같네용!
버튼을 초기화 한다고 네이밍 하면 클릭 리스너 외의 다른 동작도 해당 함수에 다 넣을 수 있을 것처럼 느껴져서요..!
ex) 버튼 텍스트/테두리/색상 초기화 등등
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
통일되니까 훨씬 편하네요 고생했습니다 😄
|
||
private fun initPositiveButton(handlePositiveButton: () -> Unit) { | ||
binding.btnDialogPositive.setOnClickListener { | ||
handlePositiveButton.invoke() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invoke 함수 사용 좋네요 👍
android:layout_height="wrap_content" | ||
android:paddingHorizontal="14dp" | ||
android:paddingBottom="16dp" | ||
android:elevation="0dp" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0dp면 이 속성은 필요없을것같아요 !
📝 Work Description
다이얼로그 디자인 통일
목표설정불가 다이얼로그 수정
📣 To Reviewers
리뷰 오늘까지 부탁드립니다 !
기존에 쓰던 다이얼로그에서 통일된 다이얼로그로 다음과 같이 사용하시면 됩니다 !
혹시 지금 방법보다 더 나은방법이 있다면 말씀 부탁드립니다 !