diff --git a/app/src/main/java/com/mashup/dorabangs/navigation/MainNavHost.kt b/app/src/main/java/com/mashup/dorabangs/navigation/MainNavHost.kt index 5cd4ebed..bcc9f897 100644 --- a/app/src/main/java/com/mashup/dorabangs/navigation/MainNavHost.kt +++ b/app/src/main/java/com/mashup/dorabangs/navigation/MainNavHost.kt @@ -40,7 +40,10 @@ fun MainNavHost( onBoardingNavigation { appState.navController.navigateToHome() } storageNavigation(appState.navController) storageDetailNavigation(appState.navController) - classificationNavigation(appState.navController) + classificationNavigation( + onClickBackIcon = { appState.navController.popBackStack() }, + navigateToHome = { appState.navController.popBackStack() }, + ) saveLinkNavigation( onClickBackIcon = { appState.navController.popBackStack() }, onClickSaveButton = { appState.navController.navigateToSaveLinkSelectFolder(copiedUrl = it) }, diff --git a/feature/classification/src/main/java/com/mashup/feature/classification/ClassificationCompleteScreen.kt b/feature/classification/src/main/java/com/mashup/feature/classification/ClassificationCompleteScreen.kt new file mode 100644 index 00000000..8666c905 --- /dev/null +++ b/feature/classification/src/main/java/com/mashup/feature/classification/ClassificationCompleteScreen.kt @@ -0,0 +1,53 @@ +package com.mashup.feature.classification + +import androidx.compose.foundation.Image +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.layout.wrapContentWidth +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.unit.dp +import com.mashup.dorabangs.core.designsystem.component.buttons.DoraButtons +import com.mashup.dorabangs.core.designsystem.theme.DoraColorTokens +import com.mashup.dorabangs.core.designsystem.theme.DoraTypoTokens + +@Composable +fun ClassificationCompleteScreen( + navigateToHome: () -> Unit, + modifier: Modifier = Modifier, +) { + Column( + modifier = modifier.fillMaxSize(), + verticalArrangement = Arrangement.Center, + horizontalAlignment = Alignment.CenterHorizontally, + ) { + Image( + modifier = Modifier.size(252.dp), + painter = painterResource(id = R.drawable.ic_launcher), + contentDescription = "completeImage", + ) + Text( + text = stringResource(id = R.string.ai_classification_complete), + style = DoraTypoTokens.Subtitle2Medium, + color = DoraColorTokens.G9, + ) + Spacer(modifier = Modifier.height(16.dp)) + DoraButtons.DoraSmallConfirmBtn( + modifier = Modifier + .align(Alignment.CenterHorizontally) + .padding(horizontal = 30.dp, vertical = 8.dp) + .wrapContentWidth(), + buttonText = stringResource(id = R.string.ai_classification_navigate_home), + onClickButton = { navigateToHome() }, + ) + } +} diff --git a/feature/classification/src/main/java/com/mashup/feature/classification/ClassificationScreen.kt b/feature/classification/src/main/java/com/mashup/feature/classification/ClassificationScreen.kt index 306860ba..256b797b 100644 --- a/feature/classification/src/main/java/com/mashup/feature/classification/ClassificationScreen.kt +++ b/feature/classification/src/main/java/com/mashup/feature/classification/ClassificationScreen.kt @@ -17,6 +17,7 @@ import org.orbitmvi.orbit.compose.collectAsState @Composable fun ClassificationRoute( onClickBackIcon: () -> Unit, + navigateToHome: () -> Unit, classificationViewModel: ClassificationViewModel = hiltViewModel(), ) { val state by classificationViewModel.collectAsState() @@ -28,18 +29,20 @@ fun ClassificationRoute( onClickMoveButton = classificationViewModel::moveSelectedItem, onClickAllItemMoveButton = classificationViewModel::moveAllItems, onClickBackIcon = onClickBackIcon, + navigateToHome = navigateToHome, ) } @Composable fun ClassificationScreen( state: ClassificationState, - modifier: Modifier = Modifier, - onClickChip: () -> Unit = {}, - onClickDeleteButton: (Int) -> Unit = {}, - onClickMoveButton: (Int) -> Unit = {}, - onClickAllItemMoveButton: () -> Unit = {}, + onClickChip: () -> Unit, + onClickDeleteButton: (Int) -> Unit, + onClickMoveButton: (Int) -> Unit, + onClickAllItemMoveButton: () -> Unit, onClickBackIcon: () -> Unit, + navigateToHome: () -> Unit, + modifier: Modifier = Modifier, ) { Column( modifier = modifier.fillMaxSize(), @@ -65,17 +68,29 @@ fun ClassificationScreen( selectedIndex = 0, onClickChip = { onClickChip() }, ) - ClassificationListScreen( - state = state, - onClickDeleteButton = onClickDeleteButton, - onClickMoveButton = onClickMoveButton, - onClickAllItemMoveButton = onClickAllItemMoveButton, - ) + if (state.isClassificationComplete) { + ClassificationCompleteScreen(navigateToHome = navigateToHome) + } else { + ClassificationListScreen( + state = state, + onClickDeleteButton = onClickDeleteButton, + onClickMoveButton = onClickMoveButton, + onClickAllItemMoveButton = onClickAllItemMoveButton, + ) + } } } @Preview @Composable fun PreviewClassificationScreen() { - ClassificationScreen(state = ClassificationState(), onClickBackIcon = {}) + ClassificationScreen( + state = ClassificationState(), + onClickChip = {}, + onClickDeleteButton = {}, + onClickMoveButton = {}, + onClickAllItemMoveButton = {}, + onClickBackIcon = {}, + navigateToHome = {}, + ) } diff --git a/feature/classification/src/main/java/com/mashup/feature/classification/ClassificationState.kt b/feature/classification/src/main/java/com/mashup/feature/classification/ClassificationState.kt index f2313924..5cbb1eef 100644 --- a/feature/classification/src/main/java/com/mashup/feature/classification/ClassificationState.kt +++ b/feature/classification/src/main/java/com/mashup/feature/classification/ClassificationState.kt @@ -4,6 +4,7 @@ import com.mashup.dorabangs.core.designsystem.component.card.FeedCardUiModel data class ClassificationState( val folderList: List = listOf(), - val selectedFolder: String = "디자인", + val selectedFolder: String = "디자인", // TODO- 수정 예정 val cardInfoList: List = FeedCardUiModel.getDefaultFeedCard(), + val isClassificationComplete: Boolean = false, ) diff --git a/feature/classification/src/main/java/com/mashup/feature/classification/navigation/ClassificationNavigation.kt b/feature/classification/src/main/java/com/mashup/feature/classification/navigation/ClassificationNavigation.kt index 238f8540..40dc42b8 100644 --- a/feature/classification/src/main/java/com/mashup/feature/classification/navigation/ClassificationNavigation.kt +++ b/feature/classification/src/main/java/com/mashup/feature/classification/navigation/ClassificationNavigation.kt @@ -8,12 +8,16 @@ import com.mashup.feature.classification.ClassificationRoute fun NavController.navigateToClassification() = navigate(NavigationRoute.ClassificationScreen.route) -fun NavGraphBuilder.classificationNavigation(navController: NavController) { +fun NavGraphBuilder.classificationNavigation( + onClickBackIcon: () -> Unit, + navigateToHome: () -> Unit, +) { composable( route = NavigationRoute.ClassificationScreen.route, ) { ClassificationRoute( - onClickBackIcon = { navController.popBackStack() }, + onClickBackIcon = onClickBackIcon, + navigateToHome = navigateToHome, ) } } diff --git a/feature/classification/src/main/res/drawable/ic_launcher.webp b/feature/classification/src/main/res/drawable/ic_launcher.webp new file mode 100644 index 00000000..1dc068b3 Binary files /dev/null and b/feature/classification/src/main/res/drawable/ic_launcher.webp differ diff --git a/feature/classification/src/main/res/values/string.xml b/feature/classification/src/main/res/values/string.xml index 999db131..48b4b88a 100644 --- a/feature/classification/src/main/res/values/string.xml +++ b/feature/classification/src/main/res/values/string.xml @@ -2,4 +2,6 @@ AI분류 모두 이동 + 홈으로 이동 + 분류한 링크를 모두 확인했어요! \ No newline at end of file