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

로그인 화면 #46

Merged
merged 4 commits into from
Jul 14, 2024
Merged

로그인 화면 #46

merged 4 commits into from
Jul 14, 2024

Conversation

junjange
Copy link
Member

이슈

개발 사항

  • 로그인 UI 구현

전달 사항

  • 로그인 화면에 들어갈 이미지는 임시로 넣어두었습니다.
  • 런처 액티비티를 RegisterActivity로 변경했습니다!
  • 소셜 로그인 구현 전이기 때문에 카카오, 구글 로그인 버튼을 눌렀을 때 MainActivity로 이동되게 구현했습니다.

@junjange junjange added 🤖 android android ✨ feat 기능 개발 labels Jul 14, 2024
@junjange junjange added this to the Sprint2 milestone Jul 14, 2024
@junjange junjange self-assigned this Jul 14, 2024
Copy link

Test Results

3 tests  ±0   3 ✅ ±0   0s ⏱️ ±0s
1 suites ±0   0 💤 ±0 
1 files   ±0   0 ❌ ±0 

Results for commit 9521f46. ± Comparison against base commit 9180143.

@junjange junjange removed this from the Sprint2 milestone Jul 14, 2024
Copy link
Member

@gaeun5744 gaeun5744 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 +19 to +29
viewModel.navigateAction.observeEvent(this) { action ->
when (action) {
is RegisterNavigationAction.NavigateToKakaoLogin -> {
startActivity(MainActivity.getIntent(this))
finish()
}

is RegisterNavigationAction.NavigateToGoogleLogin -> {
startActivity(MainActivity.getIntent(this))
finish()
}
Copy link
Member

Choose a reason for hiding this comment

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

현재 activity 입장에서는 로그인 성공 여부만 중요한거 같은데, sealed class를 이용해 어떤 로그인인지 알려주는 이유는 추후에 이쪽 로직을 각각 다르게 처리할 거라서 인가요???

Copy link
Member Author

Choose a reason for hiding this comment

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

Activity 입장에서는 카카오, 구글 로그인 버튼을 눌렀을 때, Intent를 통해 Kakao, Google SDK를 실행시켜 소셜 로그인을 진행하게 되요!! 그렇기 때문에 각각 다르게 처리를 하기 위해 sealed class를 사용한 거에요!!

그 이후에 소셜 로그인을 통해 필요한 정보(예를 들어 토큰)를 받게 되면, 그 정보를 통해 프로필 설정으로 이동하게 되는 sealed class가 추가될 것 같아요! 아마 벼리가 말한 게 이부분일 것 같네요!!

Copy link
Member

Choose a reason for hiding this comment

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

작업 흐름을 보니깐 제가 했던 방식이랑 뭔가 다르네요..? 이건 직접 만나서 얘기해보면 좋을거 같아용
넘넘 수고많았습니다!!!

Copy link
Contributor

Choose a reason for hiding this comment

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

이거 의견 나누고 공유해주세요 !

Copy link
Contributor

Choose a reason for hiding this comment

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

저도 이 부분에 대해서 궁금해요! 더 이야기 나누면 좋을 것 같아요!

Copy link
Contributor

@jinuemong jinuemong 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 +19 to +29
viewModel.navigateAction.observeEvent(this) { action ->
when (action) {
is RegisterNavigationAction.NavigateToKakaoLogin -> {
startActivity(MainActivity.getIntent(this))
finish()
}

is RegisterNavigationAction.NavigateToGoogleLogin -> {
startActivity(MainActivity.getIntent(this))
finish()
}
Copy link
Contributor

Choose a reason for hiding this comment

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

이거 의견 나누고 공유해주세요 !

@@ -0,0 +1,7 @@
package com.woowacourse.friendogly.presentation.ui.register

sealed interface RegisterNavigationAction {
Copy link
Contributor

@jinuemong jinuemong Jul 14, 2024

Choose a reason for hiding this comment

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

패키지 구조에 XXXNavigateAction이랑 XXXActionHadler 차이좀 알 수 있을까요?

Copy link
Member Author

Choose a reason for hiding this comment

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

XXXNavigateAction에는 특정 화면으로 이동하거나 다른 액션을 트리거하기 위한 동작을 정의합니다. 예를 들어, 화면 전환을 위한 네비게이션 액션, 특정 데이터를 가지고 다음 화면으로 이동하는 경우 등이 포함될 수 있습니다!! 해당 액티비티/프래그먼트에서 화면 전환은 XXXNavigateAction에 정의되어 있는 sealed interface를 통해 이동되는거죠!!

XXXActionHadler는 현재 저희 프로젝트에서 사용하지는 않았지만, 특정 액션을 처리하고, 그에 따른 비즈니스 로직을 ViewModel에서 실행시키기 위한 interface가 될 것 같습니다!!

class RegisterViewModel : BaseViewModel() {
private val _navigateAction: MutableLiveData<Event<RegisterNavigationAction>> =
MutableLiveData(null)
val navigateAction: LiveData<Event<RegisterNavigationAction>> get() = _navigateAction
Copy link
Contributor

Choose a reason for hiding this comment

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

SingleLiveData랑 비슷해보이는데 다른점이 궁금해요

Copy link
Member Author

Choose a reason for hiding this comment

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

동일합니다!! 다른 점이라면 LiveData를 직접 커스텀하는 것보다 더 간단하고 가독성이 좋은 것 같습니다!

https://medium.com/androiddevelopers/livedata-with-snackbar-navigation-and-other-events-the-singleliveevent-case-ac2622673150
위 LiveData 공식문서의 참고 블로그를 보면 이해하기 쉬울 것 같아요!!

Copy link
Contributor

@dpcks0509 dpcks0509 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 +19 to +29
viewModel.navigateAction.observeEvent(this) { action ->
when (action) {
is RegisterNavigationAction.NavigateToKakaoLogin -> {
startActivity(MainActivity.getIntent(this))
finish()
}

is RegisterNavigationAction.NavigateToGoogleLogin -> {
startActivity(MainActivity.getIntent(this))
finish()
}
Copy link
Contributor

Choose a reason for hiding this comment

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

저도 이 부분에 대해서 궁금해요! 더 이야기 나누면 좋을 것 같아요!

Comment on lines +14 to +20
fun executeKakaoLogin() {
_navigateAction.emit(RegisterNavigationAction.NavigateToKakaoLogin)
}

fun executeGoogleLogin() {
_navigateAction.emit(RegisterNavigationAction.NavigateToGoogleLogin)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

emit 함수를 처음보는데 무슨 역할을 하는 함수인지 궁금해요!

Copy link
Member Author

@junjange junjange Jul 14, 2024

Choose a reason for hiding this comment

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

현재 코들르 보면 LiveDataEvent라는 wrapper class를 사용하여 일회성 이벤트를 처리하도록 구성되어 있습니다. 즉, emit 함수는 MutableLiveData에 이벤트를 발생시키는 함수입니다!

Comment on lines +4 to +6
<!--회원가입 화면-->
<string name="register_now">간편하게 로그인 할래요</string>

Copy link
Contributor

Choose a reason for hiding this comment

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

strings.xml 활용 좋은 것 같아요!


<TextView
android:id="@+id/tv_register_title"
style="@style/Theme.AppCompat.TextView.Regular.Gray07.Size16"
Copy link
Contributor

Choose a reason for hiding this comment

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

style 리소스 활용 좋은 것 같아요! 저도 한번 사용해봐야 겠어요!

@junjange junjange merged commit 13d1d9b into woowacourse-teams:develop Jul 14, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖 android android ✨ feat 기능 개발
Projects
None yet
Development

Successfully merging this pull request may close these issues.

로그인 화면
4 participants