Skip to content

Commit

Permalink
feat: 약관 동의 UI 완성
Browse files Browse the repository at this point in the history
  • Loading branch information
rhkrwngud445 committed Jun 3, 2024
1 parent 7b4a4c9 commit b61451c
Show file tree
Hide file tree
Showing 18 changed files with 450 additions and 11 deletions.
3 changes: 3 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ dependencies {
implementation(libs.androidx.core.splashscreen)
implementation(project(":feature:login"))
implementation(project(":feature:signup"))
implementation(project(":feature:policyconsent"))
implementation(project(":feature:privacypolicy"))
implementation(project(":feature:termsofservice"))
implementation(project(":feature:home"))
implementation(project(":feature:postlist"))
implementation(project(":feature:mypage"))
Expand Down
23 changes: 22 additions & 1 deletion app/src/main/java/com/withpeace/withpeace/navigation/NavHost.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import com.withpeace.withpeace.feature.mypage.navigation.MY_PAGE_CHANGED_IMAGE_A
import com.withpeace.withpeace.feature.mypage.navigation.MY_PAGE_CHANGED_NICKNAME_ARGUMENT
import com.withpeace.withpeace.feature.mypage.navigation.MY_PAGE_ROUTE
import com.withpeace.withpeace.feature.mypage.navigation.myPageNavGraph
import com.withpeace.withpeace.feature.policyconsent.navigation.navigateToPolicyConsent
import com.withpeace.withpeace.feature.policyconsent.navigation.policyConsentGraph
import com.withpeace.withpeace.feature.policydetail.navigation.navigateToPolicyDetail
import com.withpeace.withpeace.feature.policydetail.navigation.policyDetailNavGraph
import com.withpeace.withpeace.feature.postdetail.navigation.POST_DETAIL_ROUTE_WITH_ARGUMENT
Expand All @@ -27,13 +29,17 @@ import com.withpeace.withpeace.feature.postdetail.navigation.postDetailGraph
import com.withpeace.withpeace.feature.postlist.navigation.POST_LIST_DELETED_POST_ID_ARGUMENT
import com.withpeace.withpeace.feature.postlist.navigation.POST_LIST_ROUTE
import com.withpeace.withpeace.feature.postlist.navigation.postListGraph
import com.withpeace.withpeace.feature.privacypolicy.navigation.navigateToPrivacyPolicy
import com.withpeace.withpeace.feature.privacypolicy.navigation.privacyPolicyGraph
import com.withpeace.withpeace.feature.registerpost.navigation.IMAGE_LIST_ARGUMENT
import com.withpeace.withpeace.feature.registerpost.navigation.REGISTER_POST_ARGUMENT
import com.withpeace.withpeace.feature.registerpost.navigation.REGISTER_POST_ROUTE
import com.withpeace.withpeace.feature.registerpost.navigation.navigateToRegisterPost
import com.withpeace.withpeace.feature.registerpost.navigation.registerPostNavGraph
import com.withpeace.withpeace.feature.signup.navigation.navigateSignUp
import com.withpeace.withpeace.feature.signup.navigation.signUpNavGraph
import com.withpeace.withpeace.feature.termsofservice.navigation.navigateToTermsOfService
import com.withpeace.withpeace.feature.termsofservice.navigation.termsOfServiceGraph

@Composable
fun WithpeaceNavHost(
Expand All @@ -50,7 +56,7 @@ fun WithpeaceNavHost(
loginNavGraph(
onShowSnackBar = onShowSnackBar,
onSignUpNeeded = {
navController.navigateSignUp()
navController.navigateToPolicyConsent()
},
onLoginSuccess = {
navController.navigateHome(
Expand All @@ -63,6 +69,21 @@ fun WithpeaceNavHost(
)
},
)
policyConsentGraph(
onShowSnackBar = onShowSnackBar,
onSuccessToNext = {
navController.navigateSignUp()
},
onTermsOfServiceClick = {
navController.navigateToTermsOfService()
},
onPrivacyPolicyClick = {
navController.navigateToPrivacyPolicy()
},
)
termsOfServiceGraph(onShowSnackBar = onShowSnackBar)
privacyPolicyGraph(onShowSnackBar = onShowSnackBar)

signUpNavGraph(
onShowSnackBar = onShowSnackBar,
onNavigateToGallery = {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/drawable/splash_inset.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<inset xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/app_logo"
android:drawable="@drawable/ic_app_logo"
android:insetLeft="20dp"
android:insetRight="20dp"
android:insetTop="20dp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,9 @@ data class WithPeaceTypography(
fontWeight = FontWeight.Bold,
fontSize = 16.sp,
),
val semiBold16Sp: TextStyle = TextStyle(
fontFamily = PretendardFont,
fontWeight = FontWeight.SemiBold,
fontSize = 16.sp,
),
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
package com.withpeace.withpeace.core.designsystem.ui

import androidx.compose.foundation.background
import androidx.compose.material3.Checkbox
import androidx.compose.material3.CheckboxDefaults
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.tooling.preview.Preview
import com.withpeace.withpeace.core.designsystem.theme.WithpeaceTheme

@Composable
fun CheonghaCheckbox(
modifier: Modifier = Modifier,
checked: Boolean,
onCheckedChanged: (Boolean) -> Unit,
) {
Checkbox(
modifier = modifier,
colors = CheckboxDefaults.colors(
checkedColor = WithpeaceTheme.colors.MainPurple,
uncheckedColor = WithpeaceTheme.colors.SystemGray2,
checkmarkColor = WithpeaceTheme.colors.SystemWhite,
),
checked = checked,
onCheckedChange = onCheckedChanged,
)
}

@Composable
fun TransparentCheonghaCheckbox(
modifier: Modifier = Modifier,
checked: Boolean,
onCheckedChanged: (Boolean) -> Unit,
) {
Checkbox(
modifier = modifier,
colors = CheckboxDefaults.colors(
checkedColor = Color.Transparent,
uncheckedColor = Color.Transparent,
).copy(
uncheckedCheckmarkColor = WithpeaceTheme.colors.SystemGray2,
checkedCheckmarkColor = WithpeaceTheme.colors.MainPurple,
uncheckedBoxColor = Color.Unspecified,
),
checked = checked,
onCheckedChange = onCheckedChanged,
)
}

@Composable
@Preview
fun TransparentCheonghaCheckboxPreview() {
WithpeaceTheme {
TransparentCheonghaCheckbox(
modifier = Modifier.background(color = WithpeaceTheme.colors.SystemWhite),
checked = false,
onCheckedChanged = {},
)
}
}
3 changes: 3 additions & 0 deletions core/ui/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Common -->
<string name="cheongha_logo">청하 로고</string>

<!-- PostTopicUiState -->
<string name="free">자유</string>
<string name="information">정보</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ private fun HomeHeader(
Image(
modifier = modifier.align(Alignment.BottomCenter)
.size(47.dp),
painter = painterResource(id = R.drawable.home_logo),
painter = painterResource(id = R.drawable.ic_home_logo),
contentDescription = stringResource(R.string.cheongha_logo),
)
Image(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.hilt.navigation.compose.hiltViewModel
import com.withpeace.withpeace.core.analytics.LocalAnalyticsHelper
import com.withpeace.withpeace.core.designsystem.theme.WithpeaceTheme
import com.withpeace.withpeace.googlelogin.GoogleLoginManager
import kotlinx.coroutines.launch
Expand Down Expand Up @@ -99,7 +98,7 @@ fun LoginScreen(
Spacer(modifier = Modifier.height(152.dp))
Image(
modifier = Modifier.size(150.dp),
painter = painterResource(id = R.drawable.app_logo),
painter = painterResource(id = com.withpeace.withpeace.core.ui.R.drawable.ic_app_logo),
contentDescription = stringResource(R.string.app_logo_content_description),
)
Spacer(modifier = Modifier.height(40.dp))
Expand Down
Loading

0 comments on commit b61451c

Please sign in to comment.