From 6b107204967a548b526164f364625d7af8f43915 Mon Sep 17 00:00:00 2001 From: sksowk156 Date: Sat, 4 Jan 2025 15:20:10 +0900 Subject: [PATCH 1/3] =?UTF-8?q?[PC-253]=20=ED=8C=A8=ED=82=A4=EC=A7=80=20?= =?UTF-8?q?=EC=9E=AC=EC=A0=95=EB=A6=AC,=20=ED=99=94=EB=A9=B4=20=EC=83=9D?= =?UTF-8?q?=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/puzzle/piece/ViewModelsModule.kt | 4 +- .../main/java/com/puzzle/navigation/Route.kt | 6 ++ .../main/java/com/puzzle/auth/AuthScreen.kt | 57 ----------------- .../java/com/puzzle/auth/AuthViewModel.kt | 11 ---- .../puzzle/auth/navigation/AuthNavigation.kt | 2 +- .../com/puzzle/auth/page/main/AuthScreen.kt | 61 +++++++++++++++++++ .../puzzle/auth/page/main/AuthViewModel.kt | 13 ++++ .../auth/page/main/contract/AuthIntent.kt | 4 ++ .../auth/page/main/contract/AuthSideEffect.kt | 4 ++ .../auth/page/main/contract/AuthState.kt | 7 +++ .../registration/AuthRegistrationScreen.kt | 13 ++++ .../registration/AuthRegistrationViewModel.kt | 13 ++++ .../contract/AuthRegistrationIntent.kt | 4 ++ .../contract/AuthRegistrationSideEffect.kt | 4 ++ .../contract/AuthRegistrationState.kt | 7 +++ .../verification/AuthVerficationViewModel.kt | 13 ++++ .../verification/AuthVerificationScreen.kt | 13 ++++ .../contract/AuthVerficationState.kt | 7 +++ .../contract/AuthVerificationIntent.kt | 4 ++ .../contract/AuthVerificationSideEffect.kt | 4 ++ .../component/BasicInfoHeader.kt | 2 +- .../{ui => common/constant}/DialogType.kt | 2 +- .../content => common/ui}/BasicInfoBody.kt | 4 +- .../content => common/ui}/ValuePickBody.kt | 4 +- .../content => common/ui}/ValueTalkBody.kt | 4 +- .../matching/contract/MatchingSideEffect.kt | 3 - .../contract/MatchingDetailSideEffect.kt | 3 - .../matching/navigation/MatchingNavigation.kt | 4 +- .../{ => page}/detail/MatchingDetailRoute.kt | 16 ++--- .../detail/MatchingDetailViewModel.kt | 8 +-- .../detail/contract/MatchingDetailIntent.kt | 2 +- .../contract/MatchingDetailSideEffect.kt | 3 + .../detail/contract/MatchingDetailState.kt | 2 +- .../{ => page/main}/MatchingScreen.kt | 6 +- .../{ => page/main}/MatchingViewModel.kt | 8 +-- .../main}/contract/MatchingIntent.kt | 2 +- .../page/main/contract/MatchingSideEffect.kt | 3 + .../{ => page/main}/contract/MatchingState.kt | 2 +- .../setting/navigation/SettingNavigation.kt | 2 +- 39 files changed, 220 insertions(+), 111 deletions(-) delete mode 100644 feature/auth/src/main/java/com/puzzle/auth/AuthScreen.kt delete mode 100644 feature/auth/src/main/java/com/puzzle/auth/AuthViewModel.kt create mode 100644 feature/auth/src/main/java/com/puzzle/auth/page/main/AuthScreen.kt create mode 100644 feature/auth/src/main/java/com/puzzle/auth/page/main/AuthViewModel.kt create mode 100644 feature/auth/src/main/java/com/puzzle/auth/page/main/contract/AuthIntent.kt create mode 100644 feature/auth/src/main/java/com/puzzle/auth/page/main/contract/AuthSideEffect.kt create mode 100644 feature/auth/src/main/java/com/puzzle/auth/page/main/contract/AuthState.kt create mode 100644 feature/auth/src/main/java/com/puzzle/auth/page/registration/AuthRegistrationScreen.kt create mode 100644 feature/auth/src/main/java/com/puzzle/auth/page/registration/AuthRegistrationViewModel.kt create mode 100644 feature/auth/src/main/java/com/puzzle/auth/page/registration/contract/AuthRegistrationIntent.kt create mode 100644 feature/auth/src/main/java/com/puzzle/auth/page/registration/contract/AuthRegistrationSideEffect.kt create mode 100644 feature/auth/src/main/java/com/puzzle/auth/page/registration/contract/AuthRegistrationState.kt create mode 100644 feature/auth/src/main/java/com/puzzle/auth/page/verification/AuthVerficationViewModel.kt create mode 100644 feature/auth/src/main/java/com/puzzle/auth/page/verification/AuthVerificationScreen.kt create mode 100644 feature/auth/src/main/java/com/puzzle/auth/page/verification/contract/AuthVerficationState.kt create mode 100644 feature/auth/src/main/java/com/puzzle/auth/page/verification/contract/AuthVerificationIntent.kt create mode 100644 feature/auth/src/main/java/com/puzzle/auth/page/verification/contract/AuthVerificationSideEffect.kt rename feature/matching/src/main/java/com/puzzle/matching/{detail => common}/component/BasicInfoHeader.kt (97%) rename feature/matching/src/main/java/com/puzzle/matching/{ui => common/constant}/DialogType.kt (68%) rename feature/matching/src/main/java/com/puzzle/matching/{detail/content => common/ui}/BasicInfoBody.kt (98%) rename feature/matching/src/main/java/com/puzzle/matching/{detail/content => common/ui}/ValuePickBody.kt (99%) rename feature/matching/src/main/java/com/puzzle/matching/{detail/content => common/ui}/ValueTalkBody.kt (98%) delete mode 100644 feature/matching/src/main/java/com/puzzle/matching/contract/MatchingSideEffect.kt delete mode 100644 feature/matching/src/main/java/com/puzzle/matching/detail/contract/MatchingDetailSideEffect.kt rename feature/matching/src/main/java/com/puzzle/matching/{ => page}/detail/MatchingDetailRoute.kt (96%) rename feature/matching/src/main/java/com/puzzle/matching/{ => page}/detail/MatchingDetailViewModel.kt (91%) rename feature/matching/src/main/java/com/puzzle/matching/{ => page}/detail/contract/MatchingDetailIntent.kt (84%) create mode 100644 feature/matching/src/main/java/com/puzzle/matching/page/detail/contract/MatchingDetailSideEffect.kt rename feature/matching/src/main/java/com/puzzle/matching/{ => page}/detail/contract/MatchingDetailState.kt (97%) rename feature/matching/src/main/java/com/puzzle/matching/{ => page/main}/MatchingScreen.kt (98%) rename feature/matching/src/main/java/com/puzzle/matching/{ => page/main}/MatchingViewModel.kt (90%) rename feature/matching/src/main/java/com/puzzle/matching/{ => page/main}/contract/MatchingIntent.kt (66%) create mode 100644 feature/matching/src/main/java/com/puzzle/matching/page/main/contract/MatchingSideEffect.kt rename feature/matching/src/main/java/com/puzzle/matching/{ => page/main}/contract/MatchingState.kt (71%) diff --git a/app/src/main/java/com/puzzle/piece/ViewModelsModule.kt b/app/src/main/java/com/puzzle/piece/ViewModelsModule.kt index eca77fdf..7af46ec2 100644 --- a/app/src/main/java/com/puzzle/piece/ViewModelsModule.kt +++ b/app/src/main/java/com/puzzle/piece/ViewModelsModule.kt @@ -3,8 +3,8 @@ package com.puzzle.piece import com.airbnb.mvrx.hilt.AssistedViewModelFactory import com.airbnb.mvrx.hilt.MavericksViewModelComponent import com.airbnb.mvrx.hilt.ViewModelKey -import com.puzzle.matching.MatchingViewModel -import com.puzzle.matching.detail.MatchingDetailViewModel +import com.puzzle.matching.page.main.MatchingViewModel +import com.puzzle.matching.page.detail.MatchingDetailViewModel import dagger.Binds import dagger.Module import dagger.hilt.InstallIn diff --git a/core/navigation/src/main/java/com/puzzle/navigation/Route.kt b/core/navigation/src/main/java/com/puzzle/navigation/Route.kt index a2984cc5..cd1aceca 100644 --- a/core/navigation/src/main/java/com/puzzle/navigation/Route.kt +++ b/core/navigation/src/main/java/com/puzzle/navigation/Route.kt @@ -10,6 +10,12 @@ data object AuthGraph : Route sealed class AuthGraphDest : Route { @Serializable data object AuthRoute : AuthGraphDest() + + @Serializable + data object AuthVerificationRoute : AuthGraphDest() + + @Serializable + data object AuthRegistrationRoute : AuthGraphDest() } @Serializable diff --git a/feature/auth/src/main/java/com/puzzle/auth/AuthScreen.kt b/feature/auth/src/main/java/com/puzzle/auth/AuthScreen.kt deleted file mode 100644 index bc09bb1e..00000000 --- a/feature/auth/src/main/java/com/puzzle/auth/AuthScreen.kt +++ /dev/null @@ -1,57 +0,0 @@ -package com.puzzle.auth - -import android.util.Log -import androidx.compose.foundation.clickable -import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.fillMaxSize -import androidx.compose.material3.Text -import androidx.compose.runtime.Composable -import androidx.compose.ui.Modifier -import androidx.compose.ui.platform.LocalContext -import androidx.compose.ui.unit.sp -import androidx.hilt.navigation.compose.hiltViewModel -import com.kakao.sdk.user.UserApiClient -import com.puzzle.navigation.AuthGraph -import com.puzzle.navigation.MatchingGraph -import com.puzzle.navigation.NavigationEvent - -@Composable -fun AuthRoute(viewModel: AuthViewModel = hiltViewModel()) { - val context = LocalContext.current - - Column( - modifier = Modifier - .fillMaxSize() - .clickable { - viewModel.navigationHelper.navigate( - NavigationEvent.NavigateTo( - route = MatchingGraph, - popUpTo = AuthGraph, - ) - ) - }, - ) { - Text( - text = "카카오 로그인", - fontSize = 30.sp, - modifier = Modifier.clickable { - UserApiClient.instance.loginWithKakaoAccount(context) { token, error -> - if (error != null) { - Log.e("test", "로그인 실패", error) - } else if (token != null) { - Log.i("test", "로그인 성공 ${token.accessToken}") - } - } - } - ) - - Text( - text = "AuthRoute", - fontSize = 30.sp, - ) - } -} - -@Composable -fun AuthScreen() { -} \ No newline at end of file diff --git a/feature/auth/src/main/java/com/puzzle/auth/AuthViewModel.kt b/feature/auth/src/main/java/com/puzzle/auth/AuthViewModel.kt deleted file mode 100644 index 9e2d0a94..00000000 --- a/feature/auth/src/main/java/com/puzzle/auth/AuthViewModel.kt +++ /dev/null @@ -1,11 +0,0 @@ -package com.puzzle.auth - -import androidx.lifecycle.ViewModel -import com.puzzle.navigation.NavigationHelper -import dagger.hilt.android.lifecycle.HiltViewModel -import javax.inject.Inject - -@HiltViewModel -class AuthViewModel @Inject constructor( - val navigationHelper: NavigationHelper, -) : ViewModel() {} \ No newline at end of file diff --git a/feature/auth/src/main/java/com/puzzle/auth/navigation/AuthNavigation.kt b/feature/auth/src/main/java/com/puzzle/auth/navigation/AuthNavigation.kt index 72f3ce6d..bbe935e4 100644 --- a/feature/auth/src/main/java/com/puzzle/auth/navigation/AuthNavigation.kt +++ b/feature/auth/src/main/java/com/puzzle/auth/navigation/AuthNavigation.kt @@ -3,7 +3,7 @@ package com.puzzle.auth.navigation import androidx.navigation.NavGraphBuilder import androidx.navigation.compose.composable import androidx.navigation.navigation -import com.puzzle.auth.AuthRoute +import com.puzzle.auth.page.main.AuthRoute import com.puzzle.navigation.AuthGraph import com.puzzle.navigation.AuthGraphDest diff --git a/feature/auth/src/main/java/com/puzzle/auth/page/main/AuthScreen.kt b/feature/auth/src/main/java/com/puzzle/auth/page/main/AuthScreen.kt new file mode 100644 index 00000000..127aaa36 --- /dev/null +++ b/feature/auth/src/main/java/com/puzzle/auth/page/main/AuthScreen.kt @@ -0,0 +1,61 @@ +package com.puzzle.auth.page.main + +import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.tooling.preview.Preview +import com.airbnb.mvrx.compose.collectAsState +import com.airbnb.mvrx.compose.mavericksViewModel + +@Composable +fun AuthRoute( + viewModel: AuthViewModel = mavericksViewModel(), +) { + val state by viewModel.collectAsState() + val context = LocalContext.current + + AuthScreen( + + ) +} + +@Composable +fun AuthScreen() { +// Column( +// modifier = Modifier +// .fillMaxSize() +// .clickable { +// viewModel.navigationHelper.navigate( +// NavigationEvent.NavigateTo( +// route = MatchingGraph, +// popUpTo = AuthGraph, +// ) +// ) +// }, +// ) { +// Text( +// text = "카카오 로그인", +// fontSize = 30.sp, +// modifier = Modifier.clickable { +// UserApiClient.instance.loginWithKakaoAccount(context) { token, error -> +// if (error != null) { +// Log.e("test", "로그인 실패", error) +// } else if (token != null) { +// Log.i("test", "로그인 성공 ${token.accessToken}") +// } +// } +// } +// ) +// +// Text( +// text = "AuthRoute", +// fontSize = 30.sp, +// ) +// } +} + +@Preview +@Composable +fun PreviewAuthScreen() { + +} \ No newline at end of file diff --git a/feature/auth/src/main/java/com/puzzle/auth/page/main/AuthViewModel.kt b/feature/auth/src/main/java/com/puzzle/auth/page/main/AuthViewModel.kt new file mode 100644 index 00000000..54da4d45 --- /dev/null +++ b/feature/auth/src/main/java/com/puzzle/auth/page/main/AuthViewModel.kt @@ -0,0 +1,13 @@ +package com.puzzle.auth.page.main + +import com.airbnb.mvrx.MavericksViewModel +import com.puzzle.auth.page.main.contract.AuthState +import com.puzzle.navigation.NavigationHelper +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject + +class AuthViewModel @AssistedInject constructor( + @Assisted initialState: AuthState, + private val navigationHelper: NavigationHelper, +) : MavericksViewModel(initialState) { +} \ No newline at end of file diff --git a/feature/auth/src/main/java/com/puzzle/auth/page/main/contract/AuthIntent.kt b/feature/auth/src/main/java/com/puzzle/auth/page/main/contract/AuthIntent.kt new file mode 100644 index 00000000..2320c4b1 --- /dev/null +++ b/feature/auth/src/main/java/com/puzzle/auth/page/main/contract/AuthIntent.kt @@ -0,0 +1,4 @@ +package com.puzzle.auth.page.main.contract + +class AuthIntent { +} \ No newline at end of file diff --git a/feature/auth/src/main/java/com/puzzle/auth/page/main/contract/AuthSideEffect.kt b/feature/auth/src/main/java/com/puzzle/auth/page/main/contract/AuthSideEffect.kt new file mode 100644 index 00000000..b5676f6b --- /dev/null +++ b/feature/auth/src/main/java/com/puzzle/auth/page/main/contract/AuthSideEffect.kt @@ -0,0 +1,4 @@ +package com.puzzle.auth.page.main.contract + +class AuthSideEffect { +} \ No newline at end of file diff --git a/feature/auth/src/main/java/com/puzzle/auth/page/main/contract/AuthState.kt b/feature/auth/src/main/java/com/puzzle/auth/page/main/contract/AuthState.kt new file mode 100644 index 00000000..0cb7068e --- /dev/null +++ b/feature/auth/src/main/java/com/puzzle/auth/page/main/contract/AuthState.kt @@ -0,0 +1,7 @@ +package com.puzzle.auth.page.main.contract + +import com.airbnb.mvrx.MavericksState + +data class AuthState( + val a: Boolean, +) : MavericksState \ No newline at end of file diff --git a/feature/auth/src/main/java/com/puzzle/auth/page/registration/AuthRegistrationScreen.kt b/feature/auth/src/main/java/com/puzzle/auth/page/registration/AuthRegistrationScreen.kt new file mode 100644 index 00000000..4088d0b8 --- /dev/null +++ b/feature/auth/src/main/java/com/puzzle/auth/page/registration/AuthRegistrationScreen.kt @@ -0,0 +1,13 @@ +package com.puzzle.auth.page.registration + +import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import com.airbnb.mvrx.compose.collectAsState +import com.airbnb.mvrx.compose.mavericksViewModel + +@Composable +internal fun AuthRegistrationScreen( + viewModel: AuthRegistrationViewModel = mavericksViewModel() +) { + val state by viewModel.collectAsState() +} diff --git a/feature/auth/src/main/java/com/puzzle/auth/page/registration/AuthRegistrationViewModel.kt b/feature/auth/src/main/java/com/puzzle/auth/page/registration/AuthRegistrationViewModel.kt new file mode 100644 index 00000000..bf1c512b --- /dev/null +++ b/feature/auth/src/main/java/com/puzzle/auth/page/registration/AuthRegistrationViewModel.kt @@ -0,0 +1,13 @@ +package com.puzzle.auth.page.registration + +import com.airbnb.mvrx.MavericksViewModel +import com.puzzle.auth.page.registration.contract.AuthRegistrationState +import com.puzzle.navigation.NavigationHelper +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject + +class AuthRegistrationViewModel @AssistedInject constructor( + @Assisted initialState: AuthRegistrationState, + private val navigationHelper: NavigationHelper, +) : MavericksViewModel(initialState) { +} \ No newline at end of file diff --git a/feature/auth/src/main/java/com/puzzle/auth/page/registration/contract/AuthRegistrationIntent.kt b/feature/auth/src/main/java/com/puzzle/auth/page/registration/contract/AuthRegistrationIntent.kt new file mode 100644 index 00000000..284aa115 --- /dev/null +++ b/feature/auth/src/main/java/com/puzzle/auth/page/registration/contract/AuthRegistrationIntent.kt @@ -0,0 +1,4 @@ +package com.puzzle.auth.page.registration.contract + +sealed class AuthRegistrationIntent { +} \ No newline at end of file diff --git a/feature/auth/src/main/java/com/puzzle/auth/page/registration/contract/AuthRegistrationSideEffect.kt b/feature/auth/src/main/java/com/puzzle/auth/page/registration/contract/AuthRegistrationSideEffect.kt new file mode 100644 index 00000000..0c846afe --- /dev/null +++ b/feature/auth/src/main/java/com/puzzle/auth/page/registration/contract/AuthRegistrationSideEffect.kt @@ -0,0 +1,4 @@ +package com.puzzle.auth.page.registration.contract + +sealed class AuthRegistrationSideEffect { +} \ No newline at end of file diff --git a/feature/auth/src/main/java/com/puzzle/auth/page/registration/contract/AuthRegistrationState.kt b/feature/auth/src/main/java/com/puzzle/auth/page/registration/contract/AuthRegistrationState.kt new file mode 100644 index 00000000..4c1ddea3 --- /dev/null +++ b/feature/auth/src/main/java/com/puzzle/auth/page/registration/contract/AuthRegistrationState.kt @@ -0,0 +1,7 @@ +package com.puzzle.auth.page.registration.contract + +import com.airbnb.mvrx.MavericksState + +data class AuthRegistrationState( + val a: Boolean, +) : MavericksState \ No newline at end of file diff --git a/feature/auth/src/main/java/com/puzzle/auth/page/verification/AuthVerficationViewModel.kt b/feature/auth/src/main/java/com/puzzle/auth/page/verification/AuthVerficationViewModel.kt new file mode 100644 index 00000000..a087544c --- /dev/null +++ b/feature/auth/src/main/java/com/puzzle/auth/page/verification/AuthVerficationViewModel.kt @@ -0,0 +1,13 @@ +package com.puzzle.auth.page.verification + +import com.airbnb.mvrx.MavericksViewModel +import com.puzzle.auth.page.verification.contract.AuthVerficationState +import com.puzzle.navigation.NavigationHelper +import dagger.assisted.Assisted +import dagger.assisted.AssistedInject + +class AuthVerficationViewModel @AssistedInject constructor( + @Assisted initialState: AuthVerficationState, + private val navigationHelper: NavigationHelper, +) : MavericksViewModel(initialState) { +} diff --git a/feature/auth/src/main/java/com/puzzle/auth/page/verification/AuthVerificationScreen.kt b/feature/auth/src/main/java/com/puzzle/auth/page/verification/AuthVerificationScreen.kt new file mode 100644 index 00000000..4697ea37 --- /dev/null +++ b/feature/auth/src/main/java/com/puzzle/auth/page/verification/AuthVerificationScreen.kt @@ -0,0 +1,13 @@ +package com.puzzle.auth.page.verification + +import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import com.airbnb.mvrx.compose.collectAsState +import com.airbnb.mvrx.compose.mavericksViewModel + +@Composable +internal fun AuthVerificationRoute( + viewModel: AuthVerficationViewModel = mavericksViewModel() +) { + val state by viewModel.collectAsState() +} diff --git a/feature/auth/src/main/java/com/puzzle/auth/page/verification/contract/AuthVerficationState.kt b/feature/auth/src/main/java/com/puzzle/auth/page/verification/contract/AuthVerficationState.kt new file mode 100644 index 00000000..d0ebeae2 --- /dev/null +++ b/feature/auth/src/main/java/com/puzzle/auth/page/verification/contract/AuthVerficationState.kt @@ -0,0 +1,7 @@ +package com.puzzle.auth.page.verification.contract + +import com.airbnb.mvrx.MavericksState + +data class AuthVerficationState( + val a: Boolean, +) : MavericksState \ No newline at end of file diff --git a/feature/auth/src/main/java/com/puzzle/auth/page/verification/contract/AuthVerificationIntent.kt b/feature/auth/src/main/java/com/puzzle/auth/page/verification/contract/AuthVerificationIntent.kt new file mode 100644 index 00000000..940ed9fc --- /dev/null +++ b/feature/auth/src/main/java/com/puzzle/auth/page/verification/contract/AuthVerificationIntent.kt @@ -0,0 +1,4 @@ +package com.puzzle.auth.page.verification.contract + +sealed class AuthVerificationIntent { +} \ No newline at end of file diff --git a/feature/auth/src/main/java/com/puzzle/auth/page/verification/contract/AuthVerificationSideEffect.kt b/feature/auth/src/main/java/com/puzzle/auth/page/verification/contract/AuthVerificationSideEffect.kt new file mode 100644 index 00000000..bc2a8817 --- /dev/null +++ b/feature/auth/src/main/java/com/puzzle/auth/page/verification/contract/AuthVerificationSideEffect.kt @@ -0,0 +1,4 @@ +package com.puzzle.auth.page.verification.contract + +sealed class AuthVerificationSideEffect { +} \ No newline at end of file diff --git a/feature/matching/src/main/java/com/puzzle/matching/detail/component/BasicInfoHeader.kt b/feature/matching/src/main/java/com/puzzle/matching/common/component/BasicInfoHeader.kt similarity index 97% rename from feature/matching/src/main/java/com/puzzle/matching/detail/component/BasicInfoHeader.kt rename to feature/matching/src/main/java/com/puzzle/matching/common/component/BasicInfoHeader.kt index b04660fe..3bf40348 100644 --- a/feature/matching/src/main/java/com/puzzle/matching/detail/component/BasicInfoHeader.kt +++ b/feature/matching/src/main/java/com/puzzle/matching/common/component/BasicInfoHeader.kt @@ -1,4 +1,4 @@ -package com.puzzle.matching.detail.component +package com.puzzle.matching.common.component import androidx.compose.foundation.Image import androidx.compose.foundation.clickable diff --git a/feature/matching/src/main/java/com/puzzle/matching/ui/DialogType.kt b/feature/matching/src/main/java/com/puzzle/matching/common/constant/DialogType.kt similarity index 68% rename from feature/matching/src/main/java/com/puzzle/matching/ui/DialogType.kt rename to feature/matching/src/main/java/com/puzzle/matching/common/constant/DialogType.kt index 83edec2e..4e0a1141 100644 --- a/feature/matching/src/main/java/com/puzzle/matching/ui/DialogType.kt +++ b/feature/matching/src/main/java/com/puzzle/matching/common/constant/DialogType.kt @@ -1,4 +1,4 @@ -package com.puzzle.matching.ui +package com.puzzle.matching.common.constant enum class DialogType { ACCEPT_MATCHING, diff --git a/feature/matching/src/main/java/com/puzzle/matching/detail/content/BasicInfoBody.kt b/feature/matching/src/main/java/com/puzzle/matching/common/ui/BasicInfoBody.kt similarity index 98% rename from feature/matching/src/main/java/com/puzzle/matching/detail/content/BasicInfoBody.kt rename to feature/matching/src/main/java/com/puzzle/matching/common/ui/BasicInfoBody.kt index 082701fd..3ef8288b 100644 --- a/feature/matching/src/main/java/com/puzzle/matching/detail/content/BasicInfoBody.kt +++ b/feature/matching/src/main/java/com/puzzle/matching/common/ui/BasicInfoBody.kt @@ -1,4 +1,4 @@ -package com.puzzle.matching.detail.content +package com.puzzle.matching.common.ui import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement @@ -21,7 +21,7 @@ import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import com.puzzle.designsystem.R import com.puzzle.designsystem.foundation.PieceTheme -import com.puzzle.matching.detail.component.BasicInfoHeader +import com.puzzle.matching.common.component.BasicInfoHeader @Composable internal fun BasicInfoBody( diff --git a/feature/matching/src/main/java/com/puzzle/matching/detail/content/ValuePickBody.kt b/feature/matching/src/main/java/com/puzzle/matching/common/ui/ValuePickBody.kt similarity index 99% rename from feature/matching/src/main/java/com/puzzle/matching/detail/content/ValuePickBody.kt rename to feature/matching/src/main/java/com/puzzle/matching/common/ui/ValuePickBody.kt index a7885903..7cc76c70 100644 --- a/feature/matching/src/main/java/com/puzzle/matching/detail/content/ValuePickBody.kt +++ b/feature/matching/src/main/java/com/puzzle/matching/common/ui/ValuePickBody.kt @@ -1,4 +1,4 @@ -package com.puzzle.matching.detail.content +package com.puzzle.matching.common.ui import androidx.compose.foundation.Image import androidx.compose.foundation.background @@ -45,7 +45,7 @@ import com.puzzle.designsystem.R import com.puzzle.designsystem.component.PieceSubButton import com.puzzle.designsystem.foundation.PieceTheme import com.puzzle.domain.model.pick.ValuePick -import com.puzzle.matching.detail.component.BasicInfoHeader +import com.puzzle.matching.common.component.BasicInfoHeader @Composable internal fun ValuePickBody( diff --git a/feature/matching/src/main/java/com/puzzle/matching/detail/content/ValueTalkBody.kt b/feature/matching/src/main/java/com/puzzle/matching/common/ui/ValueTalkBody.kt similarity index 98% rename from feature/matching/src/main/java/com/puzzle/matching/detail/content/ValueTalkBody.kt rename to feature/matching/src/main/java/com/puzzle/matching/common/ui/ValueTalkBody.kt index 569eba1b..7d43cb91 100644 --- a/feature/matching/src/main/java/com/puzzle/matching/detail/content/ValueTalkBody.kt +++ b/feature/matching/src/main/java/com/puzzle/matching/common/ui/ValueTalkBody.kt @@ -1,4 +1,4 @@ -package com.puzzle.matching.detail.content +package com.puzzle.matching.common.ui import androidx.compose.foundation.Image import androidx.compose.foundation.background @@ -32,7 +32,7 @@ import com.puzzle.common.ui.CollapsingHeaderNestedScrollConnection import com.puzzle.designsystem.R import com.puzzle.designsystem.foundation.PieceTheme import com.puzzle.domain.model.value.ValueTalk -import com.puzzle.matching.detail.component.BasicInfoHeader +import com.puzzle.matching.common.component.BasicInfoHeader @Composable internal fun ValueTalkBody( diff --git a/feature/matching/src/main/java/com/puzzle/matching/contract/MatchingSideEffect.kt b/feature/matching/src/main/java/com/puzzle/matching/contract/MatchingSideEffect.kt deleted file mode 100644 index bc40ac8b..00000000 --- a/feature/matching/src/main/java/com/puzzle/matching/contract/MatchingSideEffect.kt +++ /dev/null @@ -1,3 +0,0 @@ -package com.puzzle.matching.contract - -sealed class MatchingSideEffect \ No newline at end of file diff --git a/feature/matching/src/main/java/com/puzzle/matching/detail/contract/MatchingDetailSideEffect.kt b/feature/matching/src/main/java/com/puzzle/matching/detail/contract/MatchingDetailSideEffect.kt deleted file mode 100644 index 01cc04a6..00000000 --- a/feature/matching/src/main/java/com/puzzle/matching/detail/contract/MatchingDetailSideEffect.kt +++ /dev/null @@ -1,3 +0,0 @@ -package com.puzzle.matching.detail.contract - -sealed class MatchingDetailSideEffect \ No newline at end of file diff --git a/feature/matching/src/main/java/com/puzzle/matching/navigation/MatchingNavigation.kt b/feature/matching/src/main/java/com/puzzle/matching/navigation/MatchingNavigation.kt index bde8122d..98e0cd1e 100644 --- a/feature/matching/src/main/java/com/puzzle/matching/navigation/MatchingNavigation.kt +++ b/feature/matching/src/main/java/com/puzzle/matching/navigation/MatchingNavigation.kt @@ -3,8 +3,8 @@ package com.puzzle.matching.navigation import androidx.navigation.NavGraphBuilder import androidx.navigation.compose.composable import androidx.navigation.navigation -import com.puzzle.matching.MatchingRoute -import com.puzzle.matching.detail.MatchingDetailRoute +import com.puzzle.matching.page.detail.MatchingDetailRoute +import com.puzzle.matching.page.main.MatchingRoute import com.puzzle.navigation.MatchingGraph import com.puzzle.navigation.MatchingGraphDest diff --git a/feature/matching/src/main/java/com/puzzle/matching/detail/MatchingDetailRoute.kt b/feature/matching/src/main/java/com/puzzle/matching/page/detail/MatchingDetailRoute.kt similarity index 96% rename from feature/matching/src/main/java/com/puzzle/matching/detail/MatchingDetailRoute.kt rename to feature/matching/src/main/java/com/puzzle/matching/page/detail/MatchingDetailRoute.kt index e618f25c..1dc4f5a5 100644 --- a/feature/matching/src/main/java/com/puzzle/matching/detail/MatchingDetailRoute.kt +++ b/feature/matching/src/main/java/com/puzzle/matching/page/detail/MatchingDetailRoute.kt @@ -1,4 +1,4 @@ -package com.puzzle.matching.detail +package com.puzzle.matching.page.detail import androidx.compose.foundation.Image import androidx.compose.foundation.background @@ -37,13 +37,13 @@ import com.puzzle.designsystem.component.PieceImageDialog import com.puzzle.designsystem.component.PieceRoundingButton import com.puzzle.designsystem.component.PieceSubCloseTopBar import com.puzzle.designsystem.foundation.PieceTheme -import com.puzzle.matching.detail.content.BasicInfoBody -import com.puzzle.matching.detail.content.ValuePickBody -import com.puzzle.matching.detail.content.ValueTalkBody -import com.puzzle.matching.detail.contract.MatchingDetailIntent -import com.puzzle.matching.detail.contract.MatchingDetailState -import com.puzzle.matching.detail.contract.MatchingDetailState.MatchingDetailPage -import com.puzzle.matching.ui.DialogType +import com.puzzle.matching.common.constant.DialogType +import com.puzzle.matching.common.ui.BasicInfoBody +import com.puzzle.matching.common.ui.ValuePickBody +import com.puzzle.matching.common.ui.ValueTalkBody +import com.puzzle.matching.page.detail.contract.MatchingDetailIntent +import com.puzzle.matching.page.detail.contract.MatchingDetailState +import com.puzzle.matching.page.detail.contract.MatchingDetailState.MatchingDetailPage import com.skydoves.cloudy.cloudy @Composable diff --git a/feature/matching/src/main/java/com/puzzle/matching/detail/MatchingDetailViewModel.kt b/feature/matching/src/main/java/com/puzzle/matching/page/detail/MatchingDetailViewModel.kt similarity index 91% rename from feature/matching/src/main/java/com/puzzle/matching/detail/MatchingDetailViewModel.kt rename to feature/matching/src/main/java/com/puzzle/matching/page/detail/MatchingDetailViewModel.kt index b868425b..1360c859 100644 --- a/feature/matching/src/main/java/com/puzzle/matching/detail/MatchingDetailViewModel.kt +++ b/feature/matching/src/main/java/com/puzzle/matching/page/detail/MatchingDetailViewModel.kt @@ -1,12 +1,12 @@ -package com.puzzle.matching.detail +package com.puzzle.matching.page.detail import com.airbnb.mvrx.MavericksViewModel import com.airbnb.mvrx.MavericksViewModelFactory import com.airbnb.mvrx.hilt.AssistedViewModelFactory import com.airbnb.mvrx.hilt.hiltMavericksViewModelFactory -import com.puzzle.matching.detail.contract.MatchingDetailIntent -import com.puzzle.matching.detail.contract.MatchingDetailSideEffect -import com.puzzle.matching.detail.contract.MatchingDetailState +import com.puzzle.matching.page.detail.contract.MatchingDetailIntent +import com.puzzle.matching.page.detail.contract.MatchingDetailSideEffect +import com.puzzle.matching.page.detail.contract.MatchingDetailState import com.puzzle.navigation.NavigationEvent import com.puzzle.navigation.NavigationHelper import dagger.assisted.Assisted diff --git a/feature/matching/src/main/java/com/puzzle/matching/detail/contract/MatchingDetailIntent.kt b/feature/matching/src/main/java/com/puzzle/matching/page/detail/contract/MatchingDetailIntent.kt similarity index 84% rename from feature/matching/src/main/java/com/puzzle/matching/detail/contract/MatchingDetailIntent.kt rename to feature/matching/src/main/java/com/puzzle/matching/page/detail/contract/MatchingDetailIntent.kt index 592bb104..89b80b88 100644 --- a/feature/matching/src/main/java/com/puzzle/matching/detail/contract/MatchingDetailIntent.kt +++ b/feature/matching/src/main/java/com/puzzle/matching/page/detail/contract/MatchingDetailIntent.kt @@ -1,4 +1,4 @@ -package com.puzzle.matching.detail.contract +package com.puzzle.matching.page.detail.contract sealed class MatchingDetailIntent { data object OnMatchingDetailCloseClick : MatchingDetailIntent() diff --git a/feature/matching/src/main/java/com/puzzle/matching/page/detail/contract/MatchingDetailSideEffect.kt b/feature/matching/src/main/java/com/puzzle/matching/page/detail/contract/MatchingDetailSideEffect.kt new file mode 100644 index 00000000..5d2ef2ea --- /dev/null +++ b/feature/matching/src/main/java/com/puzzle/matching/page/detail/contract/MatchingDetailSideEffect.kt @@ -0,0 +1,3 @@ +package com.puzzle.matching.page.detail.contract + +sealed class MatchingDetailSideEffect \ No newline at end of file diff --git a/feature/matching/src/main/java/com/puzzle/matching/detail/contract/MatchingDetailState.kt b/feature/matching/src/main/java/com/puzzle/matching/page/detail/contract/MatchingDetailState.kt similarity index 97% rename from feature/matching/src/main/java/com/puzzle/matching/detail/contract/MatchingDetailState.kt rename to feature/matching/src/main/java/com/puzzle/matching/page/detail/contract/MatchingDetailState.kt index d3c69a90..5d28d15f 100644 --- a/feature/matching/src/main/java/com/puzzle/matching/detail/contract/MatchingDetailState.kt +++ b/feature/matching/src/main/java/com/puzzle/matching/page/detail/contract/MatchingDetailState.kt @@ -1,4 +1,4 @@ -package com.puzzle.matching.detail.contract +package com.puzzle.matching.page.detail.contract import com.airbnb.mvrx.MavericksState import com.puzzle.domain.model.pick.ValuePick diff --git a/feature/matching/src/main/java/com/puzzle/matching/MatchingScreen.kt b/feature/matching/src/main/java/com/puzzle/matching/page/main/MatchingScreen.kt similarity index 98% rename from feature/matching/src/main/java/com/puzzle/matching/MatchingScreen.kt rename to feature/matching/src/main/java/com/puzzle/matching/page/main/MatchingScreen.kt index 9db06406..aa217539 100644 --- a/feature/matching/src/main/java/com/puzzle/matching/MatchingScreen.kt +++ b/feature/matching/src/main/java/com/puzzle/matching/page/main/MatchingScreen.kt @@ -1,4 +1,4 @@ -package com.puzzle.matching +package com.puzzle.matching.page.main import androidx.compose.foundation.Image import androidx.compose.foundation.background @@ -40,8 +40,8 @@ import com.puzzle.designsystem.R import com.puzzle.designsystem.component.PieceMainTopBar import com.puzzle.designsystem.component.PieceSolidButton import com.puzzle.designsystem.foundation.PieceTheme -import com.puzzle.matching.contract.MatchingIntent -import com.puzzle.matching.contract.MatchingState +import com.puzzle.matching.page.main.contract.MatchingIntent +import com.puzzle.matching.page.main.contract.MatchingState @Composable internal fun MatchingRoute( diff --git a/feature/matching/src/main/java/com/puzzle/matching/MatchingViewModel.kt b/feature/matching/src/main/java/com/puzzle/matching/page/main/MatchingViewModel.kt similarity index 90% rename from feature/matching/src/main/java/com/puzzle/matching/MatchingViewModel.kt rename to feature/matching/src/main/java/com/puzzle/matching/page/main/MatchingViewModel.kt index 3548ed1a..3cb43e8e 100644 --- a/feature/matching/src/main/java/com/puzzle/matching/MatchingViewModel.kt +++ b/feature/matching/src/main/java/com/puzzle/matching/page/main/MatchingViewModel.kt @@ -1,12 +1,12 @@ -package com.puzzle.matching +package com.puzzle.matching.page.main import com.airbnb.mvrx.MavericksViewModel import com.airbnb.mvrx.MavericksViewModelFactory import com.airbnb.mvrx.hilt.AssistedViewModelFactory import com.airbnb.mvrx.hilt.hiltMavericksViewModelFactory -import com.puzzle.matching.contract.MatchingIntent -import com.puzzle.matching.contract.MatchingSideEffect -import com.puzzle.matching.contract.MatchingState +import com.puzzle.matching.page.main.contract.MatchingIntent +import com.puzzle.matching.page.main.contract.MatchingSideEffect +import com.puzzle.matching.page.main.contract.MatchingState import com.puzzle.navigation.MatchingGraphDest import com.puzzle.navigation.NavigationEvent.NavigateTo import com.puzzle.navigation.NavigationHelper diff --git a/feature/matching/src/main/java/com/puzzle/matching/contract/MatchingIntent.kt b/feature/matching/src/main/java/com/puzzle/matching/page/main/contract/MatchingIntent.kt similarity index 66% rename from feature/matching/src/main/java/com/puzzle/matching/contract/MatchingIntent.kt rename to feature/matching/src/main/java/com/puzzle/matching/page/main/contract/MatchingIntent.kt index 956d6af9..690badd1 100644 --- a/feature/matching/src/main/java/com/puzzle/matching/contract/MatchingIntent.kt +++ b/feature/matching/src/main/java/com/puzzle/matching/page/main/contract/MatchingIntent.kt @@ -1,4 +1,4 @@ -package com.puzzle.matching.contract +package com.puzzle.matching.page.main.contract sealed class MatchingIntent { data object NavigateToMatchingDetail : MatchingIntent() diff --git a/feature/matching/src/main/java/com/puzzle/matching/page/main/contract/MatchingSideEffect.kt b/feature/matching/src/main/java/com/puzzle/matching/page/main/contract/MatchingSideEffect.kt new file mode 100644 index 00000000..42353313 --- /dev/null +++ b/feature/matching/src/main/java/com/puzzle/matching/page/main/contract/MatchingSideEffect.kt @@ -0,0 +1,3 @@ +package com.puzzle.matching.page.main.contract + +sealed class MatchingSideEffect \ No newline at end of file diff --git a/feature/matching/src/main/java/com/puzzle/matching/contract/MatchingState.kt b/feature/matching/src/main/java/com/puzzle/matching/page/main/contract/MatchingState.kt similarity index 71% rename from feature/matching/src/main/java/com/puzzle/matching/contract/MatchingState.kt rename to feature/matching/src/main/java/com/puzzle/matching/page/main/contract/MatchingState.kt index 3dff0434..052fb269 100644 --- a/feature/matching/src/main/java/com/puzzle/matching/contract/MatchingState.kt +++ b/feature/matching/src/main/java/com/puzzle/matching/page/main/contract/MatchingState.kt @@ -1,4 +1,4 @@ -package com.puzzle.matching.contract +package com.puzzle.matching.page.main.contract import com.airbnb.mvrx.MavericksState diff --git a/feature/setting/src/main/java/com/puzzle/setting/navigation/SettingNavigation.kt b/feature/setting/src/main/java/com/puzzle/setting/navigation/SettingNavigation.kt index 6b047673..64607c0e 100644 --- a/feature/setting/src/main/java/com/puzzle/setting/navigation/SettingNavigation.kt +++ b/feature/setting/src/main/java/com/puzzle/setting/navigation/SettingNavigation.kt @@ -2,8 +2,8 @@ package com.puzzle.setting.navigation import androidx.navigation.NavGraphBuilder import androidx.navigation.compose.composable -import com.puzzle.setting.SettingRoute import com.puzzle.navigation.SettingRoute +import com.puzzle.setting.SettingRoute fun NavGraphBuilder.settingScreen() { composable { From 04897e03a6a361a24f1c112b5021bae085ec0a24 Mon Sep 17 00:00:00 2001 From: sksowk156 Date: Sat, 4 Jan 2025 15:55:53 +0900 Subject: [PATCH 2/3] =?UTF-8?q?[PC-253]=20page=20->=20graph=20=EC=9D=B4?= =?UTF-8?q?=EB=A6=84=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/puzzle/piece/ViewModelsModule.kt | 4 +-- .../auth/{page => graph}/main/AuthScreen.kt | 13 +++++----- .../puzzle/auth/graph/main/AuthViewModel.kt | 25 +++++++++++++++++++ .../auth/graph/main/contract/AuthIntent.kt | 3 +++ .../graph/main/contract/AuthSideEffect.kt | 3 +++ .../main/contract/AuthState.kt | 4 +-- .../registration/AuthRegistrationScreen.kt | 2 +- .../registration/AuthRegistrationViewModel.kt | 25 +++++++++++++++++++ .../contract/AuthRegistrationIntent.kt | 3 +++ .../contract/AuthRegistrationSideEffect.kt | 3 +++ .../contract/AuthRegistrationState.kt | 4 +-- .../verification/AuthVerficationViewModel.kt | 24 ++++++++++++++++++ .../verification/AuthVerificationScreen.kt | 2 +- .../contract/AuthVerficationState.kt | 4 +-- .../contract/AuthVerificationIntent.kt | 3 +++ .../contract/AuthVerificationSideEffect.kt | 3 +++ .../puzzle/auth/navigation/AuthNavigation.kt | 2 +- .../puzzle/auth/page/main/AuthViewModel.kt | 13 ---------- .../auth/page/main/contract/AuthIntent.kt | 4 --- .../auth/page/main/contract/AuthSideEffect.kt | 4 --- .../registration/AuthRegistrationViewModel.kt | 13 ---------- .../contract/AuthRegistrationIntent.kt | 4 --- .../contract/AuthRegistrationSideEffect.kt | 4 --- .../verification/AuthVerficationViewModel.kt | 13 ---------- .../contract/AuthVerificationIntent.kt | 4 --- .../contract/AuthVerificationSideEffect.kt | 4 --- .../detail/MatchingDetailRoute.kt | 8 +++--- .../detail/MatchingDetailViewModel.kt | 8 +++--- .../detail/contract/MatchingDetailIntent.kt | 2 +- .../contract/MatchingDetailSideEffect.kt | 3 +++ .../detail/contract/MatchingDetailState.kt | 2 +- .../{page => graph}/main/MatchingScreen.kt | 6 ++--- .../{page => graph}/main/MatchingViewModel.kt | 8 +++--- .../main/contract/MatchingIntent.kt | 2 +- .../graph/main/contract/MatchingSideEffect.kt | 3 +++ .../main/contract/MatchingState.kt | 2 +- .../matching/navigation/MatchingNavigation.kt | 4 +-- .../contract/MatchingDetailSideEffect.kt | 3 --- .../page/main/contract/MatchingSideEffect.kt | 3 --- 39 files changed, 136 insertions(+), 108 deletions(-) rename feature/auth/src/main/java/com/puzzle/auth/{page => graph}/main/AuthScreen.kt (91%) create mode 100644 feature/auth/src/main/java/com/puzzle/auth/graph/main/AuthViewModel.kt create mode 100644 feature/auth/src/main/java/com/puzzle/auth/graph/main/contract/AuthIntent.kt create mode 100644 feature/auth/src/main/java/com/puzzle/auth/graph/main/contract/AuthSideEffect.kt rename feature/auth/src/main/java/com/puzzle/auth/{page => graph}/main/contract/AuthState.kt (52%) rename feature/auth/src/main/java/com/puzzle/auth/{page => graph}/registration/AuthRegistrationScreen.kt (88%) create mode 100644 feature/auth/src/main/java/com/puzzle/auth/graph/registration/AuthRegistrationViewModel.kt create mode 100644 feature/auth/src/main/java/com/puzzle/auth/graph/registration/contract/AuthRegistrationIntent.kt create mode 100644 feature/auth/src/main/java/com/puzzle/auth/graph/registration/contract/AuthRegistrationSideEffect.kt rename feature/auth/src/main/java/com/puzzle/auth/{page => graph}/registration/contract/AuthRegistrationState.kt (53%) create mode 100644 feature/auth/src/main/java/com/puzzle/auth/graph/verification/AuthVerficationViewModel.kt rename feature/auth/src/main/java/com/puzzle/auth/{page => graph}/verification/AuthVerificationScreen.kt (88%) rename feature/auth/src/main/java/com/puzzle/auth/{page => graph}/verification/contract/AuthVerficationState.kt (53%) create mode 100644 feature/auth/src/main/java/com/puzzle/auth/graph/verification/contract/AuthVerificationIntent.kt create mode 100644 feature/auth/src/main/java/com/puzzle/auth/graph/verification/contract/AuthVerificationSideEffect.kt delete mode 100644 feature/auth/src/main/java/com/puzzle/auth/page/main/AuthViewModel.kt delete mode 100644 feature/auth/src/main/java/com/puzzle/auth/page/main/contract/AuthIntent.kt delete mode 100644 feature/auth/src/main/java/com/puzzle/auth/page/main/contract/AuthSideEffect.kt delete mode 100644 feature/auth/src/main/java/com/puzzle/auth/page/registration/AuthRegistrationViewModel.kt delete mode 100644 feature/auth/src/main/java/com/puzzle/auth/page/registration/contract/AuthRegistrationIntent.kt delete mode 100644 feature/auth/src/main/java/com/puzzle/auth/page/registration/contract/AuthRegistrationSideEffect.kt delete mode 100644 feature/auth/src/main/java/com/puzzle/auth/page/verification/AuthVerficationViewModel.kt delete mode 100644 feature/auth/src/main/java/com/puzzle/auth/page/verification/contract/AuthVerificationIntent.kt delete mode 100644 feature/auth/src/main/java/com/puzzle/auth/page/verification/contract/AuthVerificationSideEffect.kt rename feature/matching/src/main/java/com/puzzle/matching/{page => graph}/detail/MatchingDetailRoute.kt (98%) rename feature/matching/src/main/java/com/puzzle/matching/{page => graph}/detail/MatchingDetailViewModel.kt (91%) rename feature/matching/src/main/java/com/puzzle/matching/{page => graph}/detail/contract/MatchingDetailIntent.kt (84%) create mode 100644 feature/matching/src/main/java/com/puzzle/matching/graph/detail/contract/MatchingDetailSideEffect.kt rename feature/matching/src/main/java/com/puzzle/matching/{page => graph}/detail/contract/MatchingDetailState.kt (96%) rename feature/matching/src/main/java/com/puzzle/matching/{page => graph}/main/MatchingScreen.kt (98%) rename feature/matching/src/main/java/com/puzzle/matching/{page => graph}/main/MatchingViewModel.kt (90%) rename feature/matching/src/main/java/com/puzzle/matching/{page => graph}/main/contract/MatchingIntent.kt (65%) create mode 100644 feature/matching/src/main/java/com/puzzle/matching/graph/main/contract/MatchingSideEffect.kt rename feature/matching/src/main/java/com/puzzle/matching/{page => graph}/main/contract/MatchingState.kt (71%) delete mode 100644 feature/matching/src/main/java/com/puzzle/matching/page/detail/contract/MatchingDetailSideEffect.kt delete mode 100644 feature/matching/src/main/java/com/puzzle/matching/page/main/contract/MatchingSideEffect.kt diff --git a/app/src/main/java/com/puzzle/piece/ViewModelsModule.kt b/app/src/main/java/com/puzzle/piece/ViewModelsModule.kt index 7af46ec2..a65fb1d8 100644 --- a/app/src/main/java/com/puzzle/piece/ViewModelsModule.kt +++ b/app/src/main/java/com/puzzle/piece/ViewModelsModule.kt @@ -3,8 +3,8 @@ package com.puzzle.piece import com.airbnb.mvrx.hilt.AssistedViewModelFactory import com.airbnb.mvrx.hilt.MavericksViewModelComponent import com.airbnb.mvrx.hilt.ViewModelKey -import com.puzzle.matching.page.main.MatchingViewModel -import com.puzzle.matching.page.detail.MatchingDetailViewModel +import com.puzzle.matching.graph.detail.MatchingDetailViewModel +import com.puzzle.matching.graph.main.MatchingViewModel import dagger.Binds import dagger.Module import dagger.hilt.InstallIn diff --git a/feature/auth/src/main/java/com/puzzle/auth/page/main/AuthScreen.kt b/feature/auth/src/main/java/com/puzzle/auth/graph/main/AuthScreen.kt similarity index 91% rename from feature/auth/src/main/java/com/puzzle/auth/page/main/AuthScreen.kt rename to feature/auth/src/main/java/com/puzzle/auth/graph/main/AuthScreen.kt index 127aaa36..7592ed6d 100644 --- a/feature/auth/src/main/java/com/puzzle/auth/page/main/AuthScreen.kt +++ b/feature/auth/src/main/java/com/puzzle/auth/graph/main/AuthScreen.kt @@ -1,9 +1,8 @@ -package com.puzzle.auth.page.main +package com.puzzle.auth.graph.main import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.ui.platform.LocalContext -import androidx.compose.ui.tooling.preview.Preview import com.airbnb.mvrx.compose.collectAsState import com.airbnb.mvrx.compose.mavericksViewModel @@ -54,8 +53,8 @@ fun AuthScreen() { // } } -@Preview -@Composable -fun PreviewAuthScreen() { - -} \ No newline at end of file +//@Preview +//@Composable +//fun PreviewAuthScreen() { +// +//} \ No newline at end of file diff --git a/feature/auth/src/main/java/com/puzzle/auth/graph/main/AuthViewModel.kt b/feature/auth/src/main/java/com/puzzle/auth/graph/main/AuthViewModel.kt new file mode 100644 index 00000000..3e2b66da --- /dev/null +++ b/feature/auth/src/main/java/com/puzzle/auth/graph/main/AuthViewModel.kt @@ -0,0 +1,25 @@ +package com.puzzle.auth.graph.main + +import com.airbnb.mvrx.MavericksViewModel +import com.airbnb.mvrx.MavericksViewModelFactory +import com.airbnb.mvrx.hilt.AssistedViewModelFactory +import com.airbnb.mvrx.hilt.hiltMavericksViewModelFactory +import com.puzzle.auth.graph.main.contract.AuthState +import com.puzzle.navigation.NavigationHelper +import dagger.assisted.Assisted +import dagger.assisted.AssistedFactory +import dagger.assisted.AssistedInject + +class AuthViewModel @AssistedInject constructor( + @Assisted initialState: AuthState, + private val navigationHelper: NavigationHelper, +) : MavericksViewModel(initialState) { + + @AssistedFactory + interface Factory : AssistedViewModelFactory { + override fun create(state: AuthState): AuthViewModel + } + + companion object : + MavericksViewModelFactory by hiltMavericksViewModelFactory() +} \ No newline at end of file diff --git a/feature/auth/src/main/java/com/puzzle/auth/graph/main/contract/AuthIntent.kt b/feature/auth/src/main/java/com/puzzle/auth/graph/main/contract/AuthIntent.kt new file mode 100644 index 00000000..db5398f6 --- /dev/null +++ b/feature/auth/src/main/java/com/puzzle/auth/graph/main/contract/AuthIntent.kt @@ -0,0 +1,3 @@ +package com.puzzle.auth.graph.main.contract + +class AuthIntent \ No newline at end of file diff --git a/feature/auth/src/main/java/com/puzzle/auth/graph/main/contract/AuthSideEffect.kt b/feature/auth/src/main/java/com/puzzle/auth/graph/main/contract/AuthSideEffect.kt new file mode 100644 index 00000000..fcda07a5 --- /dev/null +++ b/feature/auth/src/main/java/com/puzzle/auth/graph/main/contract/AuthSideEffect.kt @@ -0,0 +1,3 @@ +package com.puzzle.auth.graph.main.contract + +class AuthSideEffect \ No newline at end of file diff --git a/feature/auth/src/main/java/com/puzzle/auth/page/main/contract/AuthState.kt b/feature/auth/src/main/java/com/puzzle/auth/graph/main/contract/AuthState.kt similarity index 52% rename from feature/auth/src/main/java/com/puzzle/auth/page/main/contract/AuthState.kt rename to feature/auth/src/main/java/com/puzzle/auth/graph/main/contract/AuthState.kt index 0cb7068e..a6598ab7 100644 --- a/feature/auth/src/main/java/com/puzzle/auth/page/main/contract/AuthState.kt +++ b/feature/auth/src/main/java/com/puzzle/auth/graph/main/contract/AuthState.kt @@ -1,7 +1,7 @@ -package com.puzzle.auth.page.main.contract +package com.puzzle.auth.graph.main.contract import com.airbnb.mvrx.MavericksState data class AuthState( - val a: Boolean, + val a: Boolean = false, ) : MavericksState \ No newline at end of file diff --git a/feature/auth/src/main/java/com/puzzle/auth/page/registration/AuthRegistrationScreen.kt b/feature/auth/src/main/java/com/puzzle/auth/graph/registration/AuthRegistrationScreen.kt similarity index 88% rename from feature/auth/src/main/java/com/puzzle/auth/page/registration/AuthRegistrationScreen.kt rename to feature/auth/src/main/java/com/puzzle/auth/graph/registration/AuthRegistrationScreen.kt index 4088d0b8..b396ff44 100644 --- a/feature/auth/src/main/java/com/puzzle/auth/page/registration/AuthRegistrationScreen.kt +++ b/feature/auth/src/main/java/com/puzzle/auth/graph/registration/AuthRegistrationScreen.kt @@ -1,4 +1,4 @@ -package com.puzzle.auth.page.registration +package com.puzzle.auth.graph.registration import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue diff --git a/feature/auth/src/main/java/com/puzzle/auth/graph/registration/AuthRegistrationViewModel.kt b/feature/auth/src/main/java/com/puzzle/auth/graph/registration/AuthRegistrationViewModel.kt new file mode 100644 index 00000000..d150668e --- /dev/null +++ b/feature/auth/src/main/java/com/puzzle/auth/graph/registration/AuthRegistrationViewModel.kt @@ -0,0 +1,25 @@ +package com.puzzle.auth.graph.registration + +import com.airbnb.mvrx.MavericksViewModel +import com.airbnb.mvrx.MavericksViewModelFactory +import com.airbnb.mvrx.hilt.AssistedViewModelFactory +import com.airbnb.mvrx.hilt.hiltMavericksViewModelFactory +import com.puzzle.auth.graph.registration.contract.AuthRegistrationState +import com.puzzle.navigation.NavigationHelper +import dagger.assisted.Assisted +import dagger.assisted.AssistedFactory +import dagger.assisted.AssistedInject + +class AuthRegistrationViewModel @AssistedInject constructor( + @Assisted initialState: AuthRegistrationState, + private val navigationHelper: NavigationHelper, +) : MavericksViewModel(initialState) { + + @AssistedFactory + interface Factory : AssistedViewModelFactory { + override fun create(state: AuthRegistrationState): AuthRegistrationViewModel + } + + companion object : + MavericksViewModelFactory by hiltMavericksViewModelFactory() +} \ No newline at end of file diff --git a/feature/auth/src/main/java/com/puzzle/auth/graph/registration/contract/AuthRegistrationIntent.kt b/feature/auth/src/main/java/com/puzzle/auth/graph/registration/contract/AuthRegistrationIntent.kt new file mode 100644 index 00000000..f7124b5a --- /dev/null +++ b/feature/auth/src/main/java/com/puzzle/auth/graph/registration/contract/AuthRegistrationIntent.kt @@ -0,0 +1,3 @@ +package com.puzzle.auth.graph.registration.contract + +sealed class AuthRegistrationIntent \ No newline at end of file diff --git a/feature/auth/src/main/java/com/puzzle/auth/graph/registration/contract/AuthRegistrationSideEffect.kt b/feature/auth/src/main/java/com/puzzle/auth/graph/registration/contract/AuthRegistrationSideEffect.kt new file mode 100644 index 00000000..dfdecf65 --- /dev/null +++ b/feature/auth/src/main/java/com/puzzle/auth/graph/registration/contract/AuthRegistrationSideEffect.kt @@ -0,0 +1,3 @@ +package com.puzzle.auth.graph.registration.contract + +sealed class AuthRegistrationSideEffect \ No newline at end of file diff --git a/feature/auth/src/main/java/com/puzzle/auth/page/registration/contract/AuthRegistrationState.kt b/feature/auth/src/main/java/com/puzzle/auth/graph/registration/contract/AuthRegistrationState.kt similarity index 53% rename from feature/auth/src/main/java/com/puzzle/auth/page/registration/contract/AuthRegistrationState.kt rename to feature/auth/src/main/java/com/puzzle/auth/graph/registration/contract/AuthRegistrationState.kt index 4c1ddea3..5226f254 100644 --- a/feature/auth/src/main/java/com/puzzle/auth/page/registration/contract/AuthRegistrationState.kt +++ b/feature/auth/src/main/java/com/puzzle/auth/graph/registration/contract/AuthRegistrationState.kt @@ -1,7 +1,7 @@ -package com.puzzle.auth.page.registration.contract +package com.puzzle.auth.graph.registration.contract import com.airbnb.mvrx.MavericksState data class AuthRegistrationState( - val a: Boolean, + val a: Boolean = false, ) : MavericksState \ No newline at end of file diff --git a/feature/auth/src/main/java/com/puzzle/auth/graph/verification/AuthVerficationViewModel.kt b/feature/auth/src/main/java/com/puzzle/auth/graph/verification/AuthVerficationViewModel.kt new file mode 100644 index 00000000..96058ff9 --- /dev/null +++ b/feature/auth/src/main/java/com/puzzle/auth/graph/verification/AuthVerficationViewModel.kt @@ -0,0 +1,24 @@ +package com.puzzle.auth.graph.verification + +import com.airbnb.mvrx.MavericksViewModel +import com.airbnb.mvrx.MavericksViewModelFactory +import com.airbnb.mvrx.hilt.AssistedViewModelFactory +import com.airbnb.mvrx.hilt.hiltMavericksViewModelFactory +import com.puzzle.auth.graph.verification.contract.AuthVerficationState +import com.puzzle.navigation.NavigationHelper +import dagger.assisted.Assisted +import dagger.assisted.AssistedFactory +import dagger.assisted.AssistedInject + +class AuthVerficationViewModel @AssistedInject constructor( + @Assisted initialState: AuthVerficationState, + private val navigationHelper: NavigationHelper, +) : MavericksViewModel(initialState) { + @AssistedFactory + interface Factory : AssistedViewModelFactory { + override fun create(state: AuthVerficationState): AuthVerficationViewModel + } + + companion object : + MavericksViewModelFactory by hiltMavericksViewModelFactory() +} diff --git a/feature/auth/src/main/java/com/puzzle/auth/page/verification/AuthVerificationScreen.kt b/feature/auth/src/main/java/com/puzzle/auth/graph/verification/AuthVerificationScreen.kt similarity index 88% rename from feature/auth/src/main/java/com/puzzle/auth/page/verification/AuthVerificationScreen.kt rename to feature/auth/src/main/java/com/puzzle/auth/graph/verification/AuthVerificationScreen.kt index 4697ea37..43c4c27f 100644 --- a/feature/auth/src/main/java/com/puzzle/auth/page/verification/AuthVerificationScreen.kt +++ b/feature/auth/src/main/java/com/puzzle/auth/graph/verification/AuthVerificationScreen.kt @@ -1,4 +1,4 @@ -package com.puzzle.auth.page.verification +package com.puzzle.auth.graph.verification import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue diff --git a/feature/auth/src/main/java/com/puzzle/auth/page/verification/contract/AuthVerficationState.kt b/feature/auth/src/main/java/com/puzzle/auth/graph/verification/contract/AuthVerficationState.kt similarity index 53% rename from feature/auth/src/main/java/com/puzzle/auth/page/verification/contract/AuthVerficationState.kt rename to feature/auth/src/main/java/com/puzzle/auth/graph/verification/contract/AuthVerficationState.kt index d0ebeae2..9bc78c0e 100644 --- a/feature/auth/src/main/java/com/puzzle/auth/page/verification/contract/AuthVerficationState.kt +++ b/feature/auth/src/main/java/com/puzzle/auth/graph/verification/contract/AuthVerficationState.kt @@ -1,7 +1,7 @@ -package com.puzzle.auth.page.verification.contract +package com.puzzle.auth.graph.verification.contract import com.airbnb.mvrx.MavericksState data class AuthVerficationState( - val a: Boolean, + val a: Boolean = false, ) : MavericksState \ No newline at end of file diff --git a/feature/auth/src/main/java/com/puzzle/auth/graph/verification/contract/AuthVerificationIntent.kt b/feature/auth/src/main/java/com/puzzle/auth/graph/verification/contract/AuthVerificationIntent.kt new file mode 100644 index 00000000..30110cbc --- /dev/null +++ b/feature/auth/src/main/java/com/puzzle/auth/graph/verification/contract/AuthVerificationIntent.kt @@ -0,0 +1,3 @@ +package com.puzzle.auth.graph.verification.contract + +sealed class AuthVerificationIntent \ No newline at end of file diff --git a/feature/auth/src/main/java/com/puzzle/auth/graph/verification/contract/AuthVerificationSideEffect.kt b/feature/auth/src/main/java/com/puzzle/auth/graph/verification/contract/AuthVerificationSideEffect.kt new file mode 100644 index 00000000..6d0de496 --- /dev/null +++ b/feature/auth/src/main/java/com/puzzle/auth/graph/verification/contract/AuthVerificationSideEffect.kt @@ -0,0 +1,3 @@ +package com.puzzle.auth.graph.verification.contract + +sealed class AuthVerificationSideEffect \ No newline at end of file diff --git a/feature/auth/src/main/java/com/puzzle/auth/navigation/AuthNavigation.kt b/feature/auth/src/main/java/com/puzzle/auth/navigation/AuthNavigation.kt index bbe935e4..f915be46 100644 --- a/feature/auth/src/main/java/com/puzzle/auth/navigation/AuthNavigation.kt +++ b/feature/auth/src/main/java/com/puzzle/auth/navigation/AuthNavigation.kt @@ -3,7 +3,7 @@ package com.puzzle.auth.navigation import androidx.navigation.NavGraphBuilder import androidx.navigation.compose.composable import androidx.navigation.navigation -import com.puzzle.auth.page.main.AuthRoute +import com.puzzle.auth.graph.main.AuthRoute import com.puzzle.navigation.AuthGraph import com.puzzle.navigation.AuthGraphDest diff --git a/feature/auth/src/main/java/com/puzzle/auth/page/main/AuthViewModel.kt b/feature/auth/src/main/java/com/puzzle/auth/page/main/AuthViewModel.kt deleted file mode 100644 index 54da4d45..00000000 --- a/feature/auth/src/main/java/com/puzzle/auth/page/main/AuthViewModel.kt +++ /dev/null @@ -1,13 +0,0 @@ -package com.puzzle.auth.page.main - -import com.airbnb.mvrx.MavericksViewModel -import com.puzzle.auth.page.main.contract.AuthState -import com.puzzle.navigation.NavigationHelper -import dagger.assisted.Assisted -import dagger.assisted.AssistedInject - -class AuthViewModel @AssistedInject constructor( - @Assisted initialState: AuthState, - private val navigationHelper: NavigationHelper, -) : MavericksViewModel(initialState) { -} \ No newline at end of file diff --git a/feature/auth/src/main/java/com/puzzle/auth/page/main/contract/AuthIntent.kt b/feature/auth/src/main/java/com/puzzle/auth/page/main/contract/AuthIntent.kt deleted file mode 100644 index 2320c4b1..00000000 --- a/feature/auth/src/main/java/com/puzzle/auth/page/main/contract/AuthIntent.kt +++ /dev/null @@ -1,4 +0,0 @@ -package com.puzzle.auth.page.main.contract - -class AuthIntent { -} \ No newline at end of file diff --git a/feature/auth/src/main/java/com/puzzle/auth/page/main/contract/AuthSideEffect.kt b/feature/auth/src/main/java/com/puzzle/auth/page/main/contract/AuthSideEffect.kt deleted file mode 100644 index b5676f6b..00000000 --- a/feature/auth/src/main/java/com/puzzle/auth/page/main/contract/AuthSideEffect.kt +++ /dev/null @@ -1,4 +0,0 @@ -package com.puzzle.auth.page.main.contract - -class AuthSideEffect { -} \ No newline at end of file diff --git a/feature/auth/src/main/java/com/puzzle/auth/page/registration/AuthRegistrationViewModel.kt b/feature/auth/src/main/java/com/puzzle/auth/page/registration/AuthRegistrationViewModel.kt deleted file mode 100644 index bf1c512b..00000000 --- a/feature/auth/src/main/java/com/puzzle/auth/page/registration/AuthRegistrationViewModel.kt +++ /dev/null @@ -1,13 +0,0 @@ -package com.puzzle.auth.page.registration - -import com.airbnb.mvrx.MavericksViewModel -import com.puzzle.auth.page.registration.contract.AuthRegistrationState -import com.puzzle.navigation.NavigationHelper -import dagger.assisted.Assisted -import dagger.assisted.AssistedInject - -class AuthRegistrationViewModel @AssistedInject constructor( - @Assisted initialState: AuthRegistrationState, - private val navigationHelper: NavigationHelper, -) : MavericksViewModel(initialState) { -} \ No newline at end of file diff --git a/feature/auth/src/main/java/com/puzzle/auth/page/registration/contract/AuthRegistrationIntent.kt b/feature/auth/src/main/java/com/puzzle/auth/page/registration/contract/AuthRegistrationIntent.kt deleted file mode 100644 index 284aa115..00000000 --- a/feature/auth/src/main/java/com/puzzle/auth/page/registration/contract/AuthRegistrationIntent.kt +++ /dev/null @@ -1,4 +0,0 @@ -package com.puzzle.auth.page.registration.contract - -sealed class AuthRegistrationIntent { -} \ No newline at end of file diff --git a/feature/auth/src/main/java/com/puzzle/auth/page/registration/contract/AuthRegistrationSideEffect.kt b/feature/auth/src/main/java/com/puzzle/auth/page/registration/contract/AuthRegistrationSideEffect.kt deleted file mode 100644 index 0c846afe..00000000 --- a/feature/auth/src/main/java/com/puzzle/auth/page/registration/contract/AuthRegistrationSideEffect.kt +++ /dev/null @@ -1,4 +0,0 @@ -package com.puzzle.auth.page.registration.contract - -sealed class AuthRegistrationSideEffect { -} \ No newline at end of file diff --git a/feature/auth/src/main/java/com/puzzle/auth/page/verification/AuthVerficationViewModel.kt b/feature/auth/src/main/java/com/puzzle/auth/page/verification/AuthVerficationViewModel.kt deleted file mode 100644 index a087544c..00000000 --- a/feature/auth/src/main/java/com/puzzle/auth/page/verification/AuthVerficationViewModel.kt +++ /dev/null @@ -1,13 +0,0 @@ -package com.puzzle.auth.page.verification - -import com.airbnb.mvrx.MavericksViewModel -import com.puzzle.auth.page.verification.contract.AuthVerficationState -import com.puzzle.navigation.NavigationHelper -import dagger.assisted.Assisted -import dagger.assisted.AssistedInject - -class AuthVerficationViewModel @AssistedInject constructor( - @Assisted initialState: AuthVerficationState, - private val navigationHelper: NavigationHelper, -) : MavericksViewModel(initialState) { -} diff --git a/feature/auth/src/main/java/com/puzzle/auth/page/verification/contract/AuthVerificationIntent.kt b/feature/auth/src/main/java/com/puzzle/auth/page/verification/contract/AuthVerificationIntent.kt deleted file mode 100644 index 940ed9fc..00000000 --- a/feature/auth/src/main/java/com/puzzle/auth/page/verification/contract/AuthVerificationIntent.kt +++ /dev/null @@ -1,4 +0,0 @@ -package com.puzzle.auth.page.verification.contract - -sealed class AuthVerificationIntent { -} \ No newline at end of file diff --git a/feature/auth/src/main/java/com/puzzle/auth/page/verification/contract/AuthVerificationSideEffect.kt b/feature/auth/src/main/java/com/puzzle/auth/page/verification/contract/AuthVerificationSideEffect.kt deleted file mode 100644 index bc2a8817..00000000 --- a/feature/auth/src/main/java/com/puzzle/auth/page/verification/contract/AuthVerificationSideEffect.kt +++ /dev/null @@ -1,4 +0,0 @@ -package com.puzzle.auth.page.verification.contract - -sealed class AuthVerificationSideEffect { -} \ No newline at end of file diff --git a/feature/matching/src/main/java/com/puzzle/matching/page/detail/MatchingDetailRoute.kt b/feature/matching/src/main/java/com/puzzle/matching/graph/detail/MatchingDetailRoute.kt similarity index 98% rename from feature/matching/src/main/java/com/puzzle/matching/page/detail/MatchingDetailRoute.kt rename to feature/matching/src/main/java/com/puzzle/matching/graph/detail/MatchingDetailRoute.kt index 1dc4f5a5..ff849695 100644 --- a/feature/matching/src/main/java/com/puzzle/matching/page/detail/MatchingDetailRoute.kt +++ b/feature/matching/src/main/java/com/puzzle/matching/graph/detail/MatchingDetailRoute.kt @@ -1,4 +1,4 @@ -package com.puzzle.matching.page.detail +package com.puzzle.matching.graph.detail import androidx.compose.foundation.Image import androidx.compose.foundation.background @@ -41,9 +41,9 @@ import com.puzzle.matching.common.constant.DialogType import com.puzzle.matching.common.ui.BasicInfoBody import com.puzzle.matching.common.ui.ValuePickBody import com.puzzle.matching.common.ui.ValueTalkBody -import com.puzzle.matching.page.detail.contract.MatchingDetailIntent -import com.puzzle.matching.page.detail.contract.MatchingDetailState -import com.puzzle.matching.page.detail.contract.MatchingDetailState.MatchingDetailPage +import com.puzzle.matching.graph.detail.contract.MatchingDetailIntent +import com.puzzle.matching.graph.detail.contract.MatchingDetailState +import com.puzzle.matching.graph.detail.contract.MatchingDetailState.MatchingDetailPage import com.skydoves.cloudy.cloudy @Composable diff --git a/feature/matching/src/main/java/com/puzzle/matching/page/detail/MatchingDetailViewModel.kt b/feature/matching/src/main/java/com/puzzle/matching/graph/detail/MatchingDetailViewModel.kt similarity index 91% rename from feature/matching/src/main/java/com/puzzle/matching/page/detail/MatchingDetailViewModel.kt rename to feature/matching/src/main/java/com/puzzle/matching/graph/detail/MatchingDetailViewModel.kt index 1360c859..bd944543 100644 --- a/feature/matching/src/main/java/com/puzzle/matching/page/detail/MatchingDetailViewModel.kt +++ b/feature/matching/src/main/java/com/puzzle/matching/graph/detail/MatchingDetailViewModel.kt @@ -1,12 +1,12 @@ -package com.puzzle.matching.page.detail +package com.puzzle.matching.graph.detail import com.airbnb.mvrx.MavericksViewModel import com.airbnb.mvrx.MavericksViewModelFactory import com.airbnb.mvrx.hilt.AssistedViewModelFactory import com.airbnb.mvrx.hilt.hiltMavericksViewModelFactory -import com.puzzle.matching.page.detail.contract.MatchingDetailIntent -import com.puzzle.matching.page.detail.contract.MatchingDetailSideEffect -import com.puzzle.matching.page.detail.contract.MatchingDetailState +import com.puzzle.matching.graph.detail.contract.MatchingDetailIntent +import com.puzzle.matching.graph.detail.contract.MatchingDetailSideEffect +import com.puzzle.matching.graph.detail.contract.MatchingDetailState import com.puzzle.navigation.NavigationEvent import com.puzzle.navigation.NavigationHelper import dagger.assisted.Assisted diff --git a/feature/matching/src/main/java/com/puzzle/matching/page/detail/contract/MatchingDetailIntent.kt b/feature/matching/src/main/java/com/puzzle/matching/graph/detail/contract/MatchingDetailIntent.kt similarity index 84% rename from feature/matching/src/main/java/com/puzzle/matching/page/detail/contract/MatchingDetailIntent.kt rename to feature/matching/src/main/java/com/puzzle/matching/graph/detail/contract/MatchingDetailIntent.kt index 89b80b88..ffd0ead4 100644 --- a/feature/matching/src/main/java/com/puzzle/matching/page/detail/contract/MatchingDetailIntent.kt +++ b/feature/matching/src/main/java/com/puzzle/matching/graph/detail/contract/MatchingDetailIntent.kt @@ -1,4 +1,4 @@ -package com.puzzle.matching.page.detail.contract +package com.puzzle.matching.graph.detail.contract sealed class MatchingDetailIntent { data object OnMatchingDetailCloseClick : MatchingDetailIntent() diff --git a/feature/matching/src/main/java/com/puzzle/matching/graph/detail/contract/MatchingDetailSideEffect.kt b/feature/matching/src/main/java/com/puzzle/matching/graph/detail/contract/MatchingDetailSideEffect.kt new file mode 100644 index 00000000..6999abea --- /dev/null +++ b/feature/matching/src/main/java/com/puzzle/matching/graph/detail/contract/MatchingDetailSideEffect.kt @@ -0,0 +1,3 @@ +package com.puzzle.matching.graph.detail.contract + +sealed class MatchingDetailSideEffect \ No newline at end of file diff --git a/feature/matching/src/main/java/com/puzzle/matching/page/detail/contract/MatchingDetailState.kt b/feature/matching/src/main/java/com/puzzle/matching/graph/detail/contract/MatchingDetailState.kt similarity index 96% rename from feature/matching/src/main/java/com/puzzle/matching/page/detail/contract/MatchingDetailState.kt rename to feature/matching/src/main/java/com/puzzle/matching/graph/detail/contract/MatchingDetailState.kt index c8553c63..b8023ee8 100644 --- a/feature/matching/src/main/java/com/puzzle/matching/page/detail/contract/MatchingDetailState.kt +++ b/feature/matching/src/main/java/com/puzzle/matching/graph/detail/contract/MatchingDetailState.kt @@ -1,4 +1,4 @@ -package com.puzzle.matching.page.detail.contract +package com.puzzle.matching.graph.detail.contract import com.airbnb.mvrx.MavericksState import com.puzzle.domain.model.matching.ValuePick diff --git a/feature/matching/src/main/java/com/puzzle/matching/page/main/MatchingScreen.kt b/feature/matching/src/main/java/com/puzzle/matching/graph/main/MatchingScreen.kt similarity index 98% rename from feature/matching/src/main/java/com/puzzle/matching/page/main/MatchingScreen.kt rename to feature/matching/src/main/java/com/puzzle/matching/graph/main/MatchingScreen.kt index aa217539..169db0c7 100644 --- a/feature/matching/src/main/java/com/puzzle/matching/page/main/MatchingScreen.kt +++ b/feature/matching/src/main/java/com/puzzle/matching/graph/main/MatchingScreen.kt @@ -1,4 +1,4 @@ -package com.puzzle.matching.page.main +package com.puzzle.matching.graph.main import androidx.compose.foundation.Image import androidx.compose.foundation.background @@ -40,8 +40,8 @@ import com.puzzle.designsystem.R import com.puzzle.designsystem.component.PieceMainTopBar import com.puzzle.designsystem.component.PieceSolidButton import com.puzzle.designsystem.foundation.PieceTheme -import com.puzzle.matching.page.main.contract.MatchingIntent -import com.puzzle.matching.page.main.contract.MatchingState +import com.puzzle.matching.graph.main.contract.MatchingIntent +import com.puzzle.matching.graph.main.contract.MatchingState @Composable internal fun MatchingRoute( diff --git a/feature/matching/src/main/java/com/puzzle/matching/page/main/MatchingViewModel.kt b/feature/matching/src/main/java/com/puzzle/matching/graph/main/MatchingViewModel.kt similarity index 90% rename from feature/matching/src/main/java/com/puzzle/matching/page/main/MatchingViewModel.kt rename to feature/matching/src/main/java/com/puzzle/matching/graph/main/MatchingViewModel.kt index 3cb43e8e..c24ec096 100644 --- a/feature/matching/src/main/java/com/puzzle/matching/page/main/MatchingViewModel.kt +++ b/feature/matching/src/main/java/com/puzzle/matching/graph/main/MatchingViewModel.kt @@ -1,12 +1,12 @@ -package com.puzzle.matching.page.main +package com.puzzle.matching.graph.main import com.airbnb.mvrx.MavericksViewModel import com.airbnb.mvrx.MavericksViewModelFactory import com.airbnb.mvrx.hilt.AssistedViewModelFactory import com.airbnb.mvrx.hilt.hiltMavericksViewModelFactory -import com.puzzle.matching.page.main.contract.MatchingIntent -import com.puzzle.matching.page.main.contract.MatchingSideEffect -import com.puzzle.matching.page.main.contract.MatchingState +import com.puzzle.matching.graph.main.contract.MatchingIntent +import com.puzzle.matching.graph.main.contract.MatchingSideEffect +import com.puzzle.matching.graph.main.contract.MatchingState import com.puzzle.navigation.MatchingGraphDest import com.puzzle.navigation.NavigationEvent.NavigateTo import com.puzzle.navigation.NavigationHelper diff --git a/feature/matching/src/main/java/com/puzzle/matching/page/main/contract/MatchingIntent.kt b/feature/matching/src/main/java/com/puzzle/matching/graph/main/contract/MatchingIntent.kt similarity index 65% rename from feature/matching/src/main/java/com/puzzle/matching/page/main/contract/MatchingIntent.kt rename to feature/matching/src/main/java/com/puzzle/matching/graph/main/contract/MatchingIntent.kt index 690badd1..b2fd2b34 100644 --- a/feature/matching/src/main/java/com/puzzle/matching/page/main/contract/MatchingIntent.kt +++ b/feature/matching/src/main/java/com/puzzle/matching/graph/main/contract/MatchingIntent.kt @@ -1,4 +1,4 @@ -package com.puzzle.matching.page.main.contract +package com.puzzle.matching.graph.main.contract sealed class MatchingIntent { data object NavigateToMatchingDetail : MatchingIntent() diff --git a/feature/matching/src/main/java/com/puzzle/matching/graph/main/contract/MatchingSideEffect.kt b/feature/matching/src/main/java/com/puzzle/matching/graph/main/contract/MatchingSideEffect.kt new file mode 100644 index 00000000..7904a70a --- /dev/null +++ b/feature/matching/src/main/java/com/puzzle/matching/graph/main/contract/MatchingSideEffect.kt @@ -0,0 +1,3 @@ +package com.puzzle.matching.graph.main.contract + +sealed class MatchingSideEffect \ No newline at end of file diff --git a/feature/matching/src/main/java/com/puzzle/matching/page/main/contract/MatchingState.kt b/feature/matching/src/main/java/com/puzzle/matching/graph/main/contract/MatchingState.kt similarity index 71% rename from feature/matching/src/main/java/com/puzzle/matching/page/main/contract/MatchingState.kt rename to feature/matching/src/main/java/com/puzzle/matching/graph/main/contract/MatchingState.kt index 052fb269..37aa5db7 100644 --- a/feature/matching/src/main/java/com/puzzle/matching/page/main/contract/MatchingState.kt +++ b/feature/matching/src/main/java/com/puzzle/matching/graph/main/contract/MatchingState.kt @@ -1,4 +1,4 @@ -package com.puzzle.matching.page.main.contract +package com.puzzle.matching.graph.main.contract import com.airbnb.mvrx.MavericksState diff --git a/feature/matching/src/main/java/com/puzzle/matching/navigation/MatchingNavigation.kt b/feature/matching/src/main/java/com/puzzle/matching/navigation/MatchingNavigation.kt index 98e0cd1e..e5876444 100644 --- a/feature/matching/src/main/java/com/puzzle/matching/navigation/MatchingNavigation.kt +++ b/feature/matching/src/main/java/com/puzzle/matching/navigation/MatchingNavigation.kt @@ -3,8 +3,8 @@ package com.puzzle.matching.navigation import androidx.navigation.NavGraphBuilder import androidx.navigation.compose.composable import androidx.navigation.navigation -import com.puzzle.matching.page.detail.MatchingDetailRoute -import com.puzzle.matching.page.main.MatchingRoute +import com.puzzle.matching.graph.detail.MatchingDetailRoute +import com.puzzle.matching.graph.main.MatchingRoute import com.puzzle.navigation.MatchingGraph import com.puzzle.navigation.MatchingGraphDest diff --git a/feature/matching/src/main/java/com/puzzle/matching/page/detail/contract/MatchingDetailSideEffect.kt b/feature/matching/src/main/java/com/puzzle/matching/page/detail/contract/MatchingDetailSideEffect.kt deleted file mode 100644 index 5d2ef2ea..00000000 --- a/feature/matching/src/main/java/com/puzzle/matching/page/detail/contract/MatchingDetailSideEffect.kt +++ /dev/null @@ -1,3 +0,0 @@ -package com.puzzle.matching.page.detail.contract - -sealed class MatchingDetailSideEffect \ No newline at end of file diff --git a/feature/matching/src/main/java/com/puzzle/matching/page/main/contract/MatchingSideEffect.kt b/feature/matching/src/main/java/com/puzzle/matching/page/main/contract/MatchingSideEffect.kt deleted file mode 100644 index 42353313..00000000 --- a/feature/matching/src/main/java/com/puzzle/matching/page/main/contract/MatchingSideEffect.kt +++ /dev/null @@ -1,3 +0,0 @@ -package com.puzzle.matching.page.main.contract - -sealed class MatchingSideEffect \ No newline at end of file From e6435f6be4dfc498d6ed3eaf1a43847f4c68a21e Mon Sep 17 00:00:00 2001 From: sksowk156 Date: Sat, 4 Jan 2025 16:02:29 +0900 Subject: [PATCH 3/3] =?UTF-8?q?[PC-253]=20maverick=20viewmodel=20di=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../verification/AuthVerificationScreen.kt | 2 +- ...ewModel.kt => AuthVerificationViewModel.kt} | 8 ++++---- .../puzzle/presentation/di/ViewModelsModule.kt | 18 ++++++++++++++++++ 3 files changed, 23 insertions(+), 5 deletions(-) rename feature/auth/src/main/java/com/puzzle/auth/graph/verification/{AuthVerficationViewModel.kt => AuthVerificationViewModel.kt} (71%) diff --git a/feature/auth/src/main/java/com/puzzle/auth/graph/verification/AuthVerificationScreen.kt b/feature/auth/src/main/java/com/puzzle/auth/graph/verification/AuthVerificationScreen.kt index 43c4c27f..74c7acb0 100644 --- a/feature/auth/src/main/java/com/puzzle/auth/graph/verification/AuthVerificationScreen.kt +++ b/feature/auth/src/main/java/com/puzzle/auth/graph/verification/AuthVerificationScreen.kt @@ -7,7 +7,7 @@ import com.airbnb.mvrx.compose.mavericksViewModel @Composable internal fun AuthVerificationRoute( - viewModel: AuthVerficationViewModel = mavericksViewModel() + viewModel: AuthVerificationViewModel = mavericksViewModel() ) { val state by viewModel.collectAsState() } diff --git a/feature/auth/src/main/java/com/puzzle/auth/graph/verification/AuthVerficationViewModel.kt b/feature/auth/src/main/java/com/puzzle/auth/graph/verification/AuthVerificationViewModel.kt similarity index 71% rename from feature/auth/src/main/java/com/puzzle/auth/graph/verification/AuthVerficationViewModel.kt rename to feature/auth/src/main/java/com/puzzle/auth/graph/verification/AuthVerificationViewModel.kt index 96058ff9..83ce35fe 100644 --- a/feature/auth/src/main/java/com/puzzle/auth/graph/verification/AuthVerficationViewModel.kt +++ b/feature/auth/src/main/java/com/puzzle/auth/graph/verification/AuthVerificationViewModel.kt @@ -10,15 +10,15 @@ import dagger.assisted.Assisted import dagger.assisted.AssistedFactory import dagger.assisted.AssistedInject -class AuthVerficationViewModel @AssistedInject constructor( +class AuthVerificationViewModel @AssistedInject constructor( @Assisted initialState: AuthVerficationState, private val navigationHelper: NavigationHelper, ) : MavericksViewModel(initialState) { @AssistedFactory - interface Factory : AssistedViewModelFactory { - override fun create(state: AuthVerficationState): AuthVerficationViewModel + interface Factory : AssistedViewModelFactory { + override fun create(state: AuthVerficationState): AuthVerificationViewModel } companion object : - MavericksViewModelFactory by hiltMavericksViewModelFactory() + MavericksViewModelFactory by hiltMavericksViewModelFactory() } diff --git a/presentation/src/main/java/com/puzzle/presentation/di/ViewModelsModule.kt b/presentation/src/main/java/com/puzzle/presentation/di/ViewModelsModule.kt index 422bb43e..aeaacb28 100644 --- a/presentation/src/main/java/com/puzzle/presentation/di/ViewModelsModule.kt +++ b/presentation/src/main/java/com/puzzle/presentation/di/ViewModelsModule.kt @@ -3,6 +3,9 @@ package com.puzzle.presentation.di import com.airbnb.mvrx.hilt.AssistedViewModelFactory import com.airbnb.mvrx.hilt.MavericksViewModelComponent import com.airbnb.mvrx.hilt.ViewModelKey +import com.puzzle.auth.graph.main.AuthViewModel +import com.puzzle.auth.graph.registration.AuthRegistrationViewModel +import com.puzzle.auth.graph.verification.AuthVerificationViewModel import com.puzzle.matching.graph.detail.MatchingDetailViewModel import com.puzzle.matching.graph.main.MatchingViewModel import dagger.Binds @@ -23,4 +26,19 @@ interface ViewModelsModule { @IntoMap @ViewModelKey(MatchingDetailViewModel::class) fun matchingDetailViewModelFactory(factory: MatchingDetailViewModel.Factory): AssistedViewModelFactory<*, *> + + @Binds + @IntoMap + @ViewModelKey(MatchingDetailViewModel::class) + fun authViewModelFactory(factory: AuthViewModel.Factory): AssistedViewModelFactory<*, *> + + @Binds + @IntoMap + @ViewModelKey(MatchingDetailViewModel::class) + fun authRegistrationViewModelFactory(factory: AuthRegistrationViewModel.Factory): AssistedViewModelFactory<*, *> + + @Binds + @IntoMap + @ViewModelKey(MatchingDetailViewModel::class) + fun authVerificationViewModelFactory(factory: AuthVerificationViewModel.Factory): AssistedViewModelFactory<*, *> }