diff --git a/build-logic/src/main/java/com/puzzle/build/logic/KotlinAndroid.kt b/build-logic/src/main/java/com/puzzle/build/logic/KotlinAndroid.kt index 506d6eea..5dd6dfbc 100644 --- a/build-logic/src/main/java/com/puzzle/build/logic/KotlinAndroid.kt +++ b/build-logic/src/main/java/com/puzzle/build/logic/KotlinAndroid.kt @@ -9,7 +9,6 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile internal fun Project.configureKotlinAndroid() { pluginManager.apply("org.jetbrains.kotlin.android") - pluginManager.apply("org.jetbrains.kotlin.plugin.serialization") androidExtension.apply { compileSdk = 35 diff --git a/build-logic/src/main/java/com/puzzle/build/logic/configure/AndroidComposes.kt b/build-logic/src/main/java/com/puzzle/build/logic/configure/AndroidComposes.kt index 722cd11a..37592f4d 100644 --- a/build-logic/src/main/java/com/puzzle/build/logic/configure/AndroidComposes.kt +++ b/build-logic/src/main/java/com/puzzle/build/logic/configure/AndroidComposes.kt @@ -8,6 +8,7 @@ import org.gradle.kotlin.dsl.dependencies internal fun Project.configureAndroidCompose() { with(plugins) { apply("org.jetbrains.kotlin.plugin.compose") + apply("org.jetbrains.kotlin.plugin.serialization") } val libs = extensions.libs diff --git a/core/data/src/main/java/com/puzzle/data/repository/TermsRepositoryImpl.kt b/core/data/src/main/java/com/puzzle/data/repository/TermsRepositoryImpl.kt index a8240100..930cd32e 100644 --- a/core/data/src/main/java/com/puzzle/data/repository/TermsRepositoryImpl.kt +++ b/core/data/src/main/java/com/puzzle/data/repository/TermsRepositoryImpl.kt @@ -17,11 +17,11 @@ class TermsRepositoryImpl @Inject constructor( val terms = termDataSource.loadTerms() .getOrThrow() .toDomain() - .filter { it.termId != UNKNOWN_INT } + .filter { it.id != UNKNOWN_INT } val termsEntity = terms.map { TermEntity( - id = it.termId, + id = it.id, title = it.title, content = it.content, required = it.required, @@ -29,11 +29,11 @@ class TermsRepositoryImpl @Inject constructor( ) } - localTermDataSource.clearAndInsertTerms(termsEntity) + localTermDataSource.replaceTerms(termsEntity) } - override suspend fun getTerms(): Result> = suspendRunCatching { - localTermDataSource.getTerms() + override suspend fun getTerms(): Result> = runCatching { + localTermDataSource.retrieveTerms() .map(TermEntity::toDomain) } } diff --git a/core/data/src/test/java/com/puzzle/data/repository/TermsRepositoryImplTest.kt b/core/data/src/test/java/com/puzzle/data/repository/TermsRepositoryImplTest.kt index 35d9df38..44bb4b3e 100644 --- a/core/data/src/test/java/com/puzzle/data/repository/TermsRepositoryImplTest.kt +++ b/core/data/src/test/java/com/puzzle/data/repository/TermsRepositoryImplTest.kt @@ -48,7 +48,7 @@ class TermsRepositoryImplTest { coEvery { termDataSource.loadTerms() } returns Result.success(LoadTermsResponse(listOf(invalidTerm, validTerm))) - coEvery { localTermDataSource.clearAndInsertTerms(any()) } just Runs + coEvery { localTermDataSource.replaceTerms(any()) } just Runs // when val result = termsRepository.loadTerms() @@ -56,7 +56,7 @@ class TermsRepositoryImplTest { // then assertTrue(result.isSuccess) coVerify(exactly = 1) { - localTermDataSource.clearAndInsertTerms( + localTermDataSource.replaceTerms( match { it.size == 1 && it.first().id == validTerm.termId } @@ -85,14 +85,14 @@ class TermsRepositoryImplTest { ) coEvery { termDataSource.loadTerms() } returns Result.success(LoadTermsResponse(validTerms)) - coEvery { localTermDataSource.clearAndInsertTerms(any()) } just Runs + coEvery { localTermDataSource.replaceTerms(any()) } just Runs // when termsRepository.loadTerms() // then coVerify(exactly = 1) { - localTermDataSource.clearAndInsertTerms( + localTermDataSource.replaceTerms( match { it.size == validTerms.size && it.all { entity -> validTerms.any { term -> diff --git a/core/database/src/androidTest/java/com/puzzle/database/dao/TermsDaoTest.kt b/core/database/src/androidTest/java/com/puzzle/database/dao/TermsDaoTest.kt index 260fb6df..ebbd886f 100644 --- a/core/database/src/androidTest/java/com/puzzle/database/dao/TermsDaoTest.kt +++ b/core/database/src/androidTest/java/com/puzzle/database/dao/TermsDaoTest.kt @@ -80,7 +80,7 @@ class TermsDaoTest { val expected = listOf( TermEntity(2, "새로운 약관", "새로운 내용", false, "2024-06-01T00:00:00".parseDateTime()) ) - termsDao.clearAndInsertTerms(*expected.toTypedArray()) + termsDao.replaceTerms(*expected.toTypedArray()) val actual = termsDao.getTerms() // then diff --git a/core/database/src/main/java/com/puzzle/database/dao/TermsDao.kt b/core/database/src/main/java/com/puzzle/database/dao/TermsDao.kt index abed2014..42060f62 100644 --- a/core/database/src/main/java/com/puzzle/database/dao/TermsDao.kt +++ b/core/database/src/main/java/com/puzzle/database/dao/TermsDao.kt @@ -19,7 +19,7 @@ interface TermsDao { suspend fun clearTerms() @Transaction - suspend fun clearAndInsertTerms(vararg terms: TermEntity) { + suspend fun replaceTerms(vararg terms: TermEntity) { clearTerms() insertTerms(*terms) } diff --git a/core/database/src/main/java/com/puzzle/database/model/terms/TermEntity.kt b/core/database/src/main/java/com/puzzle/database/model/terms/TermEntity.kt index 89182334..c1f65292 100644 --- a/core/database/src/main/java/com/puzzle/database/model/terms/TermEntity.kt +++ b/core/database/src/main/java/com/puzzle/database/model/terms/TermEntity.kt @@ -16,7 +16,7 @@ data class TermEntity( @ColumnInfo(name = "start_date") val startDate: LocalDateTime, ) { fun toDomain() = Term( - termId = id, + id = id, title = title, content = content, required = required, diff --git a/core/database/src/main/java/com/puzzle/database/source/term/LocalTermDataSource.kt b/core/database/src/main/java/com/puzzle/database/source/term/LocalTermDataSource.kt index 3c9da99e..0c6e9d32 100644 --- a/core/database/src/main/java/com/puzzle/database/source/term/LocalTermDataSource.kt +++ b/core/database/src/main/java/com/puzzle/database/source/term/LocalTermDataSource.kt @@ -9,7 +9,6 @@ import javax.inject.Singleton class LocalTermDataSource @Inject constructor( private val termsDao: TermsDao, ) { - suspend fun getTerms() = termsDao.getTerms() - suspend fun clearAndInsertTerms(terms: List) = - termsDao.clearAndInsertTerms(*terms.toTypedArray()) + suspend fun retrieveTerms() = termsDao.getTerms() + suspend fun replaceTerms(terms: List) = termsDao.replaceTerms(*terms.toTypedArray()) } diff --git a/core/designsystem/src/main/java/com/puzzle/designsystem/component/TopBar.kt b/core/designsystem/src/main/java/com/puzzle/designsystem/component/TopBar.kt index 5305d2cf..8cca5398 100644 --- a/core/designsystem/src/main/java/com/puzzle/designsystem/component/TopBar.kt +++ b/core/designsystem/src/main/java/com/puzzle/designsystem/component/TopBar.kt @@ -7,6 +7,7 @@ import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.material3.Text @@ -30,7 +31,9 @@ fun PieceMainTopBar( ) { Row( verticalAlignment = Alignment.CenterVertically, - modifier = modifier, + modifier = modifier + .fillMaxWidth() + .height(60.dp), ) { Text( text = title, @@ -54,7 +57,9 @@ fun PieceSubTopBar( Row( horizontalArrangement = Arrangement.SpaceBetween, verticalAlignment = Alignment.CenterVertically, - modifier = modifier, + modifier = modifier + .fillMaxWidth() + .height(60.dp), ) { Image( painter = painterResource(R.drawable.ic_arrow_left), @@ -78,7 +83,11 @@ fun PieceSubBackTopBar( onBackClick: () -> Unit, modifier: Modifier = Modifier, ) { - Box(modifier = modifier.fillMaxWidth()) { + Box( + modifier = modifier + .fillMaxWidth() + .height(60.dp), + ) { Image( painter = painterResource(R.drawable.ic_arrow_left), contentDescription = "뒤로 가기 버튼", @@ -105,7 +114,11 @@ fun PieceSubCloseTopBar( closeButtonEnabled: Boolean = true, contentColor: Color = PieceTheme.colors.black, ) { - Box(modifier = modifier.fillMaxWidth()) { + Box( + modifier = modifier + .fillMaxWidth() + .height(60.dp), + ) { Text( text = title, style = PieceTheme.typography.headingSSB, @@ -176,9 +189,7 @@ fun PreviewPieceSubTopBar() { modifier = Modifier.size(32.dp), ) }, - modifier = Modifier - .fillMaxWidth() - .padding(vertical = 20.dp), + modifier = Modifier.padding(vertical = 20.dp), ) } } diff --git a/core/designsystem/src/main/java/com/puzzle/designsystem/component/WebView.kt b/core/designsystem/src/main/java/com/puzzle/designsystem/component/WebView.kt new file mode 100644 index 00000000..8cba18cf --- /dev/null +++ b/core/designsystem/src/main/java/com/puzzle/designsystem/component/WebView.kt @@ -0,0 +1,36 @@ +package com.puzzle.designsystem.component + +import android.webkit.WebChromeClient +import android.webkit.WebView +import android.webkit.WebViewClient +import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue +import androidx.compose.ui.Modifier +import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.viewinterop.AndroidView + +@Composable +fun PieceWebView( + url: String, + modifier: Modifier = Modifier, +) { + val context = LocalContext.current + var webView by remember { mutableStateOf(null) } + + AndroidView( + factory = { + webView = WebView(context).apply { + settings.javaScriptEnabled = true + webViewClient = object : WebViewClient() {} + webChromeClient = object : WebChromeClient() {} + } + webView!! + }, + update = { it.loadUrl(url) }, + onRelease = { webView?.destroy() }, + modifier = modifier, + ) +} diff --git a/core/designsystem/src/main/res/values/strings.xml b/core/designsystem/src/main/res/values/strings.xml index c5f0d6cf..b350db63 100644 --- a/core/designsystem/src/main/res/values/strings.xml +++ b/core/designsystem/src/main/res/values/strings.xml @@ -1,5 +1,10 @@ + + 다음 + 동의하기 + 약관 전체 동의 + Matching 매칭 조각을 확인해주세요! diff --git a/core/domain/src/main/java/com/puzzle/domain/model/terms/Term.kt b/core/domain/src/main/java/com/puzzle/domain/model/terms/Term.kt index e0896524..b0eb5b34 100644 --- a/core/domain/src/main/java/com/puzzle/domain/model/terms/Term.kt +++ b/core/domain/src/main/java/com/puzzle/domain/model/terms/Term.kt @@ -3,7 +3,7 @@ package com.puzzle.domain.model.terms import java.time.LocalDateTime data class Term( - val termId: Int, + val id: Int, val title: String, val content: String, val required: Boolean, diff --git a/core/navigation/build.gradle.kts b/core/navigation/build.gradle.kts index 7c9fddf2..c9e0abc9 100644 --- a/core/navigation/build.gradle.kts +++ b/core/navigation/build.gradle.kts @@ -1,5 +1,6 @@ plugins { id("piece.android.library") + alias(libs.plugins.kotlin.serialization) } android { diff --git a/core/network/src/main/java/com/puzzle/network/model/terms/LoadTermsResponse.kt b/core/network/src/main/java/com/puzzle/network/model/terms/LoadTermsResponse.kt index bb705cfa..3b1ff25e 100644 --- a/core/network/src/main/java/com/puzzle/network/model/terms/LoadTermsResponse.kt +++ b/core/network/src/main/java/com/puzzle/network/model/terms/LoadTermsResponse.kt @@ -23,7 +23,7 @@ data class TermResponse( val startDate: String?, ) { fun toDomain(): Term = Term( - termId = termId ?: UNKNOWN_INT, + id = termId ?: UNKNOWN_INT, title = title ?: UNKNOWN_STRING, content = content ?: UNKNOWN_STRING, required = required ?: false, diff --git a/feature/auth/src/main/java/com/puzzle/auth/graph/registration/RegistrationDetailScreen.kt b/feature/auth/src/main/java/com/puzzle/auth/graph/registration/RegistrationDetailScreen.kt deleted file mode 100644 index 408dd8ce..00000000 --- a/feature/auth/src/main/java/com/puzzle/auth/graph/registration/RegistrationDetailScreen.kt +++ /dev/null @@ -1,8 +0,0 @@ -package com.puzzle.auth.graph.registration - -import androidx.compose.runtime.Composable - -@Composable -internal fun RegistrationDetailScreen() { - -} \ No newline at end of file diff --git a/feature/auth/src/main/java/com/puzzle/auth/graph/registration/RegistrationScreen.kt b/feature/auth/src/main/java/com/puzzle/auth/graph/registration/RegistrationScreen.kt index 23015919..aaa6223b 100644 --- a/feature/auth/src/main/java/com/puzzle/auth/graph/registration/RegistrationScreen.kt +++ b/feature/auth/src/main/java/com/puzzle/auth/graph/registration/RegistrationScreen.kt @@ -4,12 +4,15 @@ import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.SpanStyle import androidx.compose.ui.text.buildAnnotatedString import androidx.compose.ui.text.withStyle @@ -19,10 +22,13 @@ import com.airbnb.mvrx.compose.mavericksViewModel import com.puzzle.auth.graph.registration.contract.RegistrationIntent import com.puzzle.auth.graph.registration.contract.RegistrationSideEffect import com.puzzle.auth.graph.registration.contract.RegistrationState +import com.puzzle.auth.graph.registration.ui.RegistrationDetailScreen +import com.puzzle.designsystem.R import com.puzzle.designsystem.component.PieceCheckList import com.puzzle.designsystem.component.PieceSolidButton import com.puzzle.designsystem.component.PieceSubBackTopBar import com.puzzle.designsystem.foundation.PieceTheme +import com.puzzle.domain.model.terms.Term import com.puzzle.navigation.NavigationEvent @Composable @@ -30,11 +36,22 @@ internal fun RegistrationRoute( viewModel: RegistrationViewModel = mavericksViewModel() ) { val state by viewModel.collectAsState() + var selectedTerm by remember { mutableStateOf(null) } - RegistrationScreen( + selectedTerm?.let { term -> + RegistrationDetailScreen( + term = term, + onBackClick = { selectedTerm = null }, + onAgreeClick = { + viewModel.onIntent(RegistrationIntent.CheckTerm(term.id)) + selectedTerm = null + } + ) + } ?: RegistrationScreen( state = state, checkAllTerms = { viewModel.onIntent(RegistrationIntent.CheckAllTerms) }, checkTerm = { viewModel.onIntent(RegistrationIntent.CheckTerm(it)) }, + showTermDetail = { selectedTerm = it }, navigate = { event -> viewModel.onSideEffect(RegistrationSideEffect.Navigate(event)) } ) } @@ -44,6 +61,7 @@ private fun RegistrationScreen( state: RegistrationState, checkAllTerms: () -> Unit, checkTerm: (Int) -> Unit, + showTermDetail: (Term) -> Unit, navigate: (NavigationEvent) -> Unit, ) { Column( @@ -54,7 +72,6 @@ private fun RegistrationScreen( PieceSubBackTopBar( title = "", onBackClick = { navigate(NavigationEvent.NavigateUp) }, - modifier = Modifier.height(60.dp), ) Text( @@ -80,7 +97,7 @@ private fun RegistrationScreen( PieceCheckList( checked = state.allTermsAgreed, - label = "약관 전체 동의", + label = stringResource(R.string.all_term_agree), containerColor = PieceTheme.colors.light3, onCheckedChange = checkAllTerms, modifier = Modifier @@ -88,13 +105,13 @@ private fun RegistrationScreen( .padding(bottom = 12.dp), ) - state.terms.forEach { termInfo -> + state.terms.forEach { term -> PieceCheckList( - checked = state.termsCheckedInfo.getOrDefault(termInfo.termId, false), + checked = state.termsCheckedInfo.getOrDefault(term.id, false), arrowEnabled = true, - label = termInfo.title, - onCheckedChange = { checkTerm(termInfo.termId) }, - onArrowClick = {}, + label = term.title, + onCheckedChange = { checkTerm(term.id) }, + onArrowClick = { showTermDetail(term) }, modifier = Modifier.fillMaxWidth(), ) } @@ -106,7 +123,7 @@ private fun RegistrationScreen( ) PieceSolidButton( - label = "다음", + label = stringResource(R.string.next), onClick = {}, modifier = Modifier .fillMaxWidth() diff --git a/feature/auth/src/main/java/com/puzzle/auth/graph/registration/RegistrationViewModel.kt b/feature/auth/src/main/java/com/puzzle/auth/graph/registration/RegistrationViewModel.kt index 8579cf4b..11924675 100644 --- a/feature/auth/src/main/java/com/puzzle/auth/graph/registration/RegistrationViewModel.kt +++ b/feature/auth/src/main/java/com/puzzle/auth/graph/registration/RegistrationViewModel.kt @@ -71,25 +71,21 @@ class RegistrationViewModel @AssistedInject constructor( } private fun checkTerm(termId: Int) = setState { - val updatedTermsCheckedInfo = termsCheckedInfo.toMutableMap().apply { - this[termId] = !(this[termId] ?: false) - } + val updatedTermsCheckedInfo = termsCheckedInfo.toMutableMap() + .apply { this[termId] = !(this[termId] ?: false) } + .toMap() copy(termsCheckedInfo = updatedTermsCheckedInfo) } private fun checkAllTerms() = setState { - if (allTermsAgreed) { - copy(termsCheckedInfo = mutableMapOf()) + val updatedTermsCheckedInfo = if (allTermsAgreed) { + emptyMap() } else { - val updatedTermsCheckedInfo = termsCheckedInfo.toMutableMap() - - terms.forEach { termInfo -> - updatedTermsCheckedInfo[termInfo.termId] = true - } - - copy(termsCheckedInfo = updatedTermsCheckedInfo) + terms.associate { termInfo -> termInfo.id to true } } + + copy(termsCheckedInfo = updatedTermsCheckedInfo) } @AssistedFactory diff --git a/feature/auth/src/main/java/com/puzzle/auth/graph/registration/contract/RegistrationState.kt b/feature/auth/src/main/java/com/puzzle/auth/graph/registration/contract/RegistrationState.kt index 2dc7c451..ad03a47a 100644 --- a/feature/auth/src/main/java/com/puzzle/auth/graph/registration/contract/RegistrationState.kt +++ b/feature/auth/src/main/java/com/puzzle/auth/graph/registration/contract/RegistrationState.kt @@ -5,7 +5,19 @@ import com.puzzle.domain.model.terms.Term data class RegistrationState( val terms: List = emptyList(), - val termsCheckedInfo: MutableMap = mutableMapOf(), + val termsCheckedInfo: Map = emptyMap(), ) : MavericksState { - val allTermsAgreed = terms.all { termsCheckedInfo.getOrDefault(it.termId, false) } + val allTermsAgreed = terms.all { termsCheckedInfo.getOrDefault(it.id, false) } + + enum class RegistrationPage() { + TermPage, + TermDetailPage, + AccessRightsPage, + AvoidAcquaintancesPage, + SignUpCompleted; + + companion object { + + } + } } diff --git a/feature/auth/src/main/java/com/puzzle/auth/graph/registration/ui/RegistrationDetailScreen.kt b/feature/auth/src/main/java/com/puzzle/auth/graph/registration/ui/RegistrationDetailScreen.kt new file mode 100644 index 00000000..4edf754c --- /dev/null +++ b/feature/auth/src/main/java/com/puzzle/auth/graph/registration/ui/RegistrationDetailScreen.kt @@ -0,0 +1,51 @@ +package com.puzzle.auth.graph.registration.ui + +import androidx.activity.compose.BackHandler +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.unit.dp +import com.puzzle.designsystem.R +import com.puzzle.designsystem.component.PieceSolidButton +import com.puzzle.designsystem.component.PieceSubBackTopBar +import com.puzzle.designsystem.component.PieceWebView +import com.puzzle.domain.model.terms.Term + +@Composable +internal fun RegistrationDetailScreen( + term: Term, + onBackClick: () -> Unit, + onAgreeClick: () -> Unit, +) { + BackHandler { onBackClick() } + + Column( + modifier = Modifier + .fillMaxSize() + .padding(horizontal = 20.dp), + ) { + PieceSubBackTopBar( + title = term.title, + onBackClick = onBackClick, + ) + + PieceWebView( + url = term.content, + modifier = Modifier + .fillMaxWidth() + .weight(1f), + ) + + PieceSolidButton( + label = stringResource(R.string.agree), + onClick = onAgreeClick, + modifier = Modifier + .fillMaxWidth() + .padding(top = 12.dp, bottom = 10.dp), + ) + } +} diff --git a/feature/matching/src/main/java/com/puzzle/matching/graph/detail/MatchingDetailRoute.kt b/feature/matching/src/main/java/com/puzzle/matching/graph/detail/MatchingDetailRoute.kt index 5036f469..c379c998 100644 --- a/feature/matching/src/main/java/com/puzzle/matching/graph/detail/MatchingDetailRoute.kt +++ b/feature/matching/src/main/java/com/puzzle/matching/graph/detail/MatchingDetailRoute.kt @@ -37,10 +37,10 @@ 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.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.graph.detail.common.constant.DialogType +import com.puzzle.matching.graph.detail.common.ui.BasicInfoBody +import com.puzzle.matching.graph.detail.common.ui.ValuePickBody +import com.puzzle.matching.graph.detail.common.ui.ValueTalkBody 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 @@ -149,7 +149,7 @@ private fun MatchingDetailScreen( modifier = modifier .fillMaxSize() .then( - if (state.currentPage != MatchingDetailPage.BasicInfoState) { + if (state.currentPage != MatchingDetailPage.BasicInfoPage) { Modifier.background(PieceTheme.colors.light3) } else { Modifier @@ -184,7 +184,7 @@ private fun MatchingDetailScreen( .height(topBarHeight) .align(Alignment.TopCenter) .let { - if (state.currentPage != MatchingDetailPage.BasicInfoState) { + if (state.currentPage != MatchingDetailPage.BasicInfoPage) { it.background(PieceTheme.colors.white) } else { it @@ -243,7 +243,7 @@ private fun MatchingDetailContent( ) { Box(modifier = modifier.fillMaxSize()) { when (state.currentPage) { - MatchingDetailState.MatchingDetailPage.BasicInfoState -> + MatchingDetailState.MatchingDetailPage.BasicInfoPage -> BasicInfoBody( nickName = state.nickName, selfDescription = state.selfDescription, @@ -258,7 +258,7 @@ private fun MatchingDetailContent( modifier = Modifier.padding(horizontal = 20.dp), ) - MatchingDetailState.MatchingDetailPage.ValueTalkState -> + MatchingDetailState.MatchingDetailPage.ValueTalkPage -> ValueTalkBody( nickName = state.nickName, selfDescription = state.selfDescription, @@ -266,7 +266,7 @@ private fun MatchingDetailContent( onMoreClick = onMoreClick, ) - MatchingDetailState.MatchingDetailPage.ValuePickState -> + MatchingDetailState.MatchingDetailPage.ValuePickPage -> ValuePickBody( nickName = state.nickName, selfDescription = state.selfDescription, @@ -290,7 +290,7 @@ private fun MatchingDetailBottomBar( verticalAlignment = Alignment.CenterVertically, modifier = modifier, ) { - if (currentPage == MatchingDetailPage.ValuePickState) { + if (currentPage == MatchingDetailPage.ValuePickPage) { Image( painter = painterResource(id = R.drawable.ic_profile_image), contentDescription = "이전 페이지 버튼", @@ -304,7 +304,7 @@ private fun MatchingDetailBottomBar( Spacer(modifier = Modifier.weight(1f)) - if (currentPage == MatchingDetailPage.BasicInfoState) { + if (currentPage == MatchingDetailPage.BasicInfoPage) { Image( painter = painterResource(id = R.drawable.ic_left_disable), contentDescription = "이전 페이지 버튼", @@ -325,7 +325,7 @@ private fun MatchingDetailBottomBar( Spacer(modifier = Modifier.width(8.dp)) - if (currentPage == MatchingDetailPage.ValuePickState) { + if (currentPage == MatchingDetailPage.ValuePickPage) { PieceRoundingButton( label = stringResource(R.string.valuepick_bottom_bar_label), onClick = onAcceptClick, @@ -366,7 +366,7 @@ private fun MatchingDetailScreenPreview() { private fun BottomNavigationOnBasicInfoStatePreview() { PieceTheme { MatchingDetailBottomBar( - currentPage = MatchingDetailPage.BasicInfoState, + currentPage = MatchingDetailPage.BasicInfoPage, {}, {}, {}, @@ -380,7 +380,7 @@ private fun BottomNavigationOnBasicInfoStatePreview() { private fun BottomNavigationOnValueTalkStatePreview() { PieceTheme { MatchingDetailBottomBar( - currentPage = MatchingDetailPage.ValueTalkState, + currentPage = MatchingDetailPage.ValueTalkPage, {}, {}, {}, @@ -394,7 +394,7 @@ private fun BottomNavigationOnValueTalkStatePreview() { private fun BottomNavigationOnValuePickStatePreview() { PieceTheme { MatchingDetailBottomBar( - currentPage = MatchingDetailPage.ValuePickState, + currentPage = MatchingDetailPage.ValuePickPage, {}, {}, {}, diff --git a/feature/matching/src/main/java/com/puzzle/matching/common/component/BasicInfoHeader.kt b/feature/matching/src/main/java/com/puzzle/matching/graph/detail/common/component/BasicInfoHeader.kt similarity index 96% rename from feature/matching/src/main/java/com/puzzle/matching/common/component/BasicInfoHeader.kt rename to feature/matching/src/main/java/com/puzzle/matching/graph/detail/common/component/BasicInfoHeader.kt index 3bf40348..8a14116e 100644 --- a/feature/matching/src/main/java/com/puzzle/matching/common/component/BasicInfoHeader.kt +++ b/feature/matching/src/main/java/com/puzzle/matching/graph/detail/common/component/BasicInfoHeader.kt @@ -1,4 +1,4 @@ -package com.puzzle.matching.common.component +package com.puzzle.matching.graph.detail.common.component import androidx.compose.foundation.Image import androidx.compose.foundation.clickable diff --git a/feature/matching/src/main/java/com/puzzle/matching/common/constant/DialogType.kt b/feature/matching/src/main/java/com/puzzle/matching/graph/detail/common/constant/DialogType.kt similarity index 62% rename from feature/matching/src/main/java/com/puzzle/matching/common/constant/DialogType.kt rename to feature/matching/src/main/java/com/puzzle/matching/graph/detail/common/constant/DialogType.kt index 4e0a1141..7584df3b 100644 --- a/feature/matching/src/main/java/com/puzzle/matching/common/constant/DialogType.kt +++ b/feature/matching/src/main/java/com/puzzle/matching/graph/detail/common/constant/DialogType.kt @@ -1,4 +1,4 @@ -package com.puzzle.matching.common.constant +package com.puzzle.matching.graph.detail.common.constant enum class DialogType { ACCEPT_MATCHING, diff --git a/feature/matching/src/main/java/com/puzzle/matching/common/ui/BasicInfoBody.kt b/feature/matching/src/main/java/com/puzzle/matching/graph/detail/common/ui/BasicInfoBody.kt similarity index 98% rename from feature/matching/src/main/java/com/puzzle/matching/common/ui/BasicInfoBody.kt rename to feature/matching/src/main/java/com/puzzle/matching/graph/detail/common/ui/BasicInfoBody.kt index 3ef8288b..1cb97462 100644 --- a/feature/matching/src/main/java/com/puzzle/matching/common/ui/BasicInfoBody.kt +++ b/feature/matching/src/main/java/com/puzzle/matching/graph/detail/common/ui/BasicInfoBody.kt @@ -1,4 +1,4 @@ -package com.puzzle.matching.common.ui +package com.puzzle.matching.graph.detail.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.common.component.BasicInfoHeader +import com.puzzle.matching.graph.detail.common.component.BasicInfoHeader @Composable internal fun BasicInfoBody( diff --git a/feature/matching/src/main/java/com/puzzle/matching/common/ui/ValuePickBody.kt b/feature/matching/src/main/java/com/puzzle/matching/graph/detail/common/ui/ValuePickBody.kt similarity index 98% rename from feature/matching/src/main/java/com/puzzle/matching/common/ui/ValuePickBody.kt rename to feature/matching/src/main/java/com/puzzle/matching/graph/detail/common/ui/ValuePickBody.kt index 9e224d6c..f3591b28 100644 --- a/feature/matching/src/main/java/com/puzzle/matching/common/ui/ValuePickBody.kt +++ b/feature/matching/src/main/java/com/puzzle/matching/graph/detail/common/ui/ValuePickBody.kt @@ -1,4 +1,4 @@ -package com.puzzle.matching.common.ui +package com.puzzle.matching.graph.detail.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.matching.ValuePick -import com.puzzle.matching.common.component.BasicInfoHeader +import com.puzzle.matching.graph.detail.common.component.BasicInfoHeader @Composable internal fun ValuePickBody( diff --git a/feature/matching/src/main/java/com/puzzle/matching/common/ui/ValueTalkBody.kt b/feature/matching/src/main/java/com/puzzle/matching/graph/detail/common/ui/ValueTalkBody.kt similarity index 98% rename from feature/matching/src/main/java/com/puzzle/matching/common/ui/ValueTalkBody.kt rename to feature/matching/src/main/java/com/puzzle/matching/graph/detail/common/ui/ValueTalkBody.kt index 73c01090..16e1fb7c 100644 --- a/feature/matching/src/main/java/com/puzzle/matching/common/ui/ValueTalkBody.kt +++ b/feature/matching/src/main/java/com/puzzle/matching/graph/detail/common/ui/ValueTalkBody.kt @@ -1,4 +1,4 @@ -package com.puzzle.matching.common.ui +package com.puzzle.matching.graph.detail.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.matching.ValueTalk -import com.puzzle.matching.common.component.BasicInfoHeader +import com.puzzle.matching.graph.detail.common.component.BasicInfoHeader @Composable internal fun ValueTalkBody( diff --git a/feature/matching/src/main/java/com/puzzle/matching/graph/detail/contract/MatchingDetailState.kt b/feature/matching/src/main/java/com/puzzle/matching/graph/detail/contract/MatchingDetailState.kt index b8023ee8..04ba59a6 100644 --- a/feature/matching/src/main/java/com/puzzle/matching/graph/detail/contract/MatchingDetailState.kt +++ b/feature/matching/src/main/java/com/puzzle/matching/graph/detail/contract/MatchingDetailState.kt @@ -6,7 +6,7 @@ import com.puzzle.domain.model.matching.ValueTalk data class MatchingDetailState( val isLoading: Boolean = false, - val currentPage: MatchingDetailPage = MatchingDetailPage.BasicInfoState, + val currentPage: MatchingDetailPage = MatchingDetailPage.BasicInfoPage, // BasicInfoState val selfDescription: String = "", val nickName: String = "", @@ -22,24 +22,24 @@ data class MatchingDetailState( ) : MavericksState { enum class MatchingDetailPage(val title: String) { - BasicInfoState(title = ""), - ValueTalkState(title = "가치관 Talk"), - ValuePickState(title = "가치관 Pick"); + BasicInfoPage(title = ""), + ValueTalkPage(title = "가치관 Talk"), + ValuePickPage(title = "가치관 Pick"); companion object { fun getNextPage(currentPage: MatchingDetailPage): MatchingDetailPage { return when (currentPage) { - BasicInfoState -> ValueTalkState - ValueTalkState -> ValuePickState - ValuePickState -> ValuePickState + BasicInfoPage -> ValueTalkPage + ValueTalkPage -> ValuePickPage + ValuePickPage -> ValuePickPage } } fun getPreviousPage(currentPage: MatchingDetailPage): MatchingDetailPage { return when (currentPage) { - BasicInfoState -> BasicInfoState - ValueTalkState -> BasicInfoState - ValuePickState -> ValueTalkState + BasicInfoPage -> BasicInfoPage + ValueTalkPage -> BasicInfoPage + ValuePickPage -> ValueTalkPage } } }