From 3ddf475cff334f1e5bec9380bf51995b3e7b5fad Mon Sep 17 00:00:00 2001 From: arinming Date: Mon, 9 Sep 2024 21:56:03 +0900 Subject: [PATCH 1/6] =?UTF-8?q?[FEAT/#229]=20=EA=B2=80=EC=83=89=20?= =?UTF-8?q?=ED=99=94=EB=A9=B4=20=EB=A1=9C=EA=B3=A0=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/topappbar/LogoTopAppBar.kt | 37 ------ .../com/terning/feature/main/MainScreen.kt | 13 +- .../feature/search/search/SearchRoute.kt | 113 +++++++++--------- .../search/navigation/SearchNavigation.kt | 5 + .../navigation/SearchProcessNavigation.kt | 2 + 5 files changed, 73 insertions(+), 97 deletions(-) delete mode 100644 core/src/main/java/com/terning/core/designsystem/component/topappbar/LogoTopAppBar.kt diff --git a/core/src/main/java/com/terning/core/designsystem/component/topappbar/LogoTopAppBar.kt b/core/src/main/java/com/terning/core/designsystem/component/topappbar/LogoTopAppBar.kt deleted file mode 100644 index 68c144185..000000000 --- a/core/src/main/java/com/terning/core/designsystem/component/topappbar/LogoTopAppBar.kt +++ /dev/null @@ -1,37 +0,0 @@ -package com.terning.core.designsystem.component.topappbar - -import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.layout.size -import androidx.compose.material3.Icon -import androidx.compose.runtime.Composable -import androidx.compose.ui.Modifier -import androidx.compose.ui.platform.LocalConfiguration -import androidx.compose.ui.res.painterResource -import androidx.compose.ui.res.stringResource -import androidx.compose.ui.unit.dp -import com.terning.core.R -import com.terning.core.designsystem.theme.TerningMain - -@Composable -fun LogoTopAppBar( - modifier: Modifier = Modifier -) { - val configuration = LocalConfiguration.current - val heightRatio = 780f / configuration.screenHeightDp - val widthRatio = 360f / configuration.screenWidthDp - - TerningBasicTopAppBar( - showBackButton = false, - actions = listOf { - Icon( - painter = painterResource(id = R.drawable.ic_terning_logo_typo), - contentDescription = stringResource(id = R.string.ic_logo), - tint = TerningMain, - modifier = Modifier - .padding(start = 24.dp, end = 16.dp, top = 16.dp) - .size(width = (109 * widthRatio).dp, height = (26 * heightRatio).dp) - ) - }, - modifier = modifier - ) -} diff --git a/feature/src/main/java/com/terning/feature/main/MainScreen.kt b/feature/src/main/java/com/terning/feature/main/MainScreen.kt index f851101a2..52e2c00f2 100644 --- a/feature/src/main/java/com/terning/feature/main/MainScreen.kt +++ b/feature/src/main/java/com/terning/feature/main/MainScreen.kt @@ -130,8 +130,12 @@ fun MainScreen( ) calendarNavGraph( paddingValues = paddingValues, - navHostController = navigator.navController) - searchNavGraph(navHostController = navigator.navController) + navHostController = navigator.navController + ) + searchNavGraph( + paddingValues = paddingValues, + navHostController = navigator.navController + ) signInNavGraph( paddingValues = paddingValues, navHostController = navigator.navController @@ -160,7 +164,10 @@ fun MainScreen( paddingValues = paddingValues, navHostController = navigator.navController ) - searchProcessNavGraph(navHostController = navigator.navController) + searchProcessNavGraph( + paddingValues = paddingValues, + navHostController = navigator.navController + ) changeFilterNavGraph(navHostController = navigator.navController) internNavGraph(navHostController = navigator.navController) myPageNavGraph( diff --git a/feature/src/main/java/com/terning/feature/search/search/SearchRoute.kt b/feature/src/main/java/com/terning/feature/search/search/SearchRoute.kt index 3d4b3f611..6756b9ae9 100644 --- a/feature/src/main/java/com/terning/feature/search/search/SearchRoute.kt +++ b/feature/src/main/java/com/terning/feature/search/search/SearchRoute.kt @@ -8,7 +8,6 @@ import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.material3.HorizontalDivider -import androidx.compose.material3.Scaffold import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect @@ -20,8 +19,8 @@ import androidx.hilt.navigation.compose.hiltViewModel import androidx.lifecycle.compose.LocalLifecycleOwner import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.flowWithLifecycle +import com.terning.core.designsystem.component.image.TerningImage import com.terning.core.designsystem.component.textfield.SearchTextField -import com.terning.core.designsystem.component.topappbar.LogoTopAppBar import com.terning.core.designsystem.theme.Black import com.terning.core.designsystem.theme.Grey100 import com.terning.core.designsystem.theme.TerningTheme @@ -36,6 +35,7 @@ import okhttp3.internal.toImmutableList @Composable fun SearchRoute( + modifier: Modifier, navigateToSearchProcess: () -> Unit, navigateToIntern: (Long) -> Unit, viewModel: SearchViewModel = hiltViewModel(), @@ -72,6 +72,7 @@ fun SearchRoute( } SearchScreen( + modifier = modifier, searchViewsList = searchViewsList, searchScrapsList = searchScrapsList, navigateToSearchProcess = navigateToSearchProcess, @@ -94,66 +95,64 @@ fun SearchScreen( R.drawable.img_ad_3, ) - Scaffold( - modifier = modifier, - topBar = { - LogoTopAppBar() - } - ) { paddingValues -> - Column( + Column( + modifier = modifier + .fillMaxSize() + ) { + TerningImage( + painter = com.terning.core.R.drawable.ic_terning_logo_typo, modifier = Modifier - .fillMaxSize() - .padding(paddingValues) - ) { - Box( - modifier = Modifier - .padding( - horizontal = 24.dp, - vertical = 16.dp - ) - .noRippleClickable { - navigateToSearchProcess() - } - ) { - SearchTextField( - hint = stringResource(R.string.search_text_field_hint), - leftIcon = R.drawable.ic_nav_search, - modifier = Modifier.fillMaxWidth(), - enabled = false, - readOnly = true, + .padding(start = 24.dp, top = 16.dp) + ) + + Box( + modifier = Modifier + .padding( + horizontal = 24.dp, + vertical = 16.dp ) - } + .noRippleClickable { + navigateToSearchProcess() + } + ) { + SearchTextField( + hint = stringResource(R.string.search_text_field_hint), + leftIcon = R.drawable.ic_nav_search, + modifier = Modifier.fillMaxWidth(), + enabled = false, + readOnly = true, + ) + } - LazyColumn { - item { - ImageSlider(images = images) + LazyColumn { + item { + ImageSlider(images = images) - Spacer(modifier = Modifier.padding(8.dp)) + Spacer(modifier = Modifier.padding(8.dp)) - Text( - text = stringResource(id = R.string.search_today_popular), - modifier = Modifier.padding(horizontal = 24.dp, vertical = 4.dp), - style = TerningTheme.typography.title1, - color = Black - ) - SearchInternList( - type = InternListType.VIEW, - searchViewsList = searchViewsList, - searchScrapsList = searchScrapsList, - navigateToIntern = navigateToIntern, - ) - HorizontalDivider( - thickness = 4.dp, - modifier = Modifier.padding(vertical = 8.dp), - color = Grey100, - ) - SearchInternList( - type = InternListType.SCRAP, - searchViewsList = searchViewsList, - searchScrapsList = searchScrapsList, - navigateToIntern = navigateToIntern, - ) - } + Text( + text = stringResource(id = R.string.search_today_popular), + modifier = Modifier.padding(horizontal = 24.dp, vertical = 4.dp), + style = TerningTheme.typography.title1, + color = Black + ) + SearchInternList( + type = InternListType.VIEW, + searchViewsList = searchViewsList, + searchScrapsList = searchScrapsList, + navigateToIntern = navigateToIntern, + ) + HorizontalDivider( + thickness = 4.dp, + modifier = Modifier.padding(vertical = 8.dp), + color = Grey100, + ) + SearchInternList( + type = InternListType.SCRAP, + searchViewsList = searchViewsList, + searchScrapsList = searchScrapsList, + navigateToIntern = navigateToIntern, + ) } } } diff --git a/feature/src/main/java/com/terning/feature/search/search/navigation/SearchNavigation.kt b/feature/src/main/java/com/terning/feature/search/search/navigation/SearchNavigation.kt index 98a5a730d..5d3c71809 100644 --- a/feature/src/main/java/com/terning/feature/search/search/navigation/SearchNavigation.kt +++ b/feature/src/main/java/com/terning/feature/search/search/navigation/SearchNavigation.kt @@ -2,6 +2,9 @@ package com.terning.feature.search.search.navigation import androidx.compose.animation.EnterTransition import androidx.compose.animation.ExitTransition +import androidx.compose.foundation.layout.PaddingValues +import androidx.compose.foundation.layout.padding +import androidx.compose.ui.Modifier import androidx.navigation.NavController import androidx.navigation.NavGraphBuilder import androidx.navigation.NavHostController @@ -22,6 +25,7 @@ fun NavController.navigateSearch(navOptions: NavOptions? = null) { fun NavGraphBuilder.searchNavGraph( navHostController: NavHostController, + paddingValues: PaddingValues, ) { composable( exitTransition = { @@ -38,6 +42,7 @@ fun NavGraphBuilder.searchNavGraph( } ) { SearchRoute( + modifier = Modifier.padding(paddingValues), navigateToSearchProcess = { navHostController.navigateSearchProcess() }, navigateToIntern = { announcementId -> navHostController.navigateIntern(announcementId) } ) diff --git a/feature/src/main/java/com/terning/feature/search/searchprocess/navigation/SearchProcessNavigation.kt b/feature/src/main/java/com/terning/feature/search/searchprocess/navigation/SearchProcessNavigation.kt index c5355f915..34586890a 100644 --- a/feature/src/main/java/com/terning/feature/search/searchprocess/navigation/SearchProcessNavigation.kt +++ b/feature/src/main/java/com/terning/feature/search/searchprocess/navigation/SearchProcessNavigation.kt @@ -2,6 +2,7 @@ package com.terning.feature.search.searchprocess.navigation import androidx.compose.animation.EnterTransition import androidx.compose.animation.ExitTransition +import androidx.compose.foundation.layout.PaddingValues import androidx.navigation.NavController import androidx.navigation.NavGraphBuilder import androidx.navigation.NavHostController @@ -20,6 +21,7 @@ fun NavController.navigateSearchProcess(navOptions: NavOptions? = null) { fun NavGraphBuilder.searchProcessNavGraph( navHostController: NavHostController, + paddingValues: PaddingValues ) { composable( exitTransition = { From 928827e6f9b683188e949c275bb411e4a2f961b6 Mon Sep 17 00:00:00 2001 From: arinming Date: Mon, 9 Sep 2024 22:01:18 +0900 Subject: [PATCH 2/6] =?UTF-8?q?[FEAT/#229]=20=EA=B2=80=EC=83=89=20?= =?UTF-8?q?=EC=A7=84=ED=96=89=20=ED=99=94=EB=A9=B4=20=ED=8C=A8=EB=94=A9=20?= =?UTF-8?q?=EA=B0=92=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../searchprocess/SearchProcessRoute.kt | 434 +++++++++--------- .../navigation/SearchProcessNavigation.kt | 5 +- 2 files changed, 219 insertions(+), 220 deletions(-) diff --git a/feature/src/main/java/com/terning/feature/search/searchprocess/SearchProcessRoute.kt b/feature/src/main/java/com/terning/feature/search/searchprocess/SearchProcessRoute.kt index 9d6e7f446..5d674ab0b 100644 --- a/feature/src/main/java/com/terning/feature/search/searchprocess/SearchProcessRoute.kt +++ b/feature/src/main/java/com/terning/feature/search/searchprocess/SearchProcessRoute.kt @@ -11,7 +11,6 @@ import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.wrapContentWidth import androidx.compose.foundation.lazy.LazyColumn -import androidx.compose.material3.Scaffold import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect @@ -70,6 +69,7 @@ private const val MAX_LINES = 1 @Composable fun SearchProcessRoute( + modifier: Modifier, navController: NavHostController, viewModel: SearchProcessViewModel = hiltViewModel(), ) { @@ -94,6 +94,7 @@ fun SearchProcessRoute( } SearchProcessScreen( + modifier = modifier, navController = navController, currentSortBy = currentSortBy, viewModel = viewModel, @@ -111,7 +112,7 @@ fun SearchProcessScreen( var sheetState by remember { mutableStateOf(false) } val internSearchResultData by viewModel.internSearchResultData.collectAsStateWithLifecycle() val dialogState by viewModel.dialogState.collectAsStateWithLifecycle() - val selectedInternIndex = remember { mutableStateOf(-1) } + val selectedInternIndex = remember { mutableIntStateOf(-1) } val focusRequester = remember { FocusRequester() } val focusManager = LocalFocusManager.current @@ -128,255 +129,250 @@ fun SearchProcessScreen( size = 10 ) } - - Scaffold( - modifier = modifier, - topBar = { - BackButtonTopAppBar( - title = stringResource( - id = - if (state.showSearchResults) R.string.search_process_result_top_bar_title - else R.string.search_process_top_bar_title - ), - onBackButtonClick = { navController.navigateUp() }, - modifier = Modifier - ) - } - ) { paddingValues -> - Column( + Column( + modifier = modifier + .fillMaxSize() + .addFocusCleaner(focusManager), + ) { + BackButtonTopAppBar( + title = stringResource( + id = + if (state.showSearchResults) R.string.search_process_result_top_bar_title + else R.string.search_process_top_bar_title + ), + onBackButtonClick = { navController.navigateUp() }, modifier = Modifier - .fillMaxSize() - .padding(paddingValues) - .addFocusCleaner(focusManager), + ) + Column( + modifier = modifier + .padding(horizontal = 24.dp) ) { - Column( - modifier = modifier - .padding(horizontal = 24.dp) - ) { - if (!state.showSearchResults) { - Text( - text = stringResource(id = R.string.search_process_question_text), - style = TerningTheme.typography.heading2, - color = Black, - modifier = Modifier.padding( - vertical = 16.dp - ) + if (!state.showSearchResults) { + Text( + text = stringResource(id = R.string.search_process_question_text), + style = TerningTheme.typography.heading2, + color = Black, + modifier = Modifier.padding( + vertical = 16.dp + ) + ) + } + + SearchTextField( + text = state.text, + onValueChange = { newText -> + viewModel.updateText(newText) + }, + hint = stringResource(R.string.search_text_field_hint), + leftIcon = R.drawable.ic_nav_search, + modifier = Modifier + .padding(top = 8.dp) + .focusRequester(focusRequester) + .addFocusCleaner(focusManager), + onSearchAction = { + viewModel.getSearchList( + keyword = state.text, + sortBy = SORT_BY, + page = 0, + size = 10 ) + viewModel.updateQuery(state.text) + viewModel.updateShowSearchResults(true) + viewModel.updateExistSearchResults(state.text) } + ) - SearchTextField( - text = state.text, - onValueChange = { newText -> - viewModel.updateText(newText) - }, - hint = stringResource(R.string.search_text_field_hint), - leftIcon = R.drawable.ic_nav_search, + if (state.showSearchResults) { + Column( modifier = Modifier - .padding(top = 8.dp) - .focusRequester(focusRequester) - .addFocusCleaner(focusManager), - onSearchAction = { - viewModel.getSearchList( - keyword = state.text, - sortBy = SORT_BY, - page = 0, - size = 10 - ) - viewModel.updateQuery(state.text) - viewModel.updateShowSearchResults(true) - viewModel.updateExistSearchResults(state.text) - } - ) - - if (state.showSearchResults) { - Column( - modifier = Modifier - .fillMaxWidth(), - horizontalAlignment = Alignment.CenterHorizontally, - verticalArrangement = Arrangement.Center - ) { - if (internSearchResultData.isNotEmpty()) { - LazyColumn( - contentPadding = PaddingValues( - top = 12.dp, - bottom = 20.dp, - ), - verticalArrangement = Arrangement.spacedBy(12.dp) - ) { - items(viewModel.internSearchResultData.value.size) { index -> - InternItemWithShadow( - modifier = modifier.noRippleClickable { - navController.navigateIntern( - announcementId = internSearchResultData[index] - .internshipAnnouncementId - ) - }, - imageUrl = internSearchResultData[index].companyImage, - title = internSearchResultData[index].title, - dateDeadline = internSearchResultData[index].dDay, - workingPeriod = internSearchResultData[index].workingPeriod, - isScrapped = internSearchResultData[index].scrapId != null, - shadowWidth = 2.dp, - shadowRadius = 10.dp, - onScrapButtonClicked = { - viewModel.updateScrapDialogVisible(true) - viewModel.updateScrapped(scrapped = internSearchResultData[index].scrapId != null) - selectedInternIndex.value = index - } - ) - } + .fillMaxWidth(), + horizontalAlignment = Alignment.CenterHorizontally, + verticalArrangement = Arrangement.Center + ) { + if (internSearchResultData.isNotEmpty()) { + LazyColumn( + contentPadding = PaddingValues( + top = 12.dp, + bottom = 20.dp, + ), + verticalArrangement = Arrangement.spacedBy(12.dp) + ) { + items(viewModel.internSearchResultData.value.size) { index -> + InternItemWithShadow( + modifier = modifier.noRippleClickable { + navController.navigateIntern( + announcementId = internSearchResultData[index] + .internshipAnnouncementId + ) + }, + imageUrl = internSearchResultData[index].companyImage, + title = internSearchResultData[index].title, + dateDeadline = internSearchResultData[index].dDay, + workingPeriod = internSearchResultData[index].workingPeriod, + isScrapped = internSearchResultData[index].scrapId != null, + shadowWidth = 2.dp, + shadowRadius = 10.dp, + onScrapButtonClicked = { + viewModel.updateScrapDialogVisible(true) + viewModel.updateScrapped(scrapped = internSearchResultData[index].scrapId != null) + selectedInternIndex.value = index + } + ) } - } else { - Spacer( - modifier = Modifier.padding(top = 87.dp) + } + } else { + Spacer( + modifier = Modifier.padding(top = 87.dp) + ) + Image( + painter = painterResource( + id = R.drawable.ic_empty_logo + ), + contentDescription = stringResource( + id = R.string.search_process_no_result_icon ) - Image( - painter = painterResource( - id = R.drawable.ic_empty_logo - ), - contentDescription = stringResource( - id = R.string.search_process_no_result_icon + ) + Row( + modifier = Modifier + .padding( + top = 16.dp, + bottom = 6.dp ) + .fillMaxWidth(), + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.Center + ) { + Text( + text = state.keyword, + style = TerningTheme.typography.body1, + color = TerningMain, + maxLines = MAX_LINES, + overflow = TextOverflow.Ellipsis, + modifier = Modifier.weight(1f, false) ) - Row( - modifier = Modifier - .padding( - top = 16.dp, - bottom = 6.dp - ) - .fillMaxWidth(), - verticalAlignment = Alignment.CenterVertically, - horizontalArrangement = Arrangement.Center - ) { - Text( - text = state.keyword, - style = TerningTheme.typography.body1, - color = TerningMain, - maxLines = MAX_LINES, - overflow = TextOverflow.Ellipsis, - modifier = Modifier.weight(1f, false) - ) - Text( - text = stringResource(id = R.string.search_process_no_result_text_sub), - style = TerningTheme.typography.body1, - color = Grey400, - modifier = Modifier.wrapContentWidth() - ) - } Text( - text = stringResource( - id = R.string.search_process_no_result_text_main - ), + text = stringResource(id = R.string.search_process_no_result_text_sub), style = TerningTheme.typography.body1, color = Grey400, + modifier = Modifier.wrapContentWidth() ) } + Text( + text = stringResource( + id = R.string.search_process_no_result_text_main + ), + style = TerningTheme.typography.body1, + color = Grey400, + ) } } } - if (!state.showSearchResults) { - Image( - painter = painterResource(id = R.drawable.ic_search_backgroud), - contentDescription = null, - contentScale = ContentScale.FillWidth, - modifier = modifier.fillMaxSize() - ) - } } - } + if (!state.showSearchResults) { + Image( + painter = painterResource(id = R.drawable.ic_search_backgroud), + contentDescription = null, + contentScale = ContentScale.FillWidth, + modifier = modifier.fillMaxSize() + ) + } - if (dialogState.isScrapDialogVisible) { - TerningBasicDialog( - onDismissRequest = { viewModel.updateScrapDialogVisible(false) }, - content = { - val selectedIndex = selectedInternIndex.value - if (selectedIndex != -1) { - val selectedIntern = internSearchResultData[selectedIndex] - if (selectedIntern.scrapId != null) { - ScrapCancelDialogContent( - onClickScrapCancel = { - viewModel.updateScrapDialogVisible(false) - viewModel.deleteScrap( - internSearchResultData[selectedIndex].scrapId ?: -1, - ) - if (dialogState.isScrappedState) { - viewModel.getSearchList( - keyword = state.text, - sortBy = SORT_BY, - page = 0, - size = 10 + if (dialogState.isScrapDialogVisible) { + TerningBasicDialog( + onDismissRequest = { viewModel.updateScrapDialogVisible(false) }, + content = { + val selectedIndex = selectedInternIndex.value + if (selectedIndex != -1) { + val selectedIntern = internSearchResultData[selectedIndex] + if (selectedIntern.scrapId != null) { + ScrapCancelDialogContent( + onClickScrapCancel = { + viewModel.updateScrapDialogVisible(false) + viewModel.deleteScrap( + internSearchResultData[selectedIndex].scrapId ?: -1, ) - viewModel.updateScrapped(false) + if (dialogState.isScrappedState) { + viewModel.getSearchList( + keyword = state.text, + sortBy = SORT_BY, + page = 0, + size = 10 + ) + viewModel.updateScrapped(false) + } + viewModel.updateSelectColor(CalRed) } - viewModel.updateSelectColor(CalRed) - } - ) - } else { - val colorList = listOf( - CalRed, - CalOrange1, - CalOrange2, - CalYellow, - CalGreen1, - CalGreen2, - CalBlue1, - CalBlue2, - CalPurple, - CalPink, - ) + ) + } else { + val colorList = listOf( + CalRed, + CalOrange1, + CalOrange2, + CalYellow, + CalGreen1, + CalGreen2, + CalBlue1, + CalBlue2, + CalPurple, + CalPink, + ) - val selectedColorIndex = - colorList.indexOf(dialogState.selectedColor).takeIf { it >= 0 } ?: 0 + val selectedColorIndex = + colorList.indexOf(dialogState.selectedColor).takeIf { it >= 0 } ?: 0 - with(selectedIntern) { - HomeRecommendInternDialog( - internInfoList = listOf( - stringResource(id = R.string.intern_info_d_day) to deadline, - stringResource(id = R.string.intern_info_working) to workingPeriod, - stringResource(id = R.string.intern_info_start_date) to startYearMonth, - ), - clickAction = { - if (dialogState.isPaletteOpen) { - viewModel.updatePaletteOpen(false) - viewModel.postScrap( - internshipAnnouncementId = internshipAnnouncementId, - selectedColorIndex, - ) - viewModel.updateColorChange(false) - viewModel.updateScrapDialogVisible(false) - } else { - if (dialogState.isColorChange) { + with(selectedIntern) { + HomeRecommendInternDialog( + internInfoList = listOf( + stringResource(id = R.string.intern_info_d_day) to deadline, + stringResource(id = R.string.intern_info_working) to workingPeriod, + stringResource(id = R.string.intern_info_start_date) to startYearMonth, + ), + clickAction = { + if (dialogState.isPaletteOpen) { + viewModel.updatePaletteOpen(false) viewModel.postScrap( - internshipAnnouncementId, - selectedColorIndex + internshipAnnouncementId = internshipAnnouncementId, + selectedColorIndex, ) viewModel.updateColorChange(false) + viewModel.updateScrapDialogVisible(false) } else { - viewModel.postScrap(internshipAnnouncementId, colorList.indexOf(dialogState.selectedColor)) + if (dialogState.isColorChange) { + viewModel.postScrap( + internshipAnnouncementId, + selectedColorIndex + ) + viewModel.updateColorChange(false) + } else { + viewModel.postScrap( + internshipAnnouncementId, + colorList.indexOf(dialogState.selectedColor) + ) + } + viewModel.updateScrapDialogVisible(false) } - viewModel.updateScrapDialogVisible(false) - } - }, - onColorSelected = { newColor -> - viewModel.updateSelectColor(newColor) - }, - homeRecommendIntern = HomeRecommendIntern( - scrapId = scrapId, - internshipAnnouncementId = internshipAnnouncementId, - companyImage = companyImage, - title = title, - deadline = deadline, - workingPeriod = workingPeriod, - startYearMonth = startYearMonth, - isScrapped = scrapId != null, - dDay = dDay - ), - ) + }, + onColorSelected = { newColor -> + viewModel.updateSelectColor(newColor) + }, + homeRecommendIntern = HomeRecommendIntern( + scrapId = scrapId, + internshipAnnouncementId = internshipAnnouncementId, + companyImage = companyImage, + title = title, + deadline = deadline, + workingPeriod = workingPeriod, + startYearMonth = startYearMonth, + isScrapped = scrapId != null, + dDay = dDay + ), + ) + } } } } - } - ) + ) + } } } diff --git a/feature/src/main/java/com/terning/feature/search/searchprocess/navigation/SearchProcessNavigation.kt b/feature/src/main/java/com/terning/feature/search/searchprocess/navigation/SearchProcessNavigation.kt index 34586890a..e2dda0732 100644 --- a/feature/src/main/java/com/terning/feature/search/searchprocess/navigation/SearchProcessNavigation.kt +++ b/feature/src/main/java/com/terning/feature/search/searchprocess/navigation/SearchProcessNavigation.kt @@ -3,6 +3,8 @@ package com.terning.feature.search.searchprocess.navigation import androidx.compose.animation.EnterTransition import androidx.compose.animation.ExitTransition import androidx.compose.foundation.layout.PaddingValues +import androidx.compose.foundation.layout.padding +import androidx.compose.ui.Modifier import androidx.navigation.NavController import androidx.navigation.NavGraphBuilder import androidx.navigation.NavHostController @@ -38,7 +40,8 @@ fun NavGraphBuilder.searchProcessNavGraph( } ) { SearchProcessRoute( - navController = navHostController + modifier = Modifier.padding(paddingValues), + navController = navHostController, ) } } From f5d82cd3e85abfdc92669659a419ec034ccda37e Mon Sep 17 00:00:00 2001 From: arinming Date: Tue, 10 Sep 2024 01:00:20 +0900 Subject: [PATCH 3/6] =?UTF-8?q?[FEAT/#229]=20=EA=B2=80=EC=83=89=20?= =?UTF-8?q?=EC=A0=84=20=ED=99=94=EB=A9=B4=20UI=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../textfield/TerningBasicTextField.kt | 2 +- .../searchprocess/SearchProcessRoute.kt | 28 +-- .../src/main/res/drawable/ic_search_18.xml | 13 + .../main/res/drawable/ic_search_backgroud.xml | 238 ------------------ .../src/main/res/drawable/ic_search_bg.xml | 200 --------------- .../src/main/res/drawable/ic_search_empty.xml | 47 ++++ 6 files changed, 69 insertions(+), 459 deletions(-) create mode 100644 feature/src/main/res/drawable/ic_search_18.xml delete mode 100644 feature/src/main/res/drawable/ic_search_backgroud.xml delete mode 100644 feature/src/main/res/drawable/ic_search_bg.xml create mode 100644 feature/src/main/res/drawable/ic_search_empty.xml diff --git a/core/src/main/java/com/terning/core/designsystem/component/textfield/TerningBasicTextField.kt b/core/src/main/java/com/terning/core/designsystem/component/textfield/TerningBasicTextField.kt index 0e8bd9667..f61ee5b81 100644 --- a/core/src/main/java/com/terning/core/designsystem/component/textfield/TerningBasicTextField.kt +++ b/core/src/main/java/com/terning/core/designsystem/component/textfield/TerningBasicTextField.kt @@ -98,7 +98,7 @@ fun TerningBasicTextField( decorationBox = { innerTextField -> Row( verticalAlignment = Alignment.CenterVertically, - horizontalArrangement = Arrangement.spacedBy(12.dp), + horizontalArrangement = Arrangement.spacedBy(8.dp), modifier = Modifier.padding(vertical = 8.dp) ) { leftIcon?.let { diff --git a/feature/src/main/java/com/terning/feature/search/searchprocess/SearchProcessRoute.kt b/feature/src/main/java/com/terning/feature/search/searchprocess/SearchProcessRoute.kt index 5d674ab0b..e9f5dc351 100644 --- a/feature/src/main/java/com/terning/feature/search/searchprocess/SearchProcessRoute.kt +++ b/feature/src/main/java/com/terning/feature/search/searchprocess/SearchProcessRoute.kt @@ -24,7 +24,6 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.focus.FocusRequester import androidx.compose.ui.focus.focusRequester -import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalFocusManager import androidx.compose.ui.res.painterResource @@ -42,7 +41,6 @@ import com.terning.core.designsystem.component.dialog.TerningBasicDialog import com.terning.core.designsystem.component.item.InternItemWithShadow import com.terning.core.designsystem.component.textfield.SearchTextField import com.terning.core.designsystem.component.topappbar.BackButtonTopAppBar -import com.terning.core.designsystem.theme.Black import com.terning.core.designsystem.theme.CalBlue1 import com.terning.core.designsystem.theme.CalBlue2 import com.terning.core.designsystem.theme.CalGreen1 @@ -54,6 +52,7 @@ import com.terning.core.designsystem.theme.CalPurple import com.terning.core.designsystem.theme.CalRed import com.terning.core.designsystem.theme.CalYellow import com.terning.core.designsystem.theme.Grey400 +import com.terning.core.designsystem.theme.Grey500 import com.terning.core.designsystem.theme.TerningMain import com.terning.core.designsystem.theme.TerningPointTheme import com.terning.core.designsystem.theme.TerningTheme @@ -144,17 +143,15 @@ fun SearchProcessScreen( modifier = Modifier ) Column( - modifier = modifier + modifier = Modifier .padding(horizontal = 24.dp) ) { if (!state.showSearchResults) { Text( text = stringResource(id = R.string.search_process_question_text), style = TerningTheme.typography.heading2, - color = Black, - modifier = Modifier.padding( - vertical = 16.dp - ) + color = Grey500, + modifier = Modifier.padding(bottom = 17.dp) ) } @@ -164,9 +161,8 @@ fun SearchProcessScreen( viewModel.updateText(newText) }, hint = stringResource(R.string.search_text_field_hint), - leftIcon = R.drawable.ic_nav_search, + leftIcon = R.drawable.ic_search_18, modifier = Modifier - .padding(top = 8.dp) .focusRequester(focusRequester) .addFocusCleaner(focusManager), onSearchAction = { @@ -199,7 +195,7 @@ fun SearchProcessScreen( ) { items(viewModel.internSearchResultData.value.size) { index -> InternItemWithShadow( - modifier = modifier.noRippleClickable { + modifier = Modifier.noRippleClickable { navController.navigateIntern( announcementId = internSearchResultData[index] .internshipAnnouncementId @@ -215,7 +211,7 @@ fun SearchProcessScreen( onScrapButtonClicked = { viewModel.updateScrapDialogVisible(true) viewModel.updateScrapped(scrapped = internSearchResultData[index].scrapId != null) - selectedInternIndex.value = index + selectedInternIndex.intValue = index } ) } @@ -226,7 +222,7 @@ fun SearchProcessScreen( ) Image( painter = painterResource( - id = R.drawable.ic_empty_logo + id = R.drawable.ic_home_scrap_empty ), contentDescription = stringResource( id = R.string.search_process_no_result_icon @@ -268,14 +264,6 @@ fun SearchProcessScreen( } } } - if (!state.showSearchResults) { - Image( - painter = painterResource(id = R.drawable.ic_search_backgroud), - contentDescription = null, - contentScale = ContentScale.FillWidth, - modifier = modifier.fillMaxSize() - ) - } if (dialogState.isScrapDialogVisible) { TerningBasicDialog( diff --git a/feature/src/main/res/drawable/ic_search_18.xml b/feature/src/main/res/drawable/ic_search_18.xml new file mode 100644 index 000000000..9700e7a17 --- /dev/null +++ b/feature/src/main/res/drawable/ic_search_18.xml @@ -0,0 +1,13 @@ + + + diff --git a/feature/src/main/res/drawable/ic_search_backgroud.xml b/feature/src/main/res/drawable/ic_search_backgroud.xml deleted file mode 100644 index 7369643f9..000000000 --- a/feature/src/main/res/drawable/ic_search_backgroud.xml +++ /dev/null @@ -1,238 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/feature/src/main/res/drawable/ic_search_bg.xml b/feature/src/main/res/drawable/ic_search_bg.xml deleted file mode 100644 index 614b68a24..000000000 --- a/feature/src/main/res/drawable/ic_search_bg.xml +++ /dev/null @@ -1,200 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/feature/src/main/res/drawable/ic_search_empty.xml b/feature/src/main/res/drawable/ic_search_empty.xml new file mode 100644 index 000000000..32218db54 --- /dev/null +++ b/feature/src/main/res/drawable/ic_search_empty.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + From 7a913f28601da5b0416fba2e40b627fbc3868960 Mon Sep 17 00:00:00 2001 From: arinming Date: Tue, 10 Sep 2024 02:05:35 +0900 Subject: [PATCH 4/6] =?UTF-8?q?[FEAT/#229]=20=EA=B2=80=EC=83=89=20?= =?UTF-8?q?=ED=9B=84=20=ED=99=94=EB=A9=B4=20UI=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../searchprocess/SearchProcessRoute.kt | 165 ++++++++---------- .../searchprocess/SearchProcessViewModel.kt | 64 +------ .../searchprocess/models/SearchDialogState.kt | 2 - feature/src/main/res/values/strings.xml | 2 + 4 files changed, 74 insertions(+), 159 deletions(-) diff --git a/feature/src/main/java/com/terning/feature/search/searchprocess/SearchProcessRoute.kt b/feature/src/main/java/com/terning/feature/search/searchprocess/SearchProcessRoute.kt index e9f5dc351..bc7c0e692 100644 --- a/feature/src/main/java/com/terning/feature/search/searchprocess/SearchProcessRoute.kt +++ b/feature/src/main/java/com/terning/feature/search/searchprocess/SearchProcessRoute.kt @@ -36,21 +36,12 @@ import androidx.lifecycle.compose.LocalLifecycleOwner import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.flowWithLifecycle import androidx.navigation.NavHostController -import com.terning.core.designsystem.component.dialog.ScrapCancelDialogContent +import com.terning.core.designsystem.component.button.SortingButton import com.terning.core.designsystem.component.dialog.TerningBasicDialog import com.terning.core.designsystem.component.item.InternItemWithShadow import com.terning.core.designsystem.component.textfield.SearchTextField import com.terning.core.designsystem.component.topappbar.BackButtonTopAppBar -import com.terning.core.designsystem.theme.CalBlue1 -import com.terning.core.designsystem.theme.CalBlue2 -import com.terning.core.designsystem.theme.CalGreen1 -import com.terning.core.designsystem.theme.CalGreen2 -import com.terning.core.designsystem.theme.CalOrange1 -import com.terning.core.designsystem.theme.CalOrange2 -import com.terning.core.designsystem.theme.CalPink -import com.terning.core.designsystem.theme.CalPurple import com.terning.core.designsystem.theme.CalRed -import com.terning.core.designsystem.theme.CalYellow import com.terning.core.designsystem.theme.Grey400 import com.terning.core.designsystem.theme.Grey500 import com.terning.core.designsystem.theme.TerningMain @@ -59,9 +50,10 @@ import com.terning.core.designsystem.theme.TerningTheme import com.terning.core.extension.addFocusCleaner import com.terning.core.extension.noRippleClickable import com.terning.core.extension.toast -import com.terning.domain.entity.home.HomeRecommendIntern +import com.terning.domain.entity.response.InternInfoModel import com.terning.feature.R -import com.terning.feature.home.home.component.HomeRecommendInternDialog +import com.terning.feature.dialog.cancel.ScrapCancelDialog +import com.terning.feature.dialog.detail.ScrapDialog import com.terning.feature.intern.navigation.navigateIntern private const val MAX_LINES = 1 @@ -97,6 +89,16 @@ fun SearchProcessRoute( navController = navController, currentSortBy = currentSortBy, viewModel = viewModel, + onDismissCancelDialog = { + viewModel.updateScrapDialogVisible(false) + }, + onDismissScrapDialog = { viewModel.updateScrapDialogVisible(false) }, + onClickCancelButton = { + viewModel.updateScrapDialogVisible(true) + }, + onClickScrapButton = { + viewModel.updateScrapDialogVisible(true) + } ) } @@ -106,6 +108,10 @@ fun SearchProcessScreen( modifier: Modifier = Modifier, navController: NavHostController, viewModel: SearchProcessViewModel = hiltViewModel(), + onDismissCancelDialog: (Boolean) -> Unit, + onDismissScrapDialog: () -> Unit, + onClickCancelButton: (Long) -> Unit, + onClickScrapButton: (InternInfoModel) -> Unit, ) { val state by viewModel.state.collectAsStateWithLifecycle() var sheetState by remember { mutableStateOf(false) } @@ -128,6 +134,7 @@ fun SearchProcessScreen( size = 10 ) } + Column( modifier = modifier .fillMaxSize() @@ -151,7 +158,10 @@ fun SearchProcessScreen( text = stringResource(id = R.string.search_process_question_text), style = TerningTheme.typography.heading2, color = Grey500, - modifier = Modifier.padding(bottom = 17.dp) + modifier = Modifier.padding( + top = 14.dp, + bottom = 17.dp + ) ) } @@ -185,6 +195,36 @@ fun SearchProcessScreen( horizontalAlignment = Alignment.CenterHorizontally, verticalArrangement = Arrangement.Center ) { + Row( + horizontalArrangement = Arrangement.SpaceBetween, + verticalAlignment = Alignment.CenterVertically, + modifier = Modifier + .fillMaxWidth() + ) { + Row { + Text( + text = stringResource(id = R.string.home_recommend_total), + style = TerningTheme.typography.detail1, + color = Grey400, + ) + Text( + text = internSearchResultData.size.toString(), + style = TerningTheme.typography.button3, + color = TerningMain, + ) + Text( + text = stringResource(id = R.string.home_recommend_count), + style = TerningTheme.typography.detail1, + color = Grey400, + ) + } + Row { + SortingButton( + sortBy = currentSortBy.value, + onCLick = { sheetState = true }, + ) + } + } if (internSearchResultData.isNotEmpty()) { LazyColumn( contentPadding = PaddingValues( @@ -210,7 +250,9 @@ fun SearchProcessScreen( shadowRadius = 10.dp, onScrapButtonClicked = { viewModel.updateScrapDialogVisible(true) - viewModel.updateScrapped(scrapped = internSearchResultData[index].scrapId != null) + viewModel.updateScrapped( + scrapped = internSearchResultData[index].scrapId != null + ) selectedInternIndex.intValue = index } ) @@ -273,89 +315,24 @@ fun SearchProcessScreen( if (selectedIndex != -1) { val selectedIntern = internSearchResultData[selectedIndex] if (selectedIntern.scrapId != null) { - ScrapCancelDialogContent( - onClickScrapCancel = { - viewModel.updateScrapDialogVisible(false) - viewModel.deleteScrap( - internSearchResultData[selectedIndex].scrapId ?: -1, - ) - if (dialogState.isScrappedState) { - viewModel.getSearchList( - keyword = state.text, - sortBy = SORT_BY, - page = 0, - size = 10 - ) - viewModel.updateScrapped(false) - } - viewModel.updateSelectColor(CalRed) - } + ScrapCancelDialog( + internshipAnnouncementId = selectedIntern.internshipAnnouncementId, + onDismissRequest = onDismissCancelDialog ) } else { - val colorList = listOf( - CalRed, - CalOrange1, - CalOrange2, - CalYellow, - CalGreen1, - CalGreen2, - CalBlue1, - CalBlue2, - CalPurple, - CalPink, + ScrapDialog( + title = selectedIntern.title, + scrapColor = CalRed, + deadline = selectedIntern.deadline, + startYearMonth = selectedIntern.startYearMonth, + workingPeriod = selectedIntern.workingPeriod, + internshipAnnouncementId = selectedIntern.internshipAnnouncementId, + companyImage = selectedIntern.companyImage, + isScrapped = false, + onDismissRequest = onDismissScrapDialog, + onClickChangeColor = { }, + onClickNavigateButton = { } ) - - val selectedColorIndex = - colorList.indexOf(dialogState.selectedColor).takeIf { it >= 0 } ?: 0 - - with(selectedIntern) { - HomeRecommendInternDialog( - internInfoList = listOf( - stringResource(id = R.string.intern_info_d_day) to deadline, - stringResource(id = R.string.intern_info_working) to workingPeriod, - stringResource(id = R.string.intern_info_start_date) to startYearMonth, - ), - clickAction = { - if (dialogState.isPaletteOpen) { - viewModel.updatePaletteOpen(false) - viewModel.postScrap( - internshipAnnouncementId = internshipAnnouncementId, - selectedColorIndex, - ) - viewModel.updateColorChange(false) - viewModel.updateScrapDialogVisible(false) - } else { - if (dialogState.isColorChange) { - viewModel.postScrap( - internshipAnnouncementId, - selectedColorIndex - ) - viewModel.updateColorChange(false) - } else { - viewModel.postScrap( - internshipAnnouncementId, - colorList.indexOf(dialogState.selectedColor) - ) - } - viewModel.updateScrapDialogVisible(false) - } - }, - onColorSelected = { newColor -> - viewModel.updateSelectColor(newColor) - }, - homeRecommendIntern = HomeRecommendIntern( - scrapId = scrapId, - internshipAnnouncementId = internshipAnnouncementId, - companyImage = companyImage, - title = title, - deadline = deadline, - workingPeriod = workingPeriod, - startYearMonth = startYearMonth, - isScrapped = scrapId != null, - dDay = dDay - ), - ) - } } } } diff --git a/feature/src/main/java/com/terning/feature/search/searchprocess/SearchProcessViewModel.kt b/feature/src/main/java/com/terning/feature/search/searchprocess/SearchProcessViewModel.kt index 8f8028280..bb8b7eae3 100644 --- a/feature/src/main/java/com/terning/feature/search/searchprocess/SearchProcessViewModel.kt +++ b/feature/src/main/java/com/terning/feature/search/searchprocess/SearchProcessViewModel.kt @@ -4,6 +4,7 @@ import androidx.compose.ui.graphics.Color import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import com.terning.domain.entity.calendar.CalendarScrapRequest +import com.terning.domain.entity.response.InternInfoModel import com.terning.domain.entity.search.SearchResult import com.terning.domain.repository.ScrapRepository import com.terning.domain.repository.SearchRepository @@ -62,51 +63,6 @@ class SearchProcessViewModel @Inject constructor( } } - - fun postScrap( - internshipAnnouncementId: Long, - colorIndex: Int, - ) { - viewModelScope.launch { - scrapRepository.postScrap( - CalendarScrapRequest( - id = internshipAnnouncementId, - color = colorIndex, - ) - ).onSuccess { - updateScrapDialogVisible(visible = false) - getSearchList( - keyword = _state.value.text, - sortBy = SORT_BY, - page = 0, - size = 10 - ) - _sideEffect.emit(SearchProcessSideEffect.Toast(R.string.intern_scrap_add_toast_message)) - }.onFailure { - _sideEffect.emit(SearchProcessSideEffect.Toast(R.string.server_failure)) - } - } - } - - fun deleteScrap(scrapId: Long) { - viewModelScope.launch { - scrapRepository.deleteScrap( - CalendarScrapRequest(id = scrapId) - ).onSuccess { - updateScrapDialogVisible(visible = false) - getSearchList( - keyword = _state.value.text, - sortBy = SORT_BY, - page = 0, - size = 10 - ) - _sideEffect.emit(SearchProcessSideEffect.Toast(R.string.intern_scrap_delete_toast_message)) - }.onFailure { - _sideEffect.emit(SearchProcessSideEffect.Toast(R.string.server_failure)) - } - } - } - fun updateText(newText: String) { _state.value = _state.value.copy(text = newText) } @@ -126,12 +82,6 @@ class SearchProcessViewModel @Inject constructor( _state.value = _state.value.copy(existSearchResults = exist) } - fun updateSelectColor(newColor: Color) { - _dialogState.update { - it.copy(selectedColor = newColor) - } - } - fun updateScrapDialogVisible(visible: Boolean) { _dialogState.update { it.copy(isScrapDialogVisible = visible) @@ -144,18 +94,6 @@ class SearchProcessViewModel @Inject constructor( } } - fun updatePaletteOpen(open: Boolean) { - _dialogState.update { - it.copy(isPaletteOpen = open) - } - } - - fun updateColorChange(change: Boolean) { - _dialogState.update { - it.copy(isColorChange = change) - } - } - companion object { private const val SORT_BY = "deadlineSoon" } diff --git a/feature/src/main/java/com/terning/feature/search/searchprocess/models/SearchDialogState.kt b/feature/src/main/java/com/terning/feature/search/searchprocess/models/SearchDialogState.kt index 54b86a329..aa78113d9 100644 --- a/feature/src/main/java/com/terning/feature/search/searchprocess/models/SearchDialogState.kt +++ b/feature/src/main/java/com/terning/feature/search/searchprocess/models/SearchDialogState.kt @@ -4,8 +4,6 @@ import androidx.compose.ui.graphics.Color import com.terning.core.designsystem.theme.CalRed data class SearchDialogState( - val isColorChange: Boolean = false, - val isPaletteOpen: Boolean = false, val selectedColor: Color = CalRed, val isScrapDialogVisible: Boolean = false, val scrapped: Boolean = false, diff --git a/feature/src/main/res/values/strings.xml b/feature/src/main/res/values/strings.xml index 60d721208..4725433dc 100644 --- a/feature/src/main/res/values/strings.xml +++ b/feature/src/main/res/values/strings.xml @@ -90,6 +90,8 @@ - 오늘 마감인 공고가 없어요 + + 개의 공고가 있어요 터치 3번으로\n원하는 대학생 인턴 공고를 띄워드릴게요 From 2ab5ac6f694b6738a8f9c1fd51568a434aeebf98 Mon Sep 17 00:00:00 2001 From: arinming Date: Tue, 10 Sep 2024 02:13:23 +0900 Subject: [PATCH 5/6] =?UTF-8?q?[FEAT/#229]=20=EA=B2=80=EC=83=89=20?= =?UTF-8?q?=EA=B2=B0=EA=B3=BC=20=EC=97=86=EB=8A=94=20=ED=99=94=EB=A9=B4=20?= =?UTF-8?q?UI=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../search/searchprocess/SearchProcessRoute.kt | 11 ++++++----- feature/src/main/res/values/strings.xml | 2 ++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/feature/src/main/java/com/terning/feature/search/searchprocess/SearchProcessRoute.kt b/feature/src/main/java/com/terning/feature/search/searchprocess/SearchProcessRoute.kt index bc7c0e692..a9db28632 100644 --- a/feature/src/main/java/com/terning/feature/search/searchprocess/SearchProcessRoute.kt +++ b/feature/src/main/java/com/terning/feature/search/searchprocess/SearchProcessRoute.kt @@ -203,17 +203,18 @@ fun SearchProcessScreen( ) { Row { Text( - text = stringResource(id = R.string.home_recommend_total), + text = stringResource(id = R.string.search_process_total), style = TerningTheme.typography.detail1, color = Grey400, ) + Spacer(modifier = Modifier.padding(start = 3.dp)) Text( text = internSearchResultData.size.toString(), style = TerningTheme.typography.button3, color = TerningMain, ) Text( - text = stringResource(id = R.string.home_recommend_count), + text = stringResource(id = R.string.search_process_count), style = TerningTheme.typography.detail1, color = Grey400, ) @@ -260,11 +261,11 @@ fun SearchProcessScreen( } } else { Spacer( - modifier = Modifier.padding(top = 87.dp) + modifier = Modifier.padding(top = 40.dp) ) Image( painter = painterResource( - id = R.drawable.ic_home_scrap_empty + id = R.drawable.ic_home_empty_filtering ), contentDescription = stringResource( id = R.string.search_process_no_result_icon @@ -282,7 +283,7 @@ fun SearchProcessScreen( ) { Text( text = state.keyword, - style = TerningTheme.typography.body1, + style = TerningTheme.typography.title4, color = TerningMain, maxLines = MAX_LINES, overflow = TextOverflow.Ellipsis, diff --git a/feature/src/main/res/values/strings.xml b/feature/src/main/res/values/strings.xml index 4725433dc..1e6199a72 100644 --- a/feature/src/main/res/values/strings.xml +++ b/feature/src/main/res/values/strings.xml @@ -38,6 +38,8 @@ 검색 결과 없을 때 아이콘 해당하는 검색 결과가 없어요 + + 개의 공고가 있어요 From 8ed2b9501a535f800de7d7867f3398324dd5bfba Mon Sep 17 00:00:00 2001 From: arinming Date: Tue, 10 Sep 2024 02:25:44 +0900 Subject: [PATCH 6/6] =?UTF-8?q?[FEAT/#229]=20=EA=B2=80=EC=83=89=20?= =?UTF-8?q?=EA=B8=B0=EB=B3=B8=20=ED=99=94=EB=A9=B4=20UI=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/terning/feature/search/search/SearchRoute.kt | 9 +-------- .../search/search/component/SearchInternList.kt | 10 +++++++--- feature/src/main/res/values/strings.xml | 4 ++-- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/feature/src/main/java/com/terning/feature/search/search/SearchRoute.kt b/feature/src/main/java/com/terning/feature/search/search/SearchRoute.kt index 6756b9ae9..1088e226c 100644 --- a/feature/src/main/java/com/terning/feature/search/search/SearchRoute.kt +++ b/feature/src/main/java/com/terning/feature/search/search/SearchRoute.kt @@ -7,7 +7,6 @@ import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.foundation.lazy.LazyColumn -import androidx.compose.material3.HorizontalDivider import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect @@ -22,7 +21,6 @@ import androidx.lifecycle.flowWithLifecycle import com.terning.core.designsystem.component.image.TerningImage import com.terning.core.designsystem.component.textfield.SearchTextField import com.terning.core.designsystem.theme.Black -import com.terning.core.designsystem.theme.Grey100 import com.terning.core.designsystem.theme.TerningTheme import com.terning.core.extension.noRippleClickable import com.terning.core.state.UiState @@ -128,7 +126,7 @@ fun SearchScreen( item { ImageSlider(images = images) - Spacer(modifier = Modifier.padding(8.dp)) + Spacer(modifier = Modifier.padding(top = 20.dp)) Text( text = stringResource(id = R.string.search_today_popular), @@ -142,11 +140,6 @@ fun SearchScreen( searchScrapsList = searchScrapsList, navigateToIntern = navigateToIntern, ) - HorizontalDivider( - thickness = 4.dp, - modifier = Modifier.padding(vertical = 8.dp), - color = Grey100, - ) SearchInternList( type = InternListType.SCRAP, searchViewsList = searchViewsList, diff --git a/feature/src/main/java/com/terning/feature/search/search/component/SearchInternList.kt b/feature/src/main/java/com/terning/feature/search/search/component/SearchInternList.kt index 5a0099763..8c489336c 100644 --- a/feature/src/main/java/com/terning/feature/search/search/component/SearchInternList.kt +++ b/feature/src/main/java/com/terning/feature/search/search/component/SearchInternList.kt @@ -2,6 +2,7 @@ package com.terning.feature.search.search.component import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.padding import androidx.compose.foundation.lazy.LazyRow import androidx.compose.material3.Text @@ -21,7 +22,9 @@ fun SearchInternList( searchViewsList: List?, navigateToIntern: (Long) -> Unit, ) { - Column(modifier = Modifier.padding(horizontal = 24.dp)) { + Column( + modifier = Modifier.padding(horizontal = 24.dp) + ) { Text( text = stringResource( id = when (type) { @@ -29,12 +32,12 @@ fun SearchInternList( InternListType.SCRAP -> R.string.search_most_scrap_intern } ), - style = TerningTheme.typography.title5, + style = TerningTheme.typography.body3, color = Grey400 ) LazyRow( - modifier = Modifier.padding(vertical = 8.dp), + modifier = Modifier.padding(vertical = 12.dp), horizontalArrangement = Arrangement.spacedBy(12.dp), ) { when (type) { @@ -61,5 +64,6 @@ fun SearchInternList( } } } + Spacer(modifier = Modifier.padding(top = 20.dp)) } } \ No newline at end of file diff --git a/feature/src/main/res/values/strings.xml b/feature/src/main/res/values/strings.xml index 1e6199a72..3327e885b 100644 --- a/feature/src/main/res/values/strings.xml +++ b/feature/src/main/res/values/strings.xml @@ -27,9 +27,9 @@ 관심있는 인턴 공고 키워드를 검색해 보세요 요즘 대학생들에게 인기 있는 공고 - 지금 조회수가 많은 공고들이에요 + 이번 주 가장 많이 조회한 공고예요 공고 이미지 - 지금 스크랩수가 많은 공고들이에요 + 이번 주 가장 많이 스크랩 한 공고예요 검색