Skip to content
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

Feature/week6 essential #17

Open
wants to merge 11 commits into
base: develop
Choose a base branch
from
Open

Conversation

stellar-halo
Copy link
Contributor

📌𝘐𝘴𝘴𝘶𝘦𝘴

📎𝘞𝘰𝘳𝘬 𝘋𝘦𝘴𝘤𝘳𝘪𝘱𝘵𝘪𝘰𝘯

  • 삼항 연산자와 livedata를 이용해 실시간 상태 반영
  • 비밀번호, ID 조건을 만족하지 않거나 닉네임, mbti 필드를 채우지 않으면 버튼 클릭 불가(색상 변경)

📷𝘚𝘤𝘳𝘦𝘦𝘯𝘴𝘩𝘰𝘵

-.Clipchamp.mp4

💬𝘛𝘰 𝘙𝘦𝘷𝘪𝘦𝘸𝘦𝘳𝘴

  • 제 함수명에 잔뜩 짜증나고,, 제 더러운 코드에 2배 더 짜증나네요. 다들 시험 기간 화이팅

@stellar-halo stellar-halo self-assigned this Dec 7, 2023
Copy link
Member

@chattymin chattymin left a comment

Choose a reason for hiding this comment

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

이번주도 그저 배워갑니다!!

Comment on lines +23 to +26
private val _isPasswordMeetCriteria: MutableLiveData<Boolean> = MutableLiveData()
val isPasswordMeetCriteria: LiveData<Boolean> = _isPasswordMeetCriteria
private val _isMeetCriteria: MutableLiveData<Boolean> = MutableLiveData(false)
val isMeetCriteria: LiveData<Boolean> = _isMeetCriteria
Copy link
Member

Choose a reason for hiding this comment

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

하나는 초기값을 설정하고 하나는 안했는데 어떤 기준으로 선택하시는 건가요??
저는 전부다 초기값 없이 사용하는 편인데 어느게 더 좋은지 궁금합니다!

Choose a reason for hiding this comment

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

저도 이부분 궁금합니다!!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

초기값을 설정하게 되면 화면에 들어간 순간부터 경고문이 뜨기 때문입니다!
아무것도 아닌 상태, 실패한 상태, 성공한 상태 세 가지가 필요했기 때문에 초기값 설정을 해주지 않았습니다.
그때 그때 상황에 따라 다르게 설정하는 것 같습니다 :)

Comment on lines +136 to +137
android:backgroundTint="@{vm.isMeetCriteria == true ? @color/baby_blue : @color/gray}"
android:clickable="@{vm.isMeetCriteria == true ? true : false}"
Copy link
Member

Choose a reason for hiding this comment

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

backgroundTint에서 3항 연산자 활용 멋지네요!!
근데 clickable은 3항연산자가 아니라 바로 vm.isMeetCriteria 써도 될것 같기도 합니다 ㅎㅎ

Copy link

Choose a reason for hiding this comment

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

클릭은 그냥 vm.isMeetCriteria 를 안쓰고 저렇게 하신이유가 있나욥>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

없습니다 ㅎ.. 바꿀게요👍🏻

@jihyun0v0
Copy link

군더더기 없이 깔끔한 강희언니 코드 본받고 싶습니다!!

Copy link

@lsakee lsakee left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -64,13 +64,26 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:backgroundTint="@{vm.isPasswordMeetCriteria != null &amp;&amp; vm.isPasswordMeetCriteria == false ? @color/red : @color/black}"
Copy link

Choose a reason for hiding this comment

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

데바마스터이신가

Copy link

Choose a reason for hiding this comment

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

이방법이 참 좋은데 가독성을 떨구는 부문인거 같아요 ㅠ 저도 이번 과제는 데바를 활용해야 해서 사용하였는데 평소에도 애용하시나요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

이런 식으로 값 변경에 즉각즉각 바뀌는 부분엔 애용하는 것 같아요

Comment on lines +136 to +137
android:backgroundTint="@{vm.isMeetCriteria == true ? @color/baby_blue : @color/gray}"
android:clickable="@{vm.isMeetCriteria == true ? true : false}"
Copy link

Choose a reason for hiding this comment

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

클릭은 그냥 vm.isMeetCriteria 를 안쓰고 저렇게 하신이유가 있나욥>

Copy link

@crownjoe crownjoe left a comment

Choose a reason for hiding this comment

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

이번 주도 수고 많으셨슴다 역시 최고 코드입니다람쥐 많이 배워 가고 눈에 담아갑니다 👍👍😎😮

Comment on lines +83 to +84
android:visibility="@{vm.isPasswordMeetCriteria != null &amp;&amp; vm.isPasswordMeetCriteria == false ? View.VISIBLE : View.INVISIBLE}"
app:layout_constraintStart_toStartOf="@id/tv_sign_up_id"

Choose a reason for hiding this comment

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

이렇게 가시성 설정할 수 있군요/,... 오늘도 배워갑니다 최고 👍👍

Comment on lines +23 to +26
private val _isPasswordMeetCriteria: MutableLiveData<Boolean> = MutableLiveData()
val isPasswordMeetCriteria: LiveData<Boolean> = _isPasswordMeetCriteria
private val _isMeetCriteria: MutableLiveData<Boolean> = MutableLiveData(false)
val isMeetCriteria: LiveData<Boolean> = _isMeetCriteria

Choose a reason for hiding this comment

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

저도 이부분 궁금합니다!!

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.

6주차 필수과제
5 participants