-
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/#19] Week6 / 심화 과제 #22
[FEAT/#19] Week6 / 심화 과제 #22
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.
진차... 야무지네요...
@@ -10,13 +10,13 @@ import retrofit2.http.POST | |||
interface AuthService { | |||
// 회원가입 | |||
@POST("api/v1/members") | |||
fun signUp( | |||
suspend fun signUp( | |||
@Body request: RequestSignupDto, | |||
): Call<Unit> |
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.
요 부분의 Call<>도 빼주셔도 될듯함다! 그 전에 Call이 여기서 어떤 역할을 했었고, 왜 이제 안 감싸주어도 작동이 되는지 공부해보면 더 좋을 듯 합니다 ~~
|
||
loginViewModel.loginResult.observe( | ||
loginViewModel.getLoginInfo.observe( |
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.
옵저버는 onClickListener보다는 바깥쪽에 위치하는 게 더 좋을 것 같아요~!
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 val _getLoginInfo = MutableLiveData<UiState<User>>() | ||
val getLoginInfo: LiveData<UiState<User>> get() = _getLoginInfo |
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.
변수명이 get으로 시작하면 너무 함수명같지 않나요..? ㅎㅎ
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.
저 이제 변수명 정하는거 오류났어요
최종_진짜최종_찐최종 느낌..;; 좀 더 고민해볼게요 ㅎㅎ,,
} | ||
|
||
val userId = uiState.data?.userId | ||
showShortToast("로그인 성공, 유저 아이디 : $userId") |
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.
그냥 슥 봐서는 저는 두번 토스트 뜨는 이유가 안보이네욥... 로그 찍어봐야할듯 !
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.
ㅋㅋㅋㅋㅋ 제가 버튼을 두번 누르는 이슈였습니다 ..ㅎㅎ^^
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.
@kangyuri1114 제 코드 중에 util에 setOnSingleClickListener 라구 있거덩요? 그거 가져와서 대신 쓰면 더블 클릭에 대응하지 않게 된답니다~~!
val peopleList = uiState.data | ||
peopleListAdapter.setUsers(ArrayList(peopleList)) |
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.
불필요한 객체 생성은 줄이는게 좋을 듯 합니다! 사실 제 강박관념임 ㅋ
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.
네~~ 주의할게요!
@@ -0,0 +1,13 @@ | |||
package org.sopt.dosopttemplate.util | |||
|
|||
sealed interface UiState<out T> { |
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.
혹시 제 UiState 가져오셧나요? ㅎㅎ 아님말구~
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.
합세때 쓰던 거 가져왔어욤 ㅎㅎ
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.
너무 잘하시는데요!!! 심화과제까지 수고하셨습니당
) { uiState -> | ||
when (uiState) { | ||
is UiState.Success -> { | ||
if (binding.cbLoginAutologin.isChecked) { | ||
signUpUser?.let { | ||
loginViewModel.saveUserForAutoLogin(this, it) |
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.
저도 UiSate 써보고 싶었는데,, 다음에 할 때 참고해야게써요 최곱니다,,,
RequestSignupDto( | ||
inputId.value ?: "", | ||
inputPw.value ?: "", | ||
inputNickname.value ?: "", | ||
), |
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.
예외처리 이렇게 해주는군요! 효율적이네용
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.
저는 orEmpty를 썼는데 inputId.value.orEmpty로 하는 것과 inputId.value ?: "" 하는 것 중에 어느게 더 효율적인가요..?
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.
음... 제 생각에는 orEmpty가 더 깔끔해서 시각적으로는 좋을 것 같네요 ㅎㅎ..성능부분까지는 모르겠슴다 ㅎㅎ..
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_width="0dp"--> | ||
<!-- android:layout_height="wrap_content"--> | ||
<!-- android:layout_marginHorizontal="30dp"--> | ||
<!-- android:layout_marginTop="12dp"--> | ||
<!-- android:text="@string/tv_signup_age"--> | ||
<!-- android:textSize="20sp"--> | ||
<!-- app:layout_constraintStart_toStartOf="parent"--> | ||
<!-- app:layout_constraintTop_toBottomOf="@id/et_signup_nickname" />--> | ||
|
||
<!-- <EditText--> | ||
<!-- android:id="@+id/et_signup_age"--> | ||
<!-- android:layout_width="0dp"--> | ||
<!-- android:layout_height="wrap_content"--> | ||
<!-- android:layout_marginHorizontal="30dp"--> | ||
<!-- android:layout_marginTop="5dp"--> | ||
<!-- android:hint="@string/et_age_hint"--> | ||
<!-- android:inputType="number"--> | ||
<!-- android:singleLine="true"--> | ||
<!-- app:layout_constraintEnd_toEndOf="parent"--> | ||
<!-- app:layout_constraintStart_toStartOf="parent"--> | ||
<!-- app:layout_constraintTop_toBottomOf="@id/tv_signup_age" />--> |
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 observeValid() { | ||
signUpViewModel.idFlag.observe(this) { idFlag -> | ||
binding.telSignupId.error = if (idFlag) null else getString(R.string.id_layout_title) |
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.
오홍 이런식으로 if문 쓰는방법도 좋네요
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.
조장이 고쳐줬어염 ㅎㅅㅎ
RequestSignupDto( | ||
inputId.value ?: "", | ||
inputPw.value ?: "", | ||
inputNickname.value ?: "", | ||
), |
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.
저는 orEmpty를 썼는데 inputId.value.orEmpty로 하는 것과 inputId.value ?: "" 하는 것 중에 어느게 더 효율적인가요..?
📌𝘐𝘴𝘴𝘶𝘦𝘴
📎𝘞𝘰𝘳𝘬 𝘋𝘦𝘴𝘤𝘳𝘪𝘱𝘵𝘪𝘰𝘯
📷𝘚𝘤𝘳𝘦𝘦𝘯𝘴𝘩𝘰𝘵
_2023_12_07_04_59_12_784.mp4
💬𝘛𝘰 𝘙𝘦𝘷𝘪𝘦𝘸𝘦𝘳𝘴
양방향 데이터 바인딩은 필수 과제에서 구현 했습니다.
회원가입, 로그인, open API 친구리스트 세 부분에서 API 통신 구현한 곳 모두 코루틴 suspend로 변경 했습니다.
근데............................... 자신은 없네여ㅠㅠ 잘 한건가... 뭔가 쓸데없는 코드 있다 싶으면 바로 코리 부탁해염
BindingAdaptor 사용해서 회원가입 시 모든 로그인 조건 만족 시 값자기 타이틀 글씨가 커지게 했습니다.
왜냐면... 그냥 뭔가 애니메이션 느낌이 있으면 재밌을거 같아서여 (저만 재밌나여)
엄... 스낵바랑 토스트랑 다 섞여서 너무 보기 안 좋은데 이 부분은 차차 수정하겠습니당 ㅎㅎ;;
그리고 영상 보면 로그인 성공 토스트가 두번 뜨는데, 토스트 코드를 두번 썼나 하고 찾아보니까 한번만 썼는데 왜 두번 뜰까요? 두번이 뜬다는 건 로그인 액티비티에서 UiState.Success가 두번 간 거 같은데.... 왜...지..? 로딩도 아니고 왜 성공이 두번이지..
API 통신 로그인, 회원가입만 신경써서 자동로그인 부분이랑 유저정보 불러오는 부분이 지금 다 엉망입니다 ㅠㅠ 이것도 유저정보 API 붙이게 될... 시간이 있다면 붙이면서 리팩토링 해볼게요..