Skip to content

Commit

Permalink
[feat/#122] 구글로그인 Compose UI 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
SsongSik committed Aug 25, 2024
1 parent 8829e50 commit f0ed467
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 7 deletions.
Binary file modified buildSrc/build/kotlin/compileKotlin/cacheable/last-build.bin
Binary file not shown.
Binary file not shown.
Binary file modified buildSrc/build/libs/buildSrc.jar
Binary file not shown.
22 changes: 22 additions & 0 deletions core/designsystem/src/main/res/drawable/ic_google_login.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="18dp"
android:height="18dp"
android:viewportWidth="18"
android:viewportHeight="18">
<path
android:pathData="M17.64,9.204C17.64,8.566 17.583,7.952 17.476,7.363H9V10.845H13.844C13.635,11.97 13.001,12.923 12.048,13.561V15.819H14.956C16.658,14.252 17.64,11.945 17.64,9.204Z"
android:fillColor="#4285F4"
android:fillType="evenOdd"/>
<path
android:pathData="M9,18C11.43,18 13.467,17.194 14.956,15.819L12.047,13.561C11.242,14.101 10.211,14.42 9,14.42C6.656,14.42 4.672,12.837 3.964,10.71H0.957V13.042C2.438,15.983 5.482,18 9,18Z"
android:fillColor="#34A853"
android:fillType="evenOdd"/>
<path
android:pathData="M3.964,10.71C3.784,10.17 3.682,9.593 3.682,9C3.682,8.407 3.784,7.83 3.964,7.29V4.958H0.957C0.348,6.173 0,7.548 0,9C0,10.452 0.348,11.827 0.957,13.042L3.964,10.71Z"
android:fillColor="#FBBC05"
android:fillType="evenOdd"/>
<path
android:pathData="M9,3.58C10.321,3.58 11.507,4.034 12.44,4.925L15.022,2.344C13.463,0.892 11.426,0 9,0C5.482,0 2.438,2.017 0.957,4.958L3.964,7.29C4.672,5.163 6.656,3.58 9,3.58Z"
android:fillColor="#EA4335"
android:fillType="evenOdd"/>
</vector>
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import com.dpm.presentation.login.viewmodel.KakaoSignupViewModel
import com.dpm.presentation.login.viewmodel.LoginUiState
import com.dpm.presentation.scheme.SchemeKey
import com.dpm.presentation.scheme.viewmodel.SchemeState
import com.google.android.gms.auth.api.signin.GoogleSignInOptions
import com.kakao.sdk.auth.model.OAuthToken
import com.kakao.sdk.common.model.ClientError
import com.kakao.sdk.common.model.ClientErrorCause
Expand Down Expand Up @@ -46,9 +47,14 @@ class KakaoSignupActivity : BaseActivity<FragmentKakaoSignupBinding>({
private fun initComposeView() {
binding.kakaoSignComposeView.setContent {
MaterialTheme {
KakaoSignupScreen() {
kakaoLoginCallBack()
}
KakaoSignupScreen(
onKakaoLoginClick = {
kakaoLoginCallBack()
},
onGoogleLoginClick = {
onGoogleLogin()
}
)
}
}
}
Expand All @@ -71,6 +77,10 @@ class KakaoSignupActivity : BaseActivity<FragmentKakaoSignupBinding>({
}
}

private fun onGoogleLogin() {
//Todo GoogleLogin
}

private fun initObservers() {
signUpViewModel.kakaoToken.observe(this) { token ->
if (token.isNotEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.dpm.presentation.login.ui.compose
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
Expand Down Expand Up @@ -41,7 +42,8 @@ import kotlinx.coroutines.delay
@OptIn(ExperimentalFoundationApi::class)
@Composable
fun KakaoSignupScreen(
onKakaoLoginClick: () -> Unit = {}
onKakaoLoginClick: () -> Unit = {},
onGoogleLoginClick: () -> Unit = {}
) {
val onBoardingList = listOf(
Pair("시야찾기로 원하는 야구장\n자리를 빠르게 알아봐요!", listOf(0..3)),
Expand Down Expand Up @@ -153,12 +155,12 @@ fun KakaoSignupScreen(
Row(
modifier = Modifier
.fillMaxWidth()
.padding(vertical = 30.dp, horizontal = 40.dp)
.padding(top = 30.dp, start = 40.dp, end = 40.dp)
.noRippleClickable {
onKakaoLoginClick()
}
.background(Color(0xFFFEE500), RoundedCornerShape(40.dp))
.padding(horizontal = 40.dp, vertical = 16.dp),
.padding(vertical = 12.dp),
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.Center
) {
Expand All @@ -169,7 +171,31 @@ fun KakaoSignupScreen(
)
Spacer(modifier = Modifier.size(8.dp))
Text(
text = "카카오 로그인",
text = "카카오로 3초만에 로그인",
style = SpotTheme.typography.subtitle02
)
}

Row(
modifier = Modifier
.fillMaxWidth()
.padding(start = 40.dp, end = 40.dp, bottom = 40.dp, top = 10.dp)
.noRippleClickable {
onGoogleLoginClick()
}
.border(1.dp, SpotTheme.colors.strokePrimary, RoundedCornerShape(40.dp))
.padding(vertical = 12.dp),
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.Center
) {
Image(
painter = painterResource(id = com.depromeet.designsystem.R.drawable.ic_google_login),
contentDescription = "google-login",
modifier = Modifier.size(18.dp)
)
Spacer(modifier = Modifier.size(8.dp))
Text(
text = "구글 계정으로 로그인",
style = SpotTheme.typography.subtitle02
)
}
Expand Down

0 comments on commit f0ed467

Please sign in to comment.