-
Notifications
You must be signed in to change notification settings - Fork 2
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
[DEV] Android Login UI 구성 및 Firebase Auth 연동 #15
Conversation
Ktlint가 좀 많이 엄격한데요.. |
컴포저블 소문자 시작은 오케바리로 하겠습니다만, 패키지는 underscore 대신 score를 쓰는게,, 아마 안드로이드 컨벤션이..지.. 싶은데.. |
6d24b87
to
c63fd27
Compare
변경된 Ktlint 적용까지 완료되었습니다! |
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.
Screen 이름만 바꾸면 거의 뭐 GDE 저리가라 급;;
|
||
@AndroidEntryPoint | ||
class LoginActivity : ComponentActivity() { | ||
private val viewModel: LoginViewModel by viewModels() |
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.
잘보고 따라했군요 아주 멋져요
import com.gdsc_cau.vridge.R | ||
|
||
@Composable | ||
fun LoginView(onTryLogin: () -> 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.
컴포즈에서는 화면을 Screen으로 많이 쓰긴 해요! 한번 잡솨보시는거 어떨까요 하하하
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.
수정완료했습니다~
import dagger.hilt.android.lifecycle.HiltViewModel | ||
import javax.inject.Inject | ||
|
||
@HiltViewModel |
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.
바람직하네 아주 멋져
@Inject | ||
constructor() : | ||
ViewModel() { |
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.
이거 다 ktlint의 계략인건가
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.
워닝뜨길래 띄어쓰기 넣어줬지..
import com.google.firebase.auth.FirebaseUser | ||
import com.google.firebase.auth.auth | ||
|
||
object FirebaseAuthUtil { |
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.
LGTM!
Summary
Android 애플리케이션에 LoginActivity UI를 구성하고 Firebase Auth를 연동하였습니다.
Description
Context
가 필요한 부분을 Activity 메인 코드와 연동하여 구성하고자 Boolean 형식의LiveData
를 활용하였습니다. 또한, Activity 메인 코드에서 구성된ActivityResultLauncher
를 파라미터로 전달받아 Google Sign-In 로직 이후 연동해 호출하도록 하였습니다.FirebaseAuthUtil
싱글톤클래스(Object)에 작성하였습니다.onCreate
생명주기에서 Firebase Auth의getCurrentUser()
를 호출하도록 하여 자동로그인이 가능하도록 작성하였습니다.좌 - Light / 우 - Dark
P/S. MVVM 아키텍쳐를 제대로 활용한 것이 맞는지 모르겠읍니다.. 맘에안드는 부분이 있다면 탈탈 털어주십쇼 ㅎㅎ;
그리고 Dark모드 상태에서 NavigationBar 색상 정의를 추가해야할 것 같습니다?