-
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
[FEAT] WEEK6 - xml 필수과제 #11
base: develop-xml
Are you sure you want to change the base?
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.
마지막까지 화이팅입니당~!!!!
|
||
class LoginViewModel : ViewModel() { | ||
private val authService by lazy { ServicePool.authService } | ||
private val _loginStateLiveData = MutableLiveData<LoginState>() | ||
|
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.
뷰모델 따로 분리한 거 넘 좋아요!!!
viewModelScope.launch { | ||
try { | ||
val response = authService.login(request) | ||
_loginStateLiveData.value = LoginState(true, "로그인 성공") | ||
|
||
} catch (e: HttpException) { | ||
_loginStateLiveData.value = LoginState(false, "로그인 실패 ${e.code()}") |
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.
세미나에서 runCathcing에 대해서 배웠으니까 활용해보면 좋을 것 같네요!
setContentView(binding.root) | ||
SignupButtonClickListener() |
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.
setContentView(binding.root) | |
SignupButtonClickListener() | |
setContentView(binding.root) | |
signupButtonClickListener() |
사소한 디테일!
private fun getSignUpRequestDto(): RequestSignUpDto { | ||
val id = binding.edtSignupId.text.toString() | ||
val password = binding.edtSignupPassword.text.toString() | ||
val nickname = binding.edtSignupNickname.text.toString() | ||
val phoneNumber = binding.edtSignupPhonenumber.text.toString() | ||
return RequestSignUpDto( | ||
authenticationId = id, | ||
password = password, | ||
nickname = nickname, | ||
phone = phoneNumber | ||
) | ||
} |
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 getSignUpRequestDto(): RequestSignUpDto { | |
val id = binding.edtSignupId.text.toString() | |
val password = binding.edtSignupPassword.text.toString() | |
val nickname = binding.edtSignupNickname.text.toString() | |
val phoneNumber = binding.edtSignupPhonenumber.text.toString() | |
return RequestSignUpDto( | |
authenticationId = id, | |
password = password, | |
nickname = nickname, | |
phone = phoneNumber | |
) | |
} | |
private fun getSignUpRequestDto(): RequestSignUpDto = | |
with(binding) { | |
RequestSignUpDto( | |
authenticationId = edtSignupId.text.toString(), | |
password = edtSignupPassword.text.toString(), | |
nickname = edtSignupNickname.text.toString(), | |
phone = edtSignupPhonenumber.text.toString() | |
) | |
} |
이렇게 바꿔줄 수 도 있을 것 같아요!
private val authService by lazy { ServicePool.authService } | ||
val liveData = MutableLiveData<SignUpState>() |
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.
배킹 프로퍼티 사용해주세욤 ㅜㅜ
android:layout_marginStart="70dp" | ||
android:layout_marginTop="300dp" |
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.
허거덩 너무 큰 dp 값은 지양해주시면 감사하겠습니당
companion object { | ||
var memberId = "1" | ||
} |
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.
companion object { | |
var memberId = "1" | |
} | |
companion object { | |
const val MEMBER_ID = "1" | |
} |
상수화하려면 const val로 바꿔줘야 할 것 같아요! 그리고 저는 보통 변하지 않는 값을 강조하기 위해 대문자로 표시해줍니다!
📌𝘐𝘴𝘴𝘶𝘦𝘴
📎𝘞𝘰𝘳𝘬 𝘋𝘦𝘴𝘤𝘳𝘪𝘱𝘵𝘪𝘰𝘯
📷𝘚𝘤𝘳𝘦𝘦𝘯𝘴𝘩𝘰𝘵
시연 영상은 달라진 바가 없습니다 !
https://github.com/NOW-SOPT-ANDROID/nakyung-lee/assets/109855280/8ad91db6-1027-4aa4-992d-7b8780476f26
💬𝘛𝘰 𝘙𝘦𝘷𝘪𝘦𝘸𝘦𝘳𝘴
명예 OB분께서 너무 꼼꼼히 잘 봐주신 덕에 폴더 구조와 컨벤션 등등이 아주 아주 깔끔해졌습니다 !!
제가 일일이 댓글을 달면 알림이 갈까봐 . . 하트만 몇 개 눌렀는데요 .. 정말 감사합니다 많이 배웠습니다 !!