-
Notifications
You must be signed in to change notification settings - Fork 1
프로필 설정 화면 구현 #50
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
프로필 설정 화면 구현 #50
Changes from 14 commits
9819c2d
af6eb65
e863215
a18b5a0
69d949e
d75c7ed
85719ae
ced84c7
cdf9e50
f6fcc22
d689e69
c3dd4cd
f7b5d67
b69d733
3378d05
1820bb2
5f34d71
dce7ce6
2459741
4c03402
ef348d8
eab7ac2
ad94894
e428b41
22af1ad
4983c58
ab00c5c
30009a6
432f0f7
75e31da
062cb99
535f81e
0657417
4bc1d67
32cfd6b
82b1115
7ef3d69
ffc5e4b
a9d421b
513e023
f68bf96
0bdbbb2
f8431c6
611a2a2
6bdaac3
be76871
4f2747c
0b4179b
78bb992
d7a5e82
f4d1cdc
dc31a63
178e778
4f366c0
596757a
6b338ff
4d97010
2c7f3e7
f4ba708
13093e7
4f6ed19
8c7d409
a8f3e1b
ace6a2d
5171b75
21c6733
5048491
820ad52
a1eb97f
4be8a8a
3cf6165
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| package com.twix.designsystem.components.button | ||
|
|
||
| import androidx.compose.foundation.BorderStroke | ||
| import androidx.compose.foundation.layout.fillMaxWidth | ||
| import androidx.compose.foundation.layout.padding | ||
| import androidx.compose.foundation.shape.RoundedCornerShape | ||
| import androidx.compose.material3.Surface | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.graphics.Color | ||
| import androidx.compose.ui.text.style.TextAlign | ||
| import androidx.compose.ui.unit.Dp | ||
| import androidx.compose.ui.unit.dp | ||
| import com.twix.designsystem.components.text.AppText | ||
| import com.twix.designsystem.theme.CommonColor | ||
| import com.twix.designsystem.theme.GrayColor | ||
| import com.twix.domain.model.enums.AppTextStyle | ||
|
|
||
| @Composable | ||
| fun AppButton( | ||
| modifier: Modifier = Modifier, | ||
| text: String, | ||
| textColor: Color = CommonColor.White, | ||
| backgroundColor: Color = GrayColor.C500, | ||
| enabled: Boolean = true, | ||
| cornerRadius: Dp = 12.dp, | ||
| border: BorderStroke? = null, | ||
| onClick: () -> Unit = {}, | ||
| ) { | ||
| Surface( | ||
| color = backgroundColor, | ||
| shape = RoundedCornerShape(cornerRadius), | ||
| border = border, | ||
| onClick = onClick, | ||
| enabled = enabled, | ||
| modifier = modifier, | ||
| ) { | ||
| AppText( | ||
| text = text, | ||
| color = textColor, | ||
| style = AppTextStyle.T2, | ||
| textAlign = TextAlign.Center, | ||
| modifier = | ||
| Modifier | ||
| .fillMaxWidth() | ||
| .padding(vertical = 14.dp), | ||
| ) | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| <vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
| android:width="24dp" | ||
| android:height="24dp" | ||
| android:viewportWidth="24" | ||
| android:viewportHeight="24"> | ||
| <path | ||
| android:strokeWidth="1" | ||
| android:pathData="M14.5,17.023L9.5,12.023L14.5,7.023" | ||
| android:strokeLineJoin="round" | ||
| android:fillColor="#00000000" | ||
| android:strokeColor="#171717" | ||
| android:strokeLineCap="round"/> | ||
| </vector> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| <vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
| android:width="16dp" | ||
| android:height="16dp" | ||
| android:viewportWidth="16" | ||
| android:viewportHeight="16"> | ||
| <path | ||
| android:pathData="M7.02,9.26L5.515,7.755C5.387,7.627 5.223,7.563 5.025,7.563C4.827,7.563 4.663,7.627 4.535,7.755C4.407,7.883 4.343,8.047 4.343,8.245C4.343,8.443 4.407,8.607 4.535,8.735L6.53,10.73C6.67,10.87 6.833,10.94 7.02,10.94C7.207,10.94 7.37,10.87 7.51,10.73L11.465,6.775C11.593,6.647 11.658,6.483 11.658,6.285C11.658,6.087 11.593,5.923 11.465,5.795C11.337,5.667 11.173,5.602 10.975,5.602C10.777,5.602 10.613,5.667 10.485,5.795L7.02,9.26ZM8,15C7.032,15 6.122,14.816 5.27,14.449C4.418,14.081 3.678,13.583 3.047,12.953C2.418,12.323 1.919,11.582 1.551,10.73C1.184,9.878 1,8.968 1,8C1,7.032 1.184,6.122 1.551,5.27C1.919,4.418 2.418,3.678 3.047,3.047C3.678,2.418 4.418,1.919 5.27,1.551C6.122,1.184 7.032,1 8,1C8.968,1 9.878,1.184 10.73,1.551C11.582,1.919 12.323,2.418 12.953,3.047C13.583,3.678 14.081,4.418 14.449,5.27C14.816,6.122 15,7.032 15,8C15,8.968 14.816,9.878 14.449,10.73C14.081,11.582 13.583,12.323 12.953,12.953C12.323,13.583 11.582,14.081 10.73,14.449C9.878,14.816 8.968,15 8,15Z" | ||
| android:fillColor="#1ED45A"/> | ||
| </vector> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| package com.twix.domain.model.nickname | ||
|
|
||
| @JvmInline | ||
| value class NickName private constructor( | ||
| val value: String, | ||
| ) { | ||
| companion object { | ||
| fun create(value: String): Result<NickName> = | ||
| runCatching { | ||
| require(value.length in MIN_LENGTH..MAX_LENGTH) { | ||
| NickNameException.InvalidLengthException | ||
| } | ||
| NickName(value) | ||
| } | ||
|
|
||
| private const val MIN_LENGTH = 2 | ||
| private const val MAX_LENGTH = 8 | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| package com.twix.domain.model.nickname | ||
|
|
||
| sealed class NickNameException : Throwable() { | ||
| data object InvalidLengthException : NickNameException() | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| /build |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| plugins { | ||
| alias(libs.plugins.twix.feature) | ||
| } | ||
|
|
||
| android { | ||
| namespace = "com.twix.onboarding" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # Add project specific ProGuard rules here. | ||
| # You can control the set of applied configuration files using the | ||
| # proguardFiles setting in build.gradle. | ||
| # | ||
| # For more details, see | ||
| # http://developer.android.com/guide/developing/tools/proguard.html | ||
|
|
||
| # If your project uses WebView with JS, uncomment the following | ||
| # and specify the fully qualified class name to the JavaScript interface | ||
| # class: | ||
| #-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
| # public *; | ||
| #} | ||
|
|
||
| # Uncomment this to preserve the line number information for | ||
| # debugging stack traces. | ||
| #-keepattributes SourceFile,LineNumberTable | ||
|
|
||
| # If you keep the line number information, uncomment this to | ||
| # hide the original source file name. | ||
| #-renamesourcefileattribute SourceFile |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <manifest xmlns:android="http://schemas.android.com/apk/res/android"> | ||
|
|
||
| </manifest> |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,27 @@ | ||||||||||||||||||||||||||||||
| package com.twix.onboarding.couple | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| import androidx.compose.foundation.layout.Arrangement | ||||||||||||||||||||||||||||||
| import androidx.compose.foundation.layout.Column | ||||||||||||||||||||||||||||||
| import androidx.compose.foundation.layout.fillMaxSize | ||||||||||||||||||||||||||||||
| import androidx.compose.material3.Button | ||||||||||||||||||||||||||||||
| import androidx.compose.material3.Text | ||||||||||||||||||||||||||||||
| import androidx.compose.runtime.Composable | ||||||||||||||||||||||||||||||
| import androidx.compose.ui.Alignment | ||||||||||||||||||||||||||||||
| import androidx.compose.ui.Modifier | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| @Composable | ||||||||||||||||||||||||||||||
| fun CoupleConnectRoute(onNext: () -> Unit) { | ||||||||||||||||||||||||||||||
| Column( | ||||||||||||||||||||||||||||||
| modifier = Modifier.fillMaxSize(), | ||||||||||||||||||||||||||||||
| verticalArrangement = Arrangement.Center, | ||||||||||||||||||||||||||||||
| horizontalAlignment = Alignment.CenterHorizontally, | ||||||||||||||||||||||||||||||
| ) { | ||||||||||||||||||||||||||||||
| Text("커플 등록 등록 화면") | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| Button( | ||||||||||||||||||||||||||||||
| onClick = { onNext() }, | ||||||||||||||||||||||||||||||
| ) { | ||||||||||||||||||||||||||||||
| Text("다음") | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
Comment on lines
+136
to
+143
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
현재
🛠️ 수정 제안: visible 파라미터 활용- if (showRestoreSheet) {
- CommonBottomSheet(
- visible = true,
- config = CommonBottomSheetConfig(showHandle = false),
- onDismissRequest = onDismissSheet,
- content = { RestoreCoupleBottomSheetContent() },
- )
- }
+ CommonBottomSheet(
+ visible = showRestoreSheet,
+ config = CommonBottomSheetConfig(showHandle = false),
+ onDismissRequest = onDismissSheet,
+ content = { RestoreCoupleBottomSheetContent() },
+ )📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| package com.twix.onboarding.dday | ||
|
|
||
| import androidx.compose.foundation.layout.Arrangement | ||
| import androidx.compose.foundation.layout.Column | ||
| import androidx.compose.foundation.layout.fillMaxSize | ||
| import androidx.compose.material3.Button | ||
| import androidx.compose.material3.Text | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.ui.Alignment | ||
| import androidx.compose.ui.Modifier | ||
|
|
||
| @Composable | ||
| fun DdayRouete( | ||
| onComplete: () -> Unit, | ||
| onBack: () -> Unit, | ||
| ) { | ||
| Column( | ||
| modifier = Modifier.fillMaxSize(), | ||
| verticalArrangement = Arrangement.Center, | ||
| horizontalAlignment = Alignment.CenterHorizontally, | ||
| ) { | ||
| Text("디데이 등록 화면") | ||
|
|
||
| Button( | ||
| onClick = { onBack() }, | ||
| ) { | ||
| Text("뒤로") | ||
| } | ||
|
|
||
| Button( | ||
| onClick = { onComplete() }, | ||
| ) { | ||
| Text("다음") | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| package com.twix.onboarding.di | ||
|
|
||
| import com.twix.navigation.NavRoutes | ||
| import com.twix.navigation.base.NavGraphContributor | ||
| import com.twix.onboarding.navigation.OnboardingNavGraph | ||
| import com.twix.onboarding.vm.OnBoardingViewModel | ||
| import org.koin.core.module.dsl.viewModelOf | ||
| import org.koin.core.qualifier.named | ||
| import org.koin.dsl.module | ||
|
|
||
| val onBoardingModule = | ||
| module { | ||
| viewModelOf(::OnBoardingViewModel) | ||
| single<NavGraphContributor>(named(NavRoutes.OnboardingRoute.route)) { OnboardingNavGraph } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| package com.twix.onboarding.model | ||
|
|
||
| import com.twix.ui.base.Intent | ||
|
|
||
| sealed interface OnBoardingIntent : Intent { | ||
| data class WriteNickName( | ||
| val value: String, | ||
| ) : OnBoardingIntent | ||
|
|
||
| data object SubmitNickName : OnBoardingIntent | ||
| } | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| package com.twix.onboarding.model | ||
|
|
||
| import com.twix.ui.base.SideEffect | ||
|
|
||
| sealed interface OnBoardingSideEffect : SideEffect { | ||
| sealed interface ProfileSetting : OnBoardingSideEffect { | ||
| data object ShowInvalidNickNameToast : ProfileSetting | ||
|
|
||
| data object NavigateToNext : ProfileSetting | ||
| } | ||
chanho0908 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| sealed interface CoupleConnection : OnBoardingSideEffect | ||
|
|
||
| sealed interface DDaySetting : OnBoardingSideEffect | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| package com.twix.onboarding.model | ||
|
|
||
| import androidx.compose.runtime.Immutable | ||
| import com.twix.onboarding.profile.ProfileUiModel | ||
| import com.twix.ui.base.State | ||
|
|
||
| @Immutable | ||
| data class OnBoardingUiState( | ||
| val profile: ProfileUiModel = ProfileUiModel(), | ||
| ) : State { | ||
| val isValidNickName: Boolean | ||
| get() = profile.isValid | ||
|
|
||
| fun updateNickName(value: String) = copy(profile = profile.updateNickname(value)) | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| package com.twix.onboarding.navigation | ||
|
|
||
| import androidx.navigation.NavGraphBuilder | ||
| import androidx.navigation.NavHostController | ||
| import androidx.navigation.compose.composable | ||
| import androidx.navigation.navigation | ||
| import com.twix.navigation.NavRoutes | ||
| import com.twix.navigation.base.NavGraphContributor | ||
| import com.twix.onboarding.couple.CoupleConnectRoute | ||
| import com.twix.onboarding.dday.DdayRouete | ||
chanho0908 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| import com.twix.onboarding.profile.ProfileRoute | ||
|
|
||
| object OnboardingNavGraph : NavGraphContributor { | ||
| override val graphRoute: NavRoutes | ||
| get() = NavRoutes.OnboardingGraph | ||
|
|
||
| override val startDestination: String | ||
| get() = NavRoutes.CoupleConnectionRoute.route | ||
|
|
||
| override val priority: Int = 2 | ||
|
|
||
| override fun NavGraphBuilder.registerGraph(navController: NavHostController) { | ||
| navigation( | ||
| route = graphRoute.route, | ||
| startDestination = startDestination, | ||
| ) { | ||
| composable(NavRoutes.CoupleConnectionRoute.route) { | ||
| CoupleConnectRoute( | ||
| onNext = { navController.navigate(NavRoutes.ProfileRoute.route) }, | ||
| ) | ||
| } | ||
| composable(NavRoutes.ProfileRoute.route) { | ||
| ProfileRoute( | ||
| onNext = { navController.navigate(NavRoutes.DdayRoute.route) }, | ||
| ) | ||
| } | ||
| composable(NavRoutes.DdayRoute.route) { | ||
| DdayRouete( | ||
| onComplete = { | ||
| navController.navigate(NavRoutes.MainGraph.route) { | ||
| popUpTo(graphRoute.route) { inclusive = true } | ||
| launchSingleTop = true | ||
| } | ||
| }, | ||
| onBack = { navController.popBackStack() }, | ||
| ) | ||
| } | ||
| } | ||
chanho0908 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.