From 293864e405a4f30d4dd18d96d22758da844d5e6e Mon Sep 17 00:00:00 2001 From: Hyobeen-Park Date: Fri, 12 Jul 2024 00:54:00 +0900 Subject: [PATCH 01/19] =?UTF-8?q?[FEAT/#51]=20navigation=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../home/changefilter/ChangeFilterRoute.kt | 17 +++++++++++ .../navigation/ChangeFilterNavigation.kt | 30 +++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 feature/src/main/java/com/terning/feature/home/changefilter/ChangeFilterRoute.kt create mode 100644 feature/src/main/java/com/terning/feature/home/changefilter/navigation/ChangeFilterNavigation.kt diff --git a/feature/src/main/java/com/terning/feature/home/changefilter/ChangeFilterRoute.kt b/feature/src/main/java/com/terning/feature/home/changefilter/ChangeFilterRoute.kt new file mode 100644 index 000000000..34ce960d9 --- /dev/null +++ b/feature/src/main/java/com/terning/feature/home/changefilter/ChangeFilterRoute.kt @@ -0,0 +1,17 @@ +package com.terning.feature.home.changefilter + +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.navigation.NavController + +@Composable +fun ChangeFilterRoute( + navController: NavController, +) { + ChangeFilterScreen() +} + +@Composable +fun ChangeFilterScreen() { + Text(text = "필터링 재설정") +} \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/home/changefilter/navigation/ChangeFilterNavigation.kt b/feature/src/main/java/com/terning/feature/home/changefilter/navigation/ChangeFilterNavigation.kt new file mode 100644 index 000000000..5c2cab77f --- /dev/null +++ b/feature/src/main/java/com/terning/feature/home/changefilter/navigation/ChangeFilterNavigation.kt @@ -0,0 +1,30 @@ +package com.terning.feature.home.changefilter.navigation + +import androidx.navigation.NavController +import androidx.navigation.NavGraphBuilder +import androidx.navigation.NavHostController +import androidx.navigation.NavOptions +import androidx.navigation.compose.composable +import com.terning.core.navigation.Route +import com.terning.feature.home.changefilter.ChangeFilterRoute +import kotlinx.serialization.Serializable + +fun NavController.navigateChangeFilter(navOptions: NavOptions? = null) { + navigate( + route = ChangeFilter, + navOptions = navOptions + ) +} + +fun NavGraphBuilder.changeFilterNavGraph( + navHostController: NavHostController +) { + composable { + ChangeFilterRoute( + navController = navHostController + ) + } +} + +@Serializable +data object ChangeFilter : Route \ No newline at end of file From 9d64fcf05042d4ba40e8999913c7401646691827 Mon Sep 17 00:00:00 2001 From: Hyobeen-Park Date: Fri, 12 Jul 2024 01:18:43 +0900 Subject: [PATCH 02/19] =?UTF-8?q?[FEAT/#51]=20=ED=99=88=20-=20=ED=95=84?= =?UTF-8?q?=ED=84=B0=EB=A7=81=20=EC=9E=AC=EC=84=A4=EC=A0=95=20=EC=97=B0?= =?UTF-8?q?=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/terning/feature/home/home/HomeRoute.kt | 14 ++++++++++---- .../home/home/component/HomeFilteringScreen.kt | 5 ++++- .../home/home/navigation/HometNavigation.kt | 5 +++-- .../java/com/terning/feature/main/MainNavigator.kt | 4 ++-- .../java/com/terning/feature/main/MainScreen.kt | 4 +++- 5 files changed, 22 insertions(+), 10 deletions(-) diff --git a/feature/src/main/java/com/terning/feature/home/home/HomeRoute.kt b/feature/src/main/java/com/terning/feature/home/home/HomeRoute.kt index bc8c30273..bd814517f 100644 --- a/feature/src/main/java/com/terning/feature/home/home/HomeRoute.kt +++ b/feature/src/main/java/com/terning/feature/home/home/HomeRoute.kt @@ -14,23 +14,27 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp +import androidx.navigation.NavHostController import com.terning.core.designsystem.component.topappbar.LogoTopAppBar import com.terning.core.designsystem.theme.Black import com.terning.core.designsystem.theme.Grey150 import com.terning.core.designsystem.theme.TerningTheme import com.terning.core.designsystem.theme.White import com.terning.feature.R +import com.terning.feature.home.changefilter.navigation.navigateChangeFilter import com.terning.feature.home.home.component.HomeFilteringScreen import com.terning.feature.home.home.component.HomeTodayIntern @Composable -fun HomeRoute() { - HomeScreen() +fun HomeRoute( + navController: NavHostController +) { + HomeScreen(navController) } @OptIn(ExperimentalFoundationApi::class) @Composable -fun HomeScreen() { +fun HomeScreen(navController: NavHostController) { Scaffold( modifier = Modifier, topBar = { @@ -49,7 +53,8 @@ fun HomeScreen() { ) { Text( text = stringResource( - id = R.string.home_today_title,"남지우"), + id = R.string.home_today_title, "남지우" + ), modifier = Modifier .padding(top = 11.dp) .padding(horizontal = 24.dp), @@ -87,6 +92,7 @@ fun HomeScreen() { period = 1, startYear = 2024, startMonth = 7, + { navController.navigateChangeFilter() }, ) HorizontalDivider( diff --git a/feature/src/main/java/com/terning/feature/home/home/component/HomeFilteringScreen.kt b/feature/src/main/java/com/terning/feature/home/home/component/HomeFilteringScreen.kt index e22a775ed..f490c5562 100644 --- a/feature/src/main/java/com/terning/feature/home/home/component/HomeFilteringScreen.kt +++ b/feature/src/main/java/com/terning/feature/home/home/component/HomeFilteringScreen.kt @@ -24,6 +24,7 @@ import com.terning.core.designsystem.theme.Grey300 import com.terning.core.designsystem.theme.TerningMain import com.terning.core.designsystem.theme.TerningTheme import com.terning.core.designsystem.theme.White +import com.terning.core.extension.noRippleClickable import com.terning.feature.R @Composable @@ -32,6 +33,7 @@ fun HomeFilteringScreen( period: Int, startYear: Int, startMonth: Int, + onChangeFilterClick: () -> Unit, modifier: Modifier = Modifier, ) { Row( @@ -48,7 +50,8 @@ fun HomeFilteringScreen( color = TerningMain, shape = RoundedCornerShape(5.dp), ) - .align(Alignment.CenterVertically), + .align(Alignment.CenterVertically) + .noRippleClickable { onChangeFilterClick() }, ) { Image( painter = painterResource(id = R.drawable.ic_home_filtering_28), diff --git a/feature/src/main/java/com/terning/feature/home/home/navigation/HometNavigation.kt b/feature/src/main/java/com/terning/feature/home/home/navigation/HometNavigation.kt index c49027a9d..88ce969af 100644 --- a/feature/src/main/java/com/terning/feature/home/home/navigation/HometNavigation.kt +++ b/feature/src/main/java/com/terning/feature/home/home/navigation/HometNavigation.kt @@ -2,6 +2,7 @@ package com.terning.feature.home.home.navigation import androidx.navigation.NavController import androidx.navigation.NavGraphBuilder +import androidx.navigation.NavHostController import androidx.navigation.NavOptions import androidx.navigation.compose.composable import com.terning.core.navigation.MainTabRoute @@ -15,9 +16,9 @@ fun NavController.navigateHome(navOptions: NavOptions? = null) { ) } -fun NavGraphBuilder.homeNavGraph() { +fun NavGraphBuilder.homeNavGraph(navHostController: NavHostController) { composable { - HomeRoute() + HomeRoute(navController = navHostController) } } diff --git a/feature/src/main/java/com/terning/feature/main/MainNavigator.kt b/feature/src/main/java/com/terning/feature/main/MainNavigator.kt index b538c3e58..1b50c7d23 100644 --- a/feature/src/main/java/com/terning/feature/main/MainNavigator.kt +++ b/feature/src/main/java/com/terning/feature/main/MainNavigator.kt @@ -10,9 +10,9 @@ import androidx.navigation.compose.currentBackStackEntryAsState import androidx.navigation.compose.rememberNavController import androidx.navigation.navOptions import com.terning.feature.calendar.navigation.navigateCalendar +import com.terning.feature.home.home.navigation.Home import com.terning.feature.home.home.navigation.navigateHome import com.terning.feature.mypage.navigation.navigateMyPage -import com.terning.feature.onboarding.signin.navigation.SignIn import com.terning.feature.search.search.navigation.navigateSearch class MainNavigator( @@ -22,7 +22,7 @@ class MainNavigator( @Composable get() = navController .currentBackStackEntryAsState().value?.destination - val startDestination = SignIn + val startDestination = Home val currentTab: MainTab? @Composable get() = MainTab.find { tab -> 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 be9252004..c3864d53d 100644 --- a/feature/src/main/java/com/terning/feature/main/MainScreen.kt +++ b/feature/src/main/java/com/terning/feature/main/MainScreen.kt @@ -21,6 +21,7 @@ import com.terning.core.designsystem.theme.TerningMain import com.terning.core.designsystem.theme.White import com.terning.core.util.NoRippleInteractionSource import com.terning.feature.calendar.navigation.calendarNavGraph +import com.terning.feature.home.changefilter.navigation.changeFilterNavGraph import com.terning.feature.home.home.navigation.homeNavGraph import com.terning.feature.mypage.navigation.myPageNavGraph import com.terning.feature.onboarding.filtering.navigation.filteringNavGraph @@ -52,7 +53,7 @@ fun MainScreen( navController = navigator.navController, startDestination = navigator.startDestination ) { - homeNavGraph() + homeNavGraph(navHostController = navigator.navController) calendarNavGraph() searchNavGraph(navHostController = navigator.navController) myPageNavGraph() @@ -60,6 +61,7 @@ fun MainScreen( signUpNavGraph(navHostController = navigator.navController) filteringNavGraph(navHostController = navigator.navController) searchProcessNavGraph(navHostController = navigator.navController) + changeFilterNavGraph(navHostController = navigator.navController) } } } From ea2a72986db5fc47c20d46d024daa7a1f8a50a0a Mon Sep 17 00:00:00 2001 From: Hyobeen-Park Date: Fri, 12 Jul 2024 05:11:27 +0900 Subject: [PATCH 03/19] =?UTF-8?q?[CHORE/#51]=20invoke()=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designsystem/component/topappbar/BackButtonTopAppBar.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/com/terning/core/designsystem/component/topappbar/BackButtonTopAppBar.kt b/core/src/main/java/com/terning/core/designsystem/component/topappbar/BackButtonTopAppBar.kt index 960ebdc6e..7cac0d516 100644 --- a/core/src/main/java/com/terning/core/designsystem/component/topappbar/BackButtonTopAppBar.kt +++ b/core/src/main/java/com/terning/core/designsystem/component/topappbar/BackButtonTopAppBar.kt @@ -13,6 +13,6 @@ fun BackButtonTopAppBar( title = title, showBackButton = true, modifier = modifier, - onBackButtonClick = { onBackButtonClick.invoke() }, + onBackButtonClick = { onBackButtonClick() }, ) } \ No newline at end of file From 603d2eb0f2f6ef30946f6fcdd70ce893a8935c3c Mon Sep 17 00:00:00 2001 From: Hyobeen-Park Date: Fri, 12 Jul 2024 05:27:10 +0900 Subject: [PATCH 04/19] =?UTF-8?q?[FEAT/#51]=20=ED=83=91=EB=B0=94=20?= =?UTF-8?q?=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../home/changefilter/ChangeFilterRoute.kt | 30 +++++++++++++++++-- feature/src/main/res/values/strings.xml | 1 + 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/feature/src/main/java/com/terning/feature/home/changefilter/ChangeFilterRoute.kt b/feature/src/main/java/com/terning/feature/home/changefilter/ChangeFilterRoute.kt index 34ce960d9..f02d9caef 100644 --- a/feature/src/main/java/com/terning/feature/home/changefilter/ChangeFilterRoute.kt +++ b/feature/src/main/java/com/terning/feature/home/changefilter/ChangeFilterRoute.kt @@ -1,17 +1,41 @@ package com.terning.feature.home.changefilter +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.padding +import androidx.compose.material3.Scaffold import androidx.compose.material3.Text import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource import androidx.navigation.NavController +import com.terning.core.designsystem.component.topappbar.BackButtonTopAppBar +import com.terning.feature.R @Composable fun ChangeFilterRoute( navController: NavController, ) { - ChangeFilterScreen() + ChangeFilterScreen(navController) } @Composable -fun ChangeFilterScreen() { - Text(text = "필터링 재설정") +fun ChangeFilterScreen(navController: NavController) { + Scaffold( + modifier = Modifier, + topBar = { + BackButtonTopAppBar( + title = stringResource(id = R.string.change_filter_top_bar_title), + onBackButtonClick = { navController.popBackStack() }, + modifier = Modifier + ) + } + ) { paddingValues -> + Column( + modifier = Modifier + .padding(paddingValues) + ) { + Text(text = "dd") + } + + } } \ 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 9a2513475..e0cbcb170 100644 --- a/feature/src/main/res/values/strings.xml +++ b/feature/src/main/res/values/strings.xml @@ -81,6 +81,7 @@ 인턴 공고가 없어요! + 필터링 재설정 재학 상태를 선택해주세요 희망하는 인턴 근무 기간을 선택해주세요 입사를 계획중인 달을 선택해주세요 From 6e7a7eed19228613d5723eb18aa977a264b0bbb5 Mon Sep 17 00:00:00 2001 From: Hyobeen-Park Date: Fri, 12 Jul 2024 17:12:15 +0900 Subject: [PATCH 05/19] =?UTF-8?q?[FEAT/#51]=20=ED=83=91=EB=B0=94=20?= =?UTF-8?q?=EA=B7=B8=EB=A6=BC=EC=9E=90=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../terning/feature/home/changefilter/ChangeFilterRoute.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/feature/src/main/java/com/terning/feature/home/changefilter/ChangeFilterRoute.kt b/feature/src/main/java/com/terning/feature/home/changefilter/ChangeFilterRoute.kt index f02d9caef..51dd24a27 100644 --- a/feature/src/main/java/com/terning/feature/home/changefilter/ChangeFilterRoute.kt +++ b/feature/src/main/java/com/terning/feature/home/changefilter/ChangeFilterRoute.kt @@ -6,7 +6,9 @@ import androidx.compose.material3.Scaffold import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.shadow import androidx.compose.ui.res.stringResource +import androidx.compose.ui.unit.dp import androidx.navigation.NavController import com.terning.core.designsystem.component.topappbar.BackButtonTopAppBar import com.terning.feature.R @@ -21,12 +23,12 @@ fun ChangeFilterRoute( @Composable fun ChangeFilterScreen(navController: NavController) { Scaffold( - modifier = Modifier, topBar = { BackButtonTopAppBar( title = stringResource(id = R.string.change_filter_top_bar_title), onBackButtonClick = { navController.popBackStack() }, modifier = Modifier + .shadow(elevation = 2.dp) ) } ) { paddingValues -> From d09fd0bd5339f50fe4434081b061a1603ded832d Mon Sep 17 00:00:00 2001 From: Hyobeen-Park Date: Sat, 13 Jul 2024 23:23:54 +0900 Subject: [PATCH 06/19] =?UTF-8?q?[CHORE/#51]=20=EC=A4=91=EB=B3=B5=EB=90=9C?= =?UTF-8?q?=20string=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../feature/home/home/component/HomeFilteringScreen.kt | 6 +++--- feature/src/main/res/values/strings.xml | 8 -------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/feature/src/main/java/com/terning/feature/home/home/component/HomeFilteringScreen.kt b/feature/src/main/java/com/terning/feature/home/home/component/HomeFilteringScreen.kt index f490c5562..8b9e5d385 100644 --- a/feature/src/main/java/com/terning/feature/home/home/component/HomeFilteringScreen.kt +++ b/feature/src/main/java/com/terning/feature/home/home/component/HomeFilteringScreen.kt @@ -79,9 +79,9 @@ fun HomeFilteringScreen( HomeFilteringText( text = stringResource( id = when (period) { - 1 -> R.string.home_recommend_filtering_working_period_1 - 2 -> R.string.home_recommend_filtering_working_period_2 - 3 -> R.string.home_recommend_filtering_working_period_3 + 1 -> R.string.filtering_status2_button1 + 2 -> R.string.filtering_status2_button2 + 3 -> R.string.filtering_status2_button3 else -> R.string.server_failure } ), diff --git a/feature/src/main/res/values/strings.xml b/feature/src/main/res/values/strings.xml index 41f3cb70e..0e229e01a 100644 --- a/feature/src/main/res/values/strings.xml +++ b/feature/src/main/res/values/strings.xml @@ -66,9 +66,6 @@ 내 계획에 딱 맞는 대학생 인턴 공고 필터링 학년 - 1개월 ~ 3개월 - 4개월 ~ 6개월 - 7개월 이상 필터링 설정에 일치하는 인턴 공고가 없어요!\n딱 맞는 인턴 공고가 올라오면 바로 알려드릴게요 @@ -114,11 +111,6 @@ 필터링 재설정 재학 상태를 선택해주세요 - 희망하는 인턴 근무 기간을 선택해주세요 - 입사를 계획중인 달을 선택해주세요 - 휴학중이라면, 휴학 전 마지막 수료 학년을 선택해주세요 - 선택한 기간동안 근무할 수 있는 인턴 공고를 찾아드릴게요 - 선택한 달부터 근무를 시작할 수 있는 공고를 찾아드릴게요 공유 아이콘 From 8c8386f587bc6e78797988492d59cdd5fcd14d9b Mon Sep 17 00:00:00 2001 From: Hyobeen-Park Date: Sun, 14 Jul 2024 03:26:00 +0900 Subject: [PATCH 07/19] =?UTF-8?q?[FEAT/#51]=20=EA=B8=B0=EB=B3=B8=20UI=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../home/changefilter/ChangeFilterRoute.kt | 82 ++++++++++++++++++- .../terning/feature/home/home/HomeRoute.kt | 10 +-- 2 files changed, 84 insertions(+), 8 deletions(-) diff --git a/feature/src/main/java/com/terning/feature/home/changefilter/ChangeFilterRoute.kt b/feature/src/main/java/com/terning/feature/home/changefilter/ChangeFilterRoute.kt index 51dd24a27..9ea082b3a 100644 --- a/feature/src/main/java/com/terning/feature/home/changefilter/ChangeFilterRoute.kt +++ b/feature/src/main/java/com/terning/feature/home/changefilter/ChangeFilterRoute.kt @@ -1,17 +1,23 @@ package com.terning.feature.home.changefilter import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.padding import androidx.compose.material3.Scaffold -import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.draw.shadow import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import androidx.navigation.NavController +import com.terning.core.designsystem.component.button.RectangleButton +import com.terning.core.designsystem.component.datepicker.DatePickerUI import com.terning.core.designsystem.component.topappbar.BackButtonTopAppBar +import com.terning.core.designsystem.theme.TerningTheme import com.terning.feature.R +import com.terning.feature.home.changefilter.component.FilteringMainTitleText +import com.terning.feature.home.changefilter.component.FilteringSubTitleText +import com.terning.feature.home.home.navigation.navigateHome @Composable fun ChangeFilterRoute( @@ -34,10 +40,80 @@ fun ChangeFilterScreen(navController: NavController) { ) { paddingValues -> Column( modifier = Modifier - .padding(paddingValues) + .padding( + top = paddingValues.calculateTopPadding(), + ) ) { - Text(text = "dd") + showTitle( + mainTitle = stringResource(id = R.string.change_filter_grade_main), + subTitle = stringResource(id = R.string.filtering_status1_sub), + modifier = Modifier.padding( + top = 31.dp, + start = 24.dp, + end = 24.dp + ) + ) + + showTitle( + mainTitle = stringResource(id = R.string.filtering_status2_title), + subTitle = stringResource(id = R.string.filtering_status2_sub), + modifier = Modifier.padding( + top = 39.dp, + start = 24.dp, + end = 24.dp + ) + ) + + showTitle( + mainTitle = stringResource(id = R.string.filtering_status3_title), + subTitle = stringResource(id = R.string.filtering_status3_sub), + modifier = Modifier.padding( + top = 39.dp, + start = 24.dp, + end = 24.dp + ) + ) + + Spacer(modifier = Modifier.padding(12.dp)) + Spacer(modifier = Modifier.weight(1f)) + DatePickerUI( + chosenYear = 2024, + chosenMonth = 7, + ) + Spacer(modifier = Modifier.weight(1f)) + Spacer(modifier = Modifier.padding(33.dp)) + + RectangleButton( + style = TerningTheme.typography.button0, + paddingVertical = 19.dp, + text = R.string.change_filter_save, + onButtonClick = { + navController.navigateHome() + } + ) } } +} + +@Composable +private fun showTitle( + mainTitle: String, + subTitle: String, + modifier: Modifier = Modifier, +) { + FilteringMainTitleText( + text = mainTitle, + modifier = modifier.padding() + ) + FilteringSubTitleText( + text = subTitle, + modifier = Modifier + .padding( + top = 3.dp, + bottom = 13.dp, + start = 24.dp, + end = 24.dp + ) + ) } \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/home/home/HomeRoute.kt b/feature/src/main/java/com/terning/feature/home/home/HomeRoute.kt index 82d25f090..c59b90525 100644 --- a/feature/src/main/java/com/terning/feature/home/home/HomeRoute.kt +++ b/feature/src/main/java/com/terning/feature/home/home/HomeRoute.kt @@ -28,10 +28,10 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import androidx.hilt.navigation.compose.hiltViewModel import androidx.lifecycle.compose.collectAsStateWithLifecycle +import androidx.navigation.NavHostController import com.terning.core.designsystem.component.bottomsheet.SortingBottomSheet import com.terning.core.designsystem.component.button.SortingButton import com.terning.core.designsystem.component.item.InternItem -import androidx.navigation.NavHostController import com.terning.core.designsystem.component.topappbar.LogoTopAppBar import com.terning.core.designsystem.theme.Black import com.terning.core.designsystem.theme.Grey150 @@ -40,8 +40,8 @@ import com.terning.core.designsystem.theme.TerningTheme import com.terning.core.designsystem.theme.White import com.terning.core.extension.customShadow import com.terning.feature.R -import com.terning.feature.home.home.component.HomeFilteringEmptyIntern import com.terning.feature.home.changefilter.navigation.navigateChangeFilter +import com.terning.feature.home.home.component.HomeFilteringEmptyIntern import com.terning.feature.home.home.component.HomeFilteringScreen import com.terning.feature.home.home.component.HomeRecommendEmptyIntern import com.terning.feature.home.home.component.HomeTodayEmptyIntern @@ -60,7 +60,7 @@ fun HomeRoute( val currentSortBy: MutableState = remember { mutableIntStateOf(0) } - HomeScreen(currentSortBy,navController) + HomeScreen(currentSortBy, navController) } @OptIn(ExperimentalFoundationApi::class) @@ -118,7 +118,7 @@ fun HomeScreen( .background(White) ) { ShowRecommendTitle() - ShowInternFilter(userNameState = userNameState) + ShowInternFilter(userNameState = userNameState, navController) HorizontalDivider( thickness = 4.dp, @@ -214,7 +214,7 @@ private fun ShowRecommendTitle() { } @Composable -private fun ShowInternFilter(userNameState: UserNameState) { +private fun ShowInternFilter(userNameState: UserNameState, navController: NavHostController) { if (userNameState.internFilter == null) { HomeFilteringScreen( grade = R.string.home_recommend_no_filtering_hyphen, From e01f98baf7ba82ad8639fb76f4d8a6bcdf8d88e3 Mon Sep 17 00:00:00 2001 From: Hyobeen-Park Date: Sun, 14 Jul 2024 03:57:31 +0900 Subject: [PATCH 08/19] =?UTF-8?q?[FEAT/#51]=20=EB=9D=BC=EB=94=94=EC=98=A4?= =?UTF-8?q?=20=EB=B2=84=ED=8A=BC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/button/ChangeFilterButton.kt | 81 +++++++++++++++++++ .../home/changefilter/ChangeFilterRoute.kt | 15 ++++ .../component/ChangeFilteringRadioGroup.kt | 70 ++++++++++++++++ feature/src/main/res/values/strings.xml | 1 + 4 files changed, 167 insertions(+) create mode 100644 core/src/main/java/com/terning/core/designsystem/component/button/ChangeFilterButton.kt create mode 100644 feature/src/main/java/com/terning/feature/home/changefilter/component/ChangeFilteringRadioGroup.kt diff --git a/core/src/main/java/com/terning/core/designsystem/component/button/ChangeFilterButton.kt b/core/src/main/java/com/terning/core/designsystem/component/button/ChangeFilterButton.kt new file mode 100644 index 000000000..c5feb3050 --- /dev/null +++ b/core/src/main/java/com/terning/core/designsystem/component/button/ChangeFilterButton.kt @@ -0,0 +1,81 @@ +package com.terning.core.designsystem.component.button + +import androidx.annotation.StringRes +import androidx.compose.foundation.BorderStroke +import androidx.compose.foundation.interaction.MutableInteractionSource +import androidx.compose.foundation.interaction.collectIsPressedAsState +import androidx.compose.foundation.layout.PaddingValues +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material.ripple.LocalRippleTheme +import androidx.compose.material3.Button +import androidx.compose.material3.ButtonDefaults +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.CompositionLocalProvider +import androidx.compose.runtime.getValue +import androidx.compose.runtime.remember +import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.unit.Dp +import androidx.compose.ui.unit.dp +import com.terning.core.designsystem.theme.Grey400 +import com.terning.core.designsystem.theme.TerningMain +import com.terning.core.designsystem.theme.TerningSub1 +import com.terning.core.designsystem.theme.TerningSub5 +import com.terning.core.designsystem.theme.TerningTheme +import com.terning.core.designsystem.theme.White +import com.terning.core.util.NoRippleTheme + +@Composable +fun ChangeFilterButton( + isSelected: Boolean, + @StringRes text: Int, + cornerRadius: Dp, + paddingVertical: Dp, + onButtonClick: () -> Unit, + modifier: Modifier = Modifier, +) { + val interactionSource = remember { MutableInteractionSource() } + val isPressed by interactionSource.collectIsPressedAsState() + val backgroundColor = when { + !isSelected && !isPressed -> White + !isSelected && isPressed -> TerningSub5 + else -> TerningMain + } + val textColor = when { + !isSelected -> Grey400 + else -> White + } + val borderColor = when { + !isSelected && !isPressed -> TerningMain + !isSelected && isPressed -> TerningSub1 + else -> TerningMain + } + + CompositionLocalProvider(LocalRippleTheme provides NoRippleTheme) { + Button( + contentPadding = PaddingValues(paddingVertical), + modifier = modifier + .fillMaxWidth(), + interactionSource = interactionSource, + colors = ButtonDefaults.buttonColors( + containerColor = backgroundColor, + contentColor = textColor, + ), + border = BorderStroke( + width = 1.dp, + color = borderColor + ), + shape = RoundedCornerShape(cornerRadius), + onClick = { onButtonClick() } + ) { + Text( + text = stringResource(id = text), + style = TerningTheme.typography.button3, + textAlign = TextAlign.Center, + ) + } + } +} diff --git a/feature/src/main/java/com/terning/feature/home/changefilter/ChangeFilterRoute.kt b/feature/src/main/java/com/terning/feature/home/changefilter/ChangeFilterRoute.kt index 9ea082b3a..11a855eac 100644 --- a/feature/src/main/java/com/terning/feature/home/changefilter/ChangeFilterRoute.kt +++ b/feature/src/main/java/com/terning/feature/home/changefilter/ChangeFilterRoute.kt @@ -2,7 +2,9 @@ package com.terning.feature.home.changefilter import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.wrapContentHeight import androidx.compose.material3.Scaffold import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier @@ -15,6 +17,7 @@ import com.terning.core.designsystem.component.datepicker.DatePickerUI import com.terning.core.designsystem.component.topappbar.BackButtonTopAppBar import com.terning.core.designsystem.theme.TerningTheme import com.terning.feature.R +import com.terning.feature.home.changefilter.component.ChangeFilteringRadioGroup import com.terning.feature.home.changefilter.component.FilteringMainTitleText import com.terning.feature.home.changefilter.component.FilteringSubTitleText import com.terning.feature.home.home.navigation.navigateHome @@ -53,6 +56,12 @@ fun ChangeFilterScreen(navController: NavController) { end = 24.dp ) ) + ChangeFilteringRadioGroup( + filterType = 0, + modifier = Modifier + .height(36.dp), + onButtonClick = { } + ) showTitle( mainTitle = stringResource(id = R.string.filtering_status2_title), @@ -63,6 +72,12 @@ fun ChangeFilterScreen(navController: NavController) { end = 24.dp ) ) + ChangeFilteringRadioGroup( + filterType = 1, + modifier = Modifier + .height(36.dp), + onButtonClick = { } + ) showTitle( mainTitle = stringResource(id = R.string.filtering_status3_title), diff --git a/feature/src/main/java/com/terning/feature/home/changefilter/component/ChangeFilteringRadioGroup.kt b/feature/src/main/java/com/terning/feature/home/changefilter/component/ChangeFilteringRadioGroup.kt new file mode 100644 index 000000000..abdccae91 --- /dev/null +++ b/feature/src/main/java/com/terning/feature/home/changefilter/component/ChangeFilteringRadioGroup.kt @@ -0,0 +1,70 @@ +package com.terning.feature.home.changefilter.component + +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.PaddingValues +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.width +import androidx.compose.foundation.layout.wrapContentHeight +import androidx.compose.foundation.lazy.grid.GridCells +import androidx.compose.foundation.lazy.grid.LazyHorizontalGrid +import androidx.compose.foundation.lazy.grid.itemsIndexed +import androidx.compose.runtime.Composable +import androidx.compose.runtime.mutableIntStateOf +import androidx.compose.runtime.mutableStateListOf +import androidx.compose.runtime.remember +import androidx.compose.ui.Modifier +import androidx.compose.ui.unit.dp +import com.terning.core.designsystem.component.button.ChangeFilterButton +import com.terning.core.designsystem.component.button.FilteringButton +import com.terning.feature.R + +@Composable +fun ChangeFilteringRadioGroup( + filterType: Int, + onButtonClick: (Int) -> Unit, + modifier: Modifier = Modifier, +) { + val options = if (filterType == 0) { + listOf( + R.string.filtering_status1_button1, + R.string.filtering_status1_button2, + R.string.filtering_status1_button3, + R.string.filtering_status1_button4, + ) + } else { + listOf( + R.string.filtering_status2_button1, + R.string.filtering_status2_button2, + R.string.filtering_status2_button3, + ) + } + + val selectedIndex = remember { mutableIntStateOf(0) } + val selectedButton = remember { mutableStateListOf(false, false, false, false) } + + LazyHorizontalGrid( + rows = GridCells.Fixed(1), + horizontalArrangement = Arrangement.SpaceBetween, + modifier = modifier + .padding(horizontal = 24.dp) + .fillMaxWidth(), + ) { + itemsIndexed(options) { index, option -> + ChangeFilterButton( + isSelected = selectedButton[index], + modifier = Modifier + .fillMaxWidth(), + text = options[index], + cornerRadius = 10.dp, + paddingVertical = 10.dp, + onButtonClick = { + selectedIndex.intValue = option + selectedButton.indices.forEach { i -> selectedButton[i] = false } + selectedButton[index] = true + onButtonClick(index) + } + ) + } + } +} \ 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 0e229e01a..2e80cb776 100644 --- a/feature/src/main/res/values/strings.xml +++ b/feature/src/main/res/values/strings.xml @@ -111,6 +111,7 @@ 필터링 재설정 재학 상태를 선택해주세요 + 저장하기 공유 아이콘 From d3e7509b78b4993879e991d45a4c4f4f35671a92 Mon Sep 17 00:00:00 2001 From: Hyobeen-Park Date: Sun, 14 Jul 2024 05:06:14 +0900 Subject: [PATCH 09/19] =?UTF-8?q?[FEAT/#51]=20UI=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/button/ChangeFilterButton.kt | 7 +++++-- .../home/changefilter/ChangeFilterRoute.kt | 6 ------ .../component/ChangeFilteringRadioGroup.kt | 19 +++++++++---------- feature/src/main/res/values/strings.xml | 2 +- 4 files changed, 15 insertions(+), 19 deletions(-) diff --git a/core/src/main/java/com/terning/core/designsystem/component/button/ChangeFilterButton.kt b/core/src/main/java/com/terning/core/designsystem/component/button/ChangeFilterButton.kt index c5feb3050..c322ddb6c 100644 --- a/core/src/main/java/com/terning/core/designsystem/component/button/ChangeFilterButton.kt +++ b/core/src/main/java/com/terning/core/designsystem/component/button/ChangeFilterButton.kt @@ -6,6 +6,8 @@ import androidx.compose.foundation.interaction.MutableInteractionSource import androidx.compose.foundation.interaction.collectIsPressedAsState import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.wrapContentHeight import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.ripple.LocalRippleTheme import androidx.compose.material3.Button @@ -56,9 +58,10 @@ fun ChangeFilterButton( CompositionLocalProvider(LocalRippleTheme provides NoRippleTheme) { Button( - contentPadding = PaddingValues(paddingVertical), + contentPadding = PaddingValues(vertical = paddingVertical), modifier = modifier - .fillMaxWidth(), + .fillMaxWidth() + .wrapContentHeight(), interactionSource = interactionSource, colors = ButtonDefaults.buttonColors( containerColor = backgroundColor, diff --git a/feature/src/main/java/com/terning/feature/home/changefilter/ChangeFilterRoute.kt b/feature/src/main/java/com/terning/feature/home/changefilter/ChangeFilterRoute.kt index 11a855eac..37c0c486c 100644 --- a/feature/src/main/java/com/terning/feature/home/changefilter/ChangeFilterRoute.kt +++ b/feature/src/main/java/com/terning/feature/home/changefilter/ChangeFilterRoute.kt @@ -4,7 +4,6 @@ import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.layout.wrapContentHeight import androidx.compose.material3.Scaffold import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier @@ -58,8 +57,6 @@ fun ChangeFilterScreen(navController: NavController) { ) ChangeFilteringRadioGroup( filterType = 0, - modifier = Modifier - .height(36.dp), onButtonClick = { } ) @@ -89,14 +86,12 @@ fun ChangeFilterScreen(navController: NavController) { ) ) - Spacer(modifier = Modifier.padding(12.dp)) Spacer(modifier = Modifier.weight(1f)) DatePickerUI( chosenYear = 2024, chosenMonth = 7, ) Spacer(modifier = Modifier.weight(1f)) - Spacer(modifier = Modifier.padding(33.dp)) RectangleButton( style = TerningTheme.typography.button0, @@ -107,7 +102,6 @@ fun ChangeFilterScreen(navController: NavController) { } ) } - } } diff --git a/feature/src/main/java/com/terning/feature/home/changefilter/component/ChangeFilteringRadioGroup.kt b/feature/src/main/java/com/terning/feature/home/changefilter/component/ChangeFilteringRadioGroup.kt index abdccae91..84257cb25 100644 --- a/feature/src/main/java/com/terning/feature/home/changefilter/component/ChangeFilteringRadioGroup.kt +++ b/feature/src/main/java/com/terning/feature/home/changefilter/component/ChangeFilteringRadioGroup.kt @@ -1,13 +1,11 @@ package com.terning.feature.home.changefilter.component import androidx.compose.foundation.layout.Arrangement -import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.layout.width import androidx.compose.foundation.layout.wrapContentHeight import androidx.compose.foundation.lazy.grid.GridCells -import androidx.compose.foundation.lazy.grid.LazyHorizontalGrid +import androidx.compose.foundation.lazy.grid.LazyVerticalGrid import androidx.compose.foundation.lazy.grid.itemsIndexed import androidx.compose.runtime.Composable import androidx.compose.runtime.mutableIntStateOf @@ -16,7 +14,6 @@ import androidx.compose.runtime.remember import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp import com.terning.core.designsystem.component.button.ChangeFilterButton -import com.terning.core.designsystem.component.button.FilteringButton import com.terning.feature.R @Composable @@ -43,18 +40,20 @@ fun ChangeFilteringRadioGroup( val selectedIndex = remember { mutableIntStateOf(0) } val selectedButton = remember { mutableStateListOf(false, false, false, false) } - LazyHorizontalGrid( - rows = GridCells.Fixed(1), - horizontalArrangement = Arrangement.SpaceBetween, - modifier = modifier + LazyVerticalGrid( + columns = GridCells.Fixed(options.size), + horizontalArrangement = Arrangement.spacedBy(12.dp), + modifier = Modifier + .fillMaxWidth() + .wrapContentHeight() .padding(horizontal = 24.dp) - .fillMaxWidth(), + ) { itemsIndexed(options) { index, option -> ChangeFilterButton( isSelected = selectedButton[index], modifier = Modifier - .fillMaxWidth(), + .wrapContentHeight(), text = options[index], cornerRadius = 10.dp, paddingVertical = 10.dp, diff --git a/feature/src/main/res/values/strings.xml b/feature/src/main/res/values/strings.xml index 2e80cb776..11e708776 100644 --- a/feature/src/main/res/values/strings.xml +++ b/feature/src/main/res/values/strings.xml @@ -110,7 +110,7 @@ 필터링 재설정 - 재학 상태를 선택해주세요 + 재학 상태를 선택해 주세요 저장하기 From 7611e53daa01060e06f7aa8c2f86aeb55ae8d6c7 Mon Sep 17 00:00:00 2001 From: Hyobeen-Park Date: Sun, 14 Jul 2024 06:32:05 +0900 Subject: [PATCH 10/19] =?UTF-8?q?[FEAT/#51]=20=ED=99=88=20=ED=95=84?= =?UTF-8?q?=ED=84=B0=EB=A7=81=20=EB=8D=B0=EC=9D=B4=ED=84=B0=20=EC=97=B0?= =?UTF-8?q?=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../home/changefilter/ChangeFilterRoute.kt | 36 ++++++++++++++----- .../component/ChangeFilteringRadioGroup.kt | 14 +++++++- .../terning/feature/home/home/HomeRoute.kt | 24 ++++++++----- .../feature/home/home/HomeViewModel.kt | 15 ++++++-- .../home/component/HomeFilteringScreen.kt | 23 ++++-------- .../home/home/model/InternFilterData.kt | 4 +-- 6 files changed, 77 insertions(+), 39 deletions(-) diff --git a/feature/src/main/java/com/terning/feature/home/changefilter/ChangeFilterRoute.kt b/feature/src/main/java/com/terning/feature/home/changefilter/ChangeFilterRoute.kt index 37c0c486c..166a0d3b8 100644 --- a/feature/src/main/java/com/terning/feature/home/changefilter/ChangeFilterRoute.kt +++ b/feature/src/main/java/com/terning/feature/home/changefilter/ChangeFilterRoute.kt @@ -2,7 +2,6 @@ package com.terning.feature.home.changefilter import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer -import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.material3.Scaffold import androidx.compose.runtime.Composable @@ -10,6 +9,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.draw.shadow import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp +import androidx.hilt.navigation.compose.hiltViewModel import androidx.navigation.NavController import com.terning.core.designsystem.component.button.RectangleButton import com.terning.core.designsystem.component.datepicker.DatePickerUI @@ -19,7 +19,14 @@ import com.terning.feature.R import com.terning.feature.home.changefilter.component.ChangeFilteringRadioGroup import com.terning.feature.home.changefilter.component.FilteringMainTitleText import com.terning.feature.home.changefilter.component.FilteringSubTitleText +import com.terning.feature.home.home.HomeViewModel +import com.terning.feature.home.home.model.InternFilterData +import com.terning.feature.home.home.model.UserNameState import com.terning.feature.home.home.navigation.navigateHome +import java.util.Calendar + +val currentYear = Calendar.getInstance().get(Calendar.YEAR) +val currentMonth = Calendar.getInstance().get(Calendar.MONTH) @Composable fun ChangeFilterRoute( @@ -29,7 +36,10 @@ fun ChangeFilterRoute( } @Composable -fun ChangeFilterScreen(navController: NavController) { +fun ChangeFilterScreen( + navController: NavController, + viewModel: HomeViewModel = hiltViewModel(), +) { Scaffold( topBar = { BackButtonTopAppBar( @@ -57,7 +67,18 @@ fun ChangeFilterScreen(navController: NavController) { ) ChangeFilteringRadioGroup( filterType = 0, - onButtonClick = { } + internFilterData = viewModel.userName.internFilter, + onButtonClick = { viewModel.setGrade(it) } + ) + + UserNameState( + userName = "남지우자랑스러운티엘이되", + internFilter = InternFilterData( + grade = 4, + workingPeriod = 1, + startYear = 2024, + startMonth = 7, + ) ) showTitle( @@ -71,9 +92,8 @@ fun ChangeFilterScreen(navController: NavController) { ) ChangeFilteringRadioGroup( filterType = 1, - modifier = Modifier - .height(36.dp), - onButtonClick = { } + internFilterData = viewModel.userName.internFilter, + onButtonClick = { viewModel.setWorkingPeriod(it) } ) showTitle( @@ -88,8 +108,8 @@ fun ChangeFilterScreen(navController: NavController) { Spacer(modifier = Modifier.weight(1f)) DatePickerUI( - chosenYear = 2024, - chosenMonth = 7, + chosenYear = currentYear, + chosenMonth = currentMonth, ) Spacer(modifier = Modifier.weight(1f)) diff --git a/feature/src/main/java/com/terning/feature/home/changefilter/component/ChangeFilteringRadioGroup.kt b/feature/src/main/java/com/terning/feature/home/changefilter/component/ChangeFilteringRadioGroup.kt index 84257cb25..ad7e222a0 100644 --- a/feature/src/main/java/com/terning/feature/home/changefilter/component/ChangeFilteringRadioGroup.kt +++ b/feature/src/main/java/com/terning/feature/home/changefilter/component/ChangeFilteringRadioGroup.kt @@ -15,10 +15,12 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp import com.terning.core.designsystem.component.button.ChangeFilterButton import com.terning.feature.R +import com.terning.feature.home.home.model.InternFilterData @Composable fun ChangeFilteringRadioGroup( filterType: Int, + internFilterData: InternFilterData?, onButtonClick: (Int) -> Unit, modifier: Modifier = Modifier, ) { @@ -38,7 +40,17 @@ fun ChangeFilteringRadioGroup( } val selectedIndex = remember { mutableIntStateOf(0) } - val selectedButton = remember { mutableStateListOf(false, false, false, false) } + var selectedButton = remember { mutableStateListOf(false, false, false, false) } + + if(filterType == 0) { + selectedButton[ + internFilterData?.grade ?: 0 + ] = true + } else { + selectedButton[ + internFilterData?.workingPeriod ?: 0 + ] = true + } LazyVerticalGrid( columns = GridCells.Fixed(options.size), diff --git a/feature/src/main/java/com/terning/feature/home/home/HomeRoute.kt b/feature/src/main/java/com/terning/feature/home/home/HomeRoute.kt index c59b90525..6049417a4 100644 --- a/feature/src/main/java/com/terning/feature/home/home/HomeRoute.kt +++ b/feature/src/main/java/com/terning/feature/home/home/HomeRoute.kt @@ -215,21 +215,27 @@ private fun ShowRecommendTitle() { @Composable private fun ShowInternFilter(userNameState: UserNameState, navController: NavHostController) { - if (userNameState.internFilter == null) { + if (userNameState.internFilter?.grade == null) { HomeFilteringScreen( - grade = R.string.home_recommend_no_filtering_hyphen, - period = R.string.home_recommend_no_filtering_hyphen, - startYear = R.string.home_recommend_no_filtering_hyphen, - startMonth = R.string.home_recommend_no_filtering_hyphen, + grade = stringResource(id = R.string.home_recommend_no_filtering_hyphen), + period = stringResource(id = R.string.home_recommend_no_filtering_hyphen), + startYear = stringResource(id = R.string.home_recommend_no_filtering_hyphen), onChangeFilterClick = { navController.navigateChangeFilter() }, ) } else { with(userNameState.internFilter) { HomeFilteringScreen( - grade = grade, - period = workingPeriod, - startYear = startYear, - startMonth = startMonth, + grade = (grade + 1).toString() + stringResource(id = R.string.home_recommend_filtering_grade), + period = stringResource( + id = when (workingPeriod) { + 0 -> R.string.filtering_status2_button1 + 1 -> R.string.filtering_status2_button2 + 2 -> R.string.filtering_status2_button3 + else -> R.string.home_recommend_no_filtering_hyphen + } + ), + startYear = startYear.toString() + stringResource(id = R.string.home_recommend_filtering_startYear) + + " " + startMonth.toString() + stringResource(id = R.string.home_recommend_filtering_startMonth), onChangeFilterClick = { navController.navigateChangeFilter() }, ) } diff --git a/feature/src/main/java/com/terning/feature/home/home/HomeViewModel.kt b/feature/src/main/java/com/terning/feature/home/home/HomeViewModel.kt index 68fd0d2f1..0cc14b5bd 100644 --- a/feature/src/main/java/com/terning/feature/home/home/HomeViewModel.kt +++ b/feature/src/main/java/com/terning/feature/home/home/HomeViewModel.kt @@ -28,7 +28,7 @@ class HomeViewModel @Inject constructor( UserNameState( userName = "남지우자랑스러운티엘이되", internFilter = InternFilterData( - grade = 4, + grade = 1, workingPeriod = 1, startYear = 2024, startMonth = 7, @@ -46,10 +46,19 @@ class HomeViewModel @Inject constructor( val scrapData get() = _scrapState.asStateFlow() private val _recommendInternState = MutableStateFlow>( -// getRecommendData() - listOf() + getRecommendData() +// listOf() ) val recommendInternData get() = _recommendInternState.asStateFlow() + + fun setGrade(grade: Int) { + userName.internFilter?.grade = grade + } + + fun setWorkingPeriod(workingPeriod: Int) { + userName.internFilter?.workingPeriod = workingPeriod + } + } private fun getScrapData(): List = listOf( diff --git a/feature/src/main/java/com/terning/feature/home/home/component/HomeFilteringScreen.kt b/feature/src/main/java/com/terning/feature/home/home/component/HomeFilteringScreen.kt index 8b9e5d385..8011d60cf 100644 --- a/feature/src/main/java/com/terning/feature/home/home/component/HomeFilteringScreen.kt +++ b/feature/src/main/java/com/terning/feature/home/home/component/HomeFilteringScreen.kt @@ -29,10 +29,9 @@ import com.terning.feature.R @Composable fun HomeFilteringScreen( - grade: Int, - period: Int, - startYear: Int, - startMonth: Int, + grade: String, + period: String, + startYear: String, onChangeFilterClick: () -> Unit, modifier: Modifier = Modifier, ) { @@ -71,29 +70,21 @@ fun HomeFilteringScreen( } HomeFilteringText( - text = grade.toString() + stringResource(id = R.string.home_recommend_filtering_grade), + text = grade, modifier = Modifier .padding(vertical = 7.dp) ) HomeFilteringDivider() HomeFilteringText( - text = stringResource( - id = when (period) { - 1 -> R.string.filtering_status2_button1 - 2 -> R.string.filtering_status2_button2 - 3 -> R.string.filtering_status2_button3 - else -> R.string.server_failure - } - ), + text = period, modifier = Modifier .padding(vertical = 7.dp) ) HomeFilteringDivider() HomeFilteringText( - text = startYear.toString() + stringResource(id = R.string.home_recommend_filtering_startYear) - + " " + startMonth.toString() + stringResource(id = R.string.home_recommend_filtering_startMonth), + text = startYear, modifier = Modifier - .padding(vertical = 7.dp) + .padding(top = 7.dp, bottom = 7.dp) ) } } diff --git a/feature/src/main/java/com/terning/feature/home/home/model/InternFilterData.kt b/feature/src/main/java/com/terning/feature/home/home/model/InternFilterData.kt index b819d24fb..894faaddd 100644 --- a/feature/src/main/java/com/terning/feature/home/home/model/InternFilterData.kt +++ b/feature/src/main/java/com/terning/feature/home/home/model/InternFilterData.kt @@ -1,8 +1,8 @@ package com.terning.feature.home.home.model data class InternFilterData( - val grade: Int, - val workingPeriod: Int, + var grade: Int, + var workingPeriod: Int, val startYear: Int, val startMonth: Int, ) From 4e7b3dc57f27e87e39d00ea9b1ca95e76eeced7d Mon Sep 17 00:00:00 2001 From: arinming Date: Mon, 15 Jul 2024 18:43:35 +0900 Subject: [PATCH 11/19] =?UTF-8?q?[FEAT/#80]=20viewModel=20=EC=83=81?= =?UTF-8?q?=ED=83=9C=EC=97=90=20existSearchResults=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../textfield/TerningBasicTextField.kt | 1 - .../com/terning/feature/main/MainNavigator.kt | 2 +- .../searchprocess/SearchProcessRoute.kt | 100 ++++++++++++------ .../searchprocess/SearchProcessViewModel.kt | 1 + .../models/SearchProcessState.kt | 1 + 5 files changed, 68 insertions(+), 37 deletions(-) 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 e73c1a3d5..5fcea5394 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 @@ -136,7 +136,6 @@ fun TerningBasicTextField( Row( verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(4.dp), - modifier = Modifier.padding(vertical = 8.dp) ) { helperIcon?.let { Icon( diff --git a/feature/src/main/java/com/terning/feature/main/MainNavigator.kt b/feature/src/main/java/com/terning/feature/main/MainNavigator.kt index f74336ff4..361fb6103 100644 --- a/feature/src/main/java/com/terning/feature/main/MainNavigator.kt +++ b/feature/src/main/java/com/terning/feature/main/MainNavigator.kt @@ -24,7 +24,7 @@ class MainNavigator( @Composable get() = navController .currentBackStackEntryAsState().value?.destination - val startDestination = SignIn + val startDestination = Search val currentTab: MainTab? @Composable get() = MainTab.find { tab -> 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 4bcedab18..3667ed39a 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 @@ -4,6 +4,7 @@ import androidx.compose.foundation.Image import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding @@ -12,8 +13,12 @@ import androidx.compose.material3.Scaffold import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.MutableState import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableIntStateOf +import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.focus.FocusRequester @@ -28,6 +33,7 @@ import androidx.hilt.navigation.compose.hiltViewModel import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.navigation.NavHostController import androidx.navigation.compose.rememberNavController +import com.terning.core.designsystem.component.button.SortingButton import com.terning.core.designsystem.component.textfield.SearchTextField import com.terning.core.designsystem.component.topappbar.BackButtonTopAppBar import com.terning.core.designsystem.theme.Grey400 @@ -43,18 +49,24 @@ private const val MAX_LINES = 1 fun SearchProcessRoute( navController: NavHostController, ) { + val currentSortBy: MutableState = remember { + mutableIntStateOf(0) + } SearchProcessScreen( navController = navController, + currentSortBy = currentSortBy ) } @Composable fun SearchProcessScreen( + currentSortBy: MutableState, modifier: Modifier = Modifier, navController: NavHostController, viewModel: SearchProcessViewModel = hiltViewModel(), ) { val state by viewModel.state.collectAsStateWithLifecycle() + var sheetState by remember { mutableStateOf(false) } val focusRequester = remember { FocusRequester() } val focusManager = LocalFocusManager.current @@ -115,51 +127,66 @@ fun SearchProcessScreen( if (state.showSearchResults) { Column( modifier = Modifier - .fillMaxWidth() - .padding(top = 87.dp), + .fillMaxWidth(), horizontalAlignment = Alignment.CenterHorizontally, verticalArrangement = Arrangement.Center ) { - Image( - painter = painterResource( - id = R.drawable.ic_nosearch - ), - contentDescription = stringResource( - id = R.string.search_process_no_result_icon + if (state.existSearchResults) { + Row( + modifier = Modifier + .fillMaxWidth(), + horizontalArrangement = Arrangement.End, + ) { + SortingButton( + sortBy = currentSortBy.value, + onCLick = { sheetState = true }, + ) + } + } else { + Spacer( + modifier = Modifier.padding(top = 87.dp) ) - ) - Row( - modifier = Modifier - .padding( - top = 16.dp, - bottom = 6.dp + Image( + painter = painterResource( + id = R.drawable.ic_nosearch + ), + contentDescription = stringResource( + id = R.string.search_process_no_result_icon ) - .fillMaxWidth(), - verticalAlignment = Alignment.CenterVertically, - horizontalArrangement = Arrangement.Center - ) { - Text( - text = state.query, - 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.query, + 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_sub), + text = stringResource( + id = R.string.search_process_no_result_text_main + ), 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, - ) } } } @@ -171,7 +198,10 @@ fun SearchProcessScreen( fun SearchProcessScreenPreview() { TerningPointTheme { SearchProcessScreen( - navController = rememberNavController() + navController = rememberNavController(), + currentSortBy = remember { + mutableIntStateOf(0) + } ) } } 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 a88196b52..32b263f2c 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 @@ -24,5 +24,6 @@ class SearchProcessViewModel @Inject constructor() : ViewModel() { fun updateShowSearchResults(show: Boolean) { _state.value = _state.value.copy(showSearchResults = show) + _state.value = _state.value.copy(existSearchResults = true) } } diff --git a/feature/src/main/java/com/terning/feature/search/searchprocess/models/SearchProcessState.kt b/feature/src/main/java/com/terning/feature/search/searchprocess/models/SearchProcessState.kt index 2f55b7287..1caf08b48 100644 --- a/feature/src/main/java/com/terning/feature/search/searchprocess/models/SearchProcessState.kt +++ b/feature/src/main/java/com/terning/feature/search/searchprocess/models/SearchProcessState.kt @@ -5,4 +5,5 @@ data class SearchProcessState( val text: String = "", val query: String = "", val showSearchResults: Boolean = false, + val existSearchResults: Boolean = false, ) \ No newline at end of file From a83db39a1c834b2a52869b6854a43c1ddb7e478a Mon Sep 17 00:00:00 2001 From: arinming Date: Mon, 15 Jul 2024 19:01:11 +0900 Subject: [PATCH 12/19] =?UTF-8?q?[FEAT/#80]=20InternItemWithShadow=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 --- .../component/item/InternItemWithShadow.kt | 42 +++++++++ .../terning/feature/home/home/HomeRoute.kt | 43 +++------ .../searchprocess/SearchProcessRoute.kt | 88 ++++++++++++++++++- 3 files changed, 141 insertions(+), 32 deletions(-) create mode 100644 core/src/main/java/com/terning/core/designsystem/component/item/InternItemWithShadow.kt diff --git a/core/src/main/java/com/terning/core/designsystem/component/item/InternItemWithShadow.kt b/core/src/main/java/com/terning/core/designsystem/component/item/InternItemWithShadow.kt new file mode 100644 index 000000000..abe0553e3 --- /dev/null +++ b/core/src/main/java/com/terning/core/designsystem/component/item/InternItemWithShadow.kt @@ -0,0 +1,42 @@ +package com.terning.core.designsystem.component.item + +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.unit.dp +import com.terning.core.designsystem.theme.Grey200 +import com.terning.core.designsystem.theme.White +import com.terning.core.extension.customShadow + +@Composable +fun InternItemWithShadow( + imageUrl: String, + title: String, + dateDeadline: String, + workingPeriod: String, + isScraped: Boolean, +) { + Box( + modifier = Modifier + .customShadow( + color = Grey200, + shadowRadius = 10.dp, + shadowWidth = 2.dp + ) + .background( + color = White, + shape = RoundedCornerShape(10.dp) + ) + ) { + InternItem( + imageUrl = imageUrl, + title = title, + dateDeadline = dateDeadline, + workingPeriod = workingPeriod, + isScraped = isScraped + ) + } +} \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/home/home/HomeRoute.kt b/feature/src/main/java/com/terning/feature/home/home/HomeRoute.kt index 4c03dd063..125357311 100644 --- a/feature/src/main/java/com/terning/feature/home/home/HomeRoute.kt +++ b/feature/src/main/java/com/terning/feature/home/home/HomeRoute.kt @@ -12,7 +12,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.foundation.shape.RoundedCornerShape import androidx.compose.material3.HorizontalDivider import androidx.compose.material3.Scaffold import androidx.compose.material3.Text @@ -30,21 +29,18 @@ import androidx.hilt.navigation.compose.hiltViewModel import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.terning.core.designsystem.component.bottomsheet.SortingBottomSheet import com.terning.core.designsystem.component.button.SortingButton -import com.terning.core.designsystem.component.item.InternItem +import com.terning.core.designsystem.component.item.InternItemWithShadow import com.terning.core.designsystem.component.topappbar.LogoTopAppBar import com.terning.core.designsystem.theme.Black import com.terning.core.designsystem.theme.Grey150 -import com.terning.core.designsystem.theme.Grey200 import com.terning.core.designsystem.theme.TerningTheme import com.terning.core.designsystem.theme.White -import com.terning.core.extension.customShadow import com.terning.feature.R import com.terning.feature.home.home.component.HomeFilteringEmptyIntern import com.terning.feature.home.home.component.HomeFilteringScreen import com.terning.feature.home.home.component.HomeRecommendEmptyIntern import com.terning.feature.home.home.component.HomeTodayEmptyIntern import com.terning.feature.home.home.component.HomeTodayIntern -import com.terning.feature.home.home.model.RecommendInternData import com.terning.feature.home.home.model.UserNameState import com.terning.feature.home.home.model.UserScrapState @@ -140,7 +136,17 @@ fun HomeScreen( if (userNameState.internFilter != null && recommendInternData.isNotEmpty()) { items(recommendInternData.size) { index -> - ShowRecommendIntern(recommendInternData[index]) + Box( + modifier = Modifier.padding(horizontal = 24.dp) + ) { + InternItemWithShadow( + imageUrl = recommendInternData[index].imgUrl, + title = recommendInternData[index].title, + dateDeadline = recommendInternData[index].dDay.toString(), + workingPeriod = recommendInternData[index].workingPeriod.toString(), + isScraped = recommendInternData[index].isScrapped, + ) + } } } } @@ -227,29 +233,4 @@ private fun ShowInternFilter(userNameState: UserNameState) { ) } } -} - -@Composable -private fun ShowRecommendIntern(recommendInternData: RecommendInternData) { - Box( - modifier = Modifier - .padding(horizontal = 24.dp) - .customShadow( - color = Grey200, - shadowRadius = 10.dp, - shadowWidth = 2.dp - ) - .background( - color = White, - shape = RoundedCornerShape(10.dp) - ) - ) { - InternItem( - imageUrl = recommendInternData.imgUrl, - title = recommendInternData.title, - dateDeadline = recommendInternData.dDay.toString(), - workingPeriod = recommendInternData.workingPeriod.toString(), - isScraped = recommendInternData.isScrapped, - ) - } } \ No newline at end of file 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 3667ed39a..8e60a6901 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 @@ -3,12 +3,14 @@ package com.terning.feature.search.searchprocess import androidx.compose.foundation.Image import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize 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 @@ -34,6 +36,7 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.navigation.NavHostController import androidx.navigation.compose.rememberNavController import com.terning.core.designsystem.component.button.SortingButton +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.Grey400 @@ -42,6 +45,7 @@ import com.terning.core.designsystem.theme.TerningPointTheme import com.terning.core.designsystem.theme.TerningTheme import com.terning.core.extension.addFocusCleaner import com.terning.feature.R +import com.terning.feature.home.home.model.RecommendInternData private const val MAX_LINES = 1 @@ -67,7 +71,71 @@ fun SearchProcessScreen( ) { val state by viewModel.state.collectAsStateWithLifecycle() var sheetState by remember { mutableStateOf(false) } - + val recommendState: List = listOf( + RecommendInternData( + imgUrl = "https://reqres.in/img/faces/7-image.jpg", + title = "[유한킴벌리] 그린캠프 w.대학생 숲 활동가", + dDay = 22, + workingPeriod = 2, + isScrapped = true, + ), + RecommendInternData( + imgUrl = "https://reqres.in/img/faces/7-image.jpg", + title = "ㅇㄻㅇㅁㄻㄹㅇㅁㅇㄹ", + dDay = 9, + workingPeriod = 6, + isScrapped = false, + ), + RecommendInternData( + imgUrl = "https://reqres.in/img/faces/7-image.jpg", + title = "[유한킴벌리] 그린캠프 w.대학생 숲 활동가", + dDay = 2, + workingPeriod = 4, + isScrapped = true, + ), + RecommendInternData( + imgUrl = "https://reqres.in/img/faces/7-image.jpg", + title = "[유한킴벌리] 그린캠프 w.대학생 숲 활동가", + dDay = 22, + workingPeriod = 2, + isScrapped = true, + ), + RecommendInternData( + imgUrl = "https://reqres.in/img/faces/7-image.jpg", + title = "ㅇㄻㅇㅁㄻㄹㅇㅁㅇㄹ", + dDay = 9, + workingPeriod = 6, + isScrapped = false, + ), + RecommendInternData( + imgUrl = "https://reqres.in/img/faces/7-image.jpg", + title = "[유한킴벌리] 그린캠프 w.대학생 숲 활동가", + dDay = 2, + workingPeriod = 4, + isScrapped = true, + ), + RecommendInternData( + imgUrl = "https://reqres.in/img/faces/7-image.jpg", + title = "[유한킴벌리] 그린캠프 w.대학생 숲 활동가", + dDay = 22, + workingPeriod = 2, + isScrapped = true, + ), + RecommendInternData( + imgUrl = "https://reqres.in/img/faces/7-image.jpg", + title = "ㅇㄻㅇㅁㄻㄹㅇㅁㅇㄹ", + dDay = 9, + workingPeriod = 6, + isScrapped = false, + ), + RecommendInternData( + imgUrl = "https://reqres.in/img/faces/7-image.jpg", + title = "[유한킴벌리] 그린캠프 w.대학생 숲 활동가", + dDay = 2, + workingPeriod = 4, + isScrapped = true, + ), + ) val focusRequester = remember { FocusRequester() } val focusManager = LocalFocusManager.current @@ -142,6 +210,24 @@ fun SearchProcessScreen( onCLick = { sheetState = true }, ) } + LazyColumn( + contentPadding = PaddingValues( + top = 12.dp, + bottom = 20.dp, + ), + verticalArrangement = Arrangement.spacedBy(12.dp) + ) { + items(recommendState.size) { index -> + InternItemWithShadow( + imageUrl = recommendState[index].imgUrl, + title = recommendState[index].title, + dateDeadline = recommendState[index].dDay.toString(), + workingPeriod = recommendState[index].workingPeriod.toString(), + isScraped = recommendState[index].isScrapped + ) + } + } + } else { Spacer( modifier = Modifier.padding(top = 87.dp) From cf7c1d35c9aabdd45fe0a1a7cf6f8471e7eaa206 Mon Sep 17 00:00:00 2001 From: arinming Date: Mon, 15 Jul 2024 19:04:21 +0900 Subject: [PATCH 13/19] =?UTF-8?q?[DELETE/#80]=20ic=5Fnosearch=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C=20=EB=B0=8F=20ic=5Fempty=5Flogo=EB=A1=9C=20=EB=8C=80?= =?UTF-8?q?=EC=B2=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/item/InternItemWithShadow.kt | 3 +-- .../feature/intern/component/InternCompanyInfo.kt | 2 +- .../feature/search/searchprocess/SearchProcessRoute.kt | 2 +- feature/src/main/res/drawable/ic_nosearch.xml | 10 ---------- 4 files changed, 3 insertions(+), 14 deletions(-) delete mode 100644 feature/src/main/res/drawable/ic_nosearch.xml diff --git a/core/src/main/java/com/terning/core/designsystem/component/item/InternItemWithShadow.kt b/core/src/main/java/com/terning/core/designsystem/component/item/InternItemWithShadow.kt index abe0553e3..f16382734 100644 --- a/core/src/main/java/com/terning/core/designsystem/component/item/InternItemWithShadow.kt +++ b/core/src/main/java/com/terning/core/designsystem/component/item/InternItemWithShadow.kt @@ -2,7 +2,6 @@ package com.terning.core.designsystem.component.item import androidx.compose.foundation.background import androidx.compose.foundation.layout.Box -import androidx.compose.foundation.layout.padding import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier @@ -24,7 +23,7 @@ fun InternItemWithShadow( .customShadow( color = Grey200, shadowRadius = 10.dp, - shadowWidth = 2.dp + shadowWidth = 2.dp, ) .background( color = White, diff --git a/feature/src/main/java/com/terning/feature/intern/component/InternCompanyInfo.kt b/feature/src/main/java/com/terning/feature/intern/component/InternCompanyInfo.kt index ed50ea608..4c5974242 100644 --- a/feature/src/main/java/com/terning/feature/intern/component/InternCompanyInfo.kt +++ b/feature/src/main/java/com/terning/feature/intern/component/InternCompanyInfo.kt @@ -54,7 +54,7 @@ fun InternCompanyInfo(modifier: Modifier) { ) { Image( painter = painterResource( - id = R.drawable.ic_nosearch + id = R.drawable.ic_empty_logo ), modifier = modifier.fillMaxWidth(), contentDescription = null, 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 8e60a6901..ab48462f0 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 @@ -234,7 +234,7 @@ fun SearchProcessScreen( ) Image( painter = painterResource( - id = R.drawable.ic_nosearch + id = R.drawable.ic_empty_logo ), contentDescription = stringResource( id = R.string.search_process_no_result_icon diff --git a/feature/src/main/res/drawable/ic_nosearch.xml b/feature/src/main/res/drawable/ic_nosearch.xml deleted file mode 100644 index c63bd8fb7..000000000 --- a/feature/src/main/res/drawable/ic_nosearch.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - From 96069ffd09e3ed4df46530b4e6a7be0dc65675b7 Mon Sep 17 00:00:00 2001 From: arinming Date: Mon, 15 Jul 2024 19:17:32 +0900 Subject: [PATCH 14/19] =?UTF-8?q?[FEAT/#80]=20=EA=B2=80=EC=83=89=20?= =?UTF-8?q?=EA=B2=B0=EA=B3=BC=EC=97=90=20=EB=94=B0=EB=A5=B8=20=EB=B7=B0=20?= =?UTF-8?q?=EB=9D=84=EC=9A=B0=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../feature/home/home/HomeViewModel.kt | 26 +++--- .../{RecommendInternData.kt => InternData.kt} | 2 +- .../searchprocess/SearchProcessRoute.kt | 93 +++++-------------- .../searchprocess/SearchProcessViewModel.kt | 88 ++++++++++++++++++ .../models/SearchProcessState.kt | 3 + 5 files changed, 126 insertions(+), 86 deletions(-) rename feature/src/main/java/com/terning/feature/home/home/model/{RecommendInternData.kt => InternData.kt} (84%) diff --git a/feature/src/main/java/com/terning/feature/home/home/HomeViewModel.kt b/feature/src/main/java/com/terning/feature/home/home/HomeViewModel.kt index 68fd0d2f1..8ed636ae3 100644 --- a/feature/src/main/java/com/terning/feature/home/home/HomeViewModel.kt +++ b/feature/src/main/java/com/terning/feature/home/home/HomeViewModel.kt @@ -11,7 +11,7 @@ import com.terning.core.designsystem.theme.CalOrange1 import com.terning.core.designsystem.theme.CalPink import com.terning.core.designsystem.theme.CalYellow import com.terning.feature.home.home.model.InternFilterData -import com.terning.feature.home.home.model.RecommendInternData +import com.terning.feature.home.home.model.InternData import com.terning.feature.home.home.model.ScrapData import com.terning.feature.home.home.model.UserNameState import com.terning.feature.home.home.model.UserScrapState @@ -45,7 +45,7 @@ class HomeViewModel @Inject constructor( ) val scrapData get() = _scrapState.asStateFlow() - private val _recommendInternState = MutableStateFlow>( + private val _recommendInternState = MutableStateFlow>( // getRecommendData() listOf() ) @@ -103,71 +103,71 @@ private fun getScrapData(): List = listOf( ), ) -private fun getRecommendData(): List = listOf( - RecommendInternData( +private fun getRecommendData(): List = listOf( + InternData( imgUrl = "https://reqres.in/img/faces/7-image.jpg", title = "[유한킴벌리] 그린캠프 w.대학생 숲 활동가", dDay = 22, workingPeriod = 2, isScrapped = true, ), - RecommendInternData( + InternData( imgUrl = "https://reqres.in/img/faces/7-image.jpg", title = "ㅇㄻㅇㅁㄻㄹㅇㅁㅇㄹ", dDay = 9, workingPeriod = 6, isScrapped = false, ), - RecommendInternData( + InternData( imgUrl = "https://reqres.in/img/faces/7-image.jpg", title = "[유한킴벌리] 그린캠프 w.대학생 숲 활동가", dDay = 2, workingPeriod = 4, isScrapped = true, ), - RecommendInternData( + InternData( imgUrl = "https://reqres.in/img/faces/7-image.jpg", title = "[유한킴벌리] 그린캠프 w.대학생 숲 활동가", dDay = 2, workingPeriod = 4, isScrapped = false, ), - RecommendInternData( + InternData( imgUrl = "https://reqres.in/img/faces/7-image.jpg", title = "[유한킴벌리] 그린캠프 w.대학생 숲 활동가", dDay = 2, workingPeriod = 4, isScrapped = true, ), - RecommendInternData( + InternData( imgUrl = "https://reqres.in/img/faces/7-image.jpg", title = "[유한킴벌리] 그린캠프 w.대학생 숲 활동가", dDay = 2, workingPeriod = 4, isScrapped = true, ), - RecommendInternData( + InternData( imgUrl = "https://reqres.in/img/faces/7-image.jpg", title = "[유한킴벌리] 그린캠프 w.대학생 숲 활동가", dDay = 2, workingPeriod = 4, isScrapped = false, ), - RecommendInternData( + InternData( imgUrl = "https://reqres.in/img/faces/7-image.jpg", title = "[유한킴벌리] 그린캠프 w.대학생 숲 활동가", dDay = 2, workingPeriod = 4, isScrapped = true, ), - RecommendInternData( + InternData( imgUrl = "https://reqres.in/img/faces/7-image.jpg", title = "[유한킴벌리] 그린캠프 w.대학생 숲 활동가", dDay = 2, workingPeriod = 4, isScrapped = false, ), - RecommendInternData( + InternData( imgUrl = "https://reqres.in/img/faces/7-image.jpg", title = "[유한킴벌리] 그린캠프 w.대학생 숲 활동가", dDay = 2, diff --git a/feature/src/main/java/com/terning/feature/home/home/model/RecommendInternData.kt b/feature/src/main/java/com/terning/feature/home/home/model/InternData.kt similarity index 84% rename from feature/src/main/java/com/terning/feature/home/home/model/RecommendInternData.kt rename to feature/src/main/java/com/terning/feature/home/home/model/InternData.kt index 5b84c180a..4beafb192 100644 --- a/feature/src/main/java/com/terning/feature/home/home/model/RecommendInternData.kt +++ b/feature/src/main/java/com/terning/feature/home/home/model/InternData.kt @@ -1,6 +1,6 @@ package com.terning.feature.home.home.model -data class RecommendInternData( +data class InternData( val imgUrl: String, val title: String, val dDay: Int, 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 ab48462f0..4f0c46e4c 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 @@ -35,6 +35,7 @@ import androidx.hilt.navigation.compose.hiltViewModel import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.navigation.NavHostController import androidx.navigation.compose.rememberNavController +import com.terning.core.designsystem.component.bottomsheet.SortingBottomSheet import com.terning.core.designsystem.component.button.SortingButton import com.terning.core.designsystem.component.item.InternItemWithShadow import com.terning.core.designsystem.component.textfield.SearchTextField @@ -45,7 +46,6 @@ import com.terning.core.designsystem.theme.TerningPointTheme import com.terning.core.designsystem.theme.TerningTheme import com.terning.core.extension.addFocusCleaner import com.terning.feature.R -import com.terning.feature.home.home.model.RecommendInternData private const val MAX_LINES = 1 @@ -71,71 +71,19 @@ fun SearchProcessScreen( ) { val state by viewModel.state.collectAsStateWithLifecycle() var sheetState by remember { mutableStateOf(false) } - val recommendState: List = listOf( - RecommendInternData( - imgUrl = "https://reqres.in/img/faces/7-image.jpg", - title = "[유한킴벌리] 그린캠프 w.대학생 숲 활동가", - dDay = 22, - workingPeriod = 2, - isScrapped = true, - ), - RecommendInternData( - imgUrl = "https://reqres.in/img/faces/7-image.jpg", - title = "ㅇㄻㅇㅁㄻㄹㅇㅁㅇㄹ", - dDay = 9, - workingPeriod = 6, - isScrapped = false, - ), - RecommendInternData( - imgUrl = "https://reqres.in/img/faces/7-image.jpg", - title = "[유한킴벌리] 그린캠프 w.대학생 숲 활동가", - dDay = 2, - workingPeriod = 4, - isScrapped = true, - ), - RecommendInternData( - imgUrl = "https://reqres.in/img/faces/7-image.jpg", - title = "[유한킴벌리] 그린캠프 w.대학생 숲 활동가", - dDay = 22, - workingPeriod = 2, - isScrapped = true, - ), - RecommendInternData( - imgUrl = "https://reqres.in/img/faces/7-image.jpg", - title = "ㅇㄻㅇㅁㄻㄹㅇㅁㅇㄹ", - dDay = 9, - workingPeriod = 6, - isScrapped = false, - ), - RecommendInternData( - imgUrl = "https://reqres.in/img/faces/7-image.jpg", - title = "[유한킴벌리] 그린캠프 w.대학생 숲 활동가", - dDay = 2, - workingPeriod = 4, - isScrapped = true, - ), - RecommendInternData( - imgUrl = "https://reqres.in/img/faces/7-image.jpg", - title = "[유한킴벌리] 그린캠프 w.대학생 숲 활동가", - dDay = 22, - workingPeriod = 2, - isScrapped = true, - ), - RecommendInternData( - imgUrl = "https://reqres.in/img/faces/7-image.jpg", - title = "ㅇㄻㅇㅁㄻㄹㅇㅁㅇㄹ", - dDay = 9, - workingPeriod = 6, - isScrapped = false, - ), - RecommendInternData( - imgUrl = "https://reqres.in/img/faces/7-image.jpg", - title = "[유한킴벌리] 그린캠프 w.대학생 숲 활동가", - dDay = 2, - workingPeriod = 4, - isScrapped = true, - ), - ) + val internSearchResultData by viewModel.internSearchResultData.collectAsStateWithLifecycle() + + + if (sheetState) { + SortingBottomSheet( + onDismiss = { + sheetState = false + }, + currentSortBy = currentSortBy.value, + newSortBy = currentSortBy + ) + } + val focusRequester = remember { FocusRequester() } val focusManager = LocalFocusManager.current @@ -189,6 +137,7 @@ fun SearchProcessScreen( onDoneAction = { viewModel.updateQuery(state.text) viewModel.updateShowSearchResults(true) + viewModel.updateExistSearchResults(state.text) } ) @@ -217,13 +166,13 @@ fun SearchProcessScreen( ), verticalArrangement = Arrangement.spacedBy(12.dp) ) { - items(recommendState.size) { index -> + items(internSearchResultData.size) { index -> InternItemWithShadow( - imageUrl = recommendState[index].imgUrl, - title = recommendState[index].title, - dateDeadline = recommendState[index].dDay.toString(), - workingPeriod = recommendState[index].workingPeriod.toString(), - isScraped = recommendState[index].isScrapped + imageUrl = internSearchResultData[index].imgUrl, + title = internSearchResultData[index].title, + dateDeadline = internSearchResultData[index].dDay.toString(), + workingPeriod = internSearchResultData[index].workingPeriod.toString(), + isScraped = internSearchResultData[index].isScrapped ) } } 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 32b263f2c..103bb6f84 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 @@ -1,10 +1,12 @@ package com.terning.feature.search.searchprocess import androidx.lifecycle.ViewModel +import com.terning.feature.home.home.model.InternData import com.terning.feature.search.searchprocess.models.SearchProcessState import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow +import kotlinx.coroutines.flow.asStateFlow import javax.inject.Inject @HiltViewModel @@ -14,6 +16,11 @@ class SearchProcessViewModel @Inject constructor() : ViewModel() { val state: StateFlow get() = _state + private val _internSearchResultState = MutableStateFlow( + getRecommendData() + ) + val internSearchResultData get() = _internSearchResultState.asStateFlow() + fun updateText(newText: String) { _state.value = _state.value.copy(text = newText) } @@ -26,4 +33,85 @@ class SearchProcessViewModel @Inject constructor() : ViewModel() { _state.value = _state.value.copy(showSearchResults = show) _state.value = _state.value.copy(existSearchResults = true) } + + + fun updateExistSearchResults(query: String) { + val exist = + _internSearchResultState.value.any { it.title.contains(query, ignoreCase = true) } + _state.value = _state.value.copy(existSearchResults = exist) + } } + + +private fun getRecommendData(): List = listOf( + InternData( + imgUrl = "https://reqres.in/img/faces/7-image.jpg", + title = "[유한킴벌리] 그린캠프 w.대학생 숲 활동가", + dDay = 22, + workingPeriod = 2, + isScrapped = true, + ), + InternData( + imgUrl = "https://reqres.in/img/faces/7-image.jpg", + title = "ㅇㄻㅇㅁㄻㄹㅇㅁㅇㄹ", + dDay = 9, + workingPeriod = 6, + isScrapped = false, + ), + InternData( + imgUrl = "https://reqres.in/img/faces/7-image.jpg", + title = "[유한킴벌리] 그린캠프 w.대학생 숲 활동가", + dDay = 2, + workingPeriod = 4, + isScrapped = true, + ), + InternData( + imgUrl = "https://reqres.in/img/faces/7-image.jpg", + title = "[유한킴벌리] 그린캠프 w.대학생 숲 활동가", + dDay = 2, + workingPeriod = 4, + isScrapped = false, + ), + InternData( + imgUrl = "https://reqres.in/img/faces/7-image.jpg", + title = "[유한킴벌리] 그린캠프 w.대학생 숲 활동가", + dDay = 2, + workingPeriod = 4, + isScrapped = true, + ), + InternData( + imgUrl = "https://reqres.in/img/faces/7-image.jpg", + title = "[유한킴벌리] 그린캠프 w.대학생 숲 활동가", + dDay = 2, + workingPeriod = 4, + isScrapped = true, + ), + InternData( + imgUrl = "https://reqres.in/img/faces/7-image.jpg", + title = "[유한킴벌리] 그린캠프 w.대학생 숲 활동가", + dDay = 2, + workingPeriod = 4, + isScrapped = false, + ), + InternData( + imgUrl = "https://reqres.in/img/faces/7-image.jpg", + title = "[유한킴벌리] 그린캠프 w.대학생 숲 활동가", + dDay = 2, + workingPeriod = 4, + isScrapped = true, + ), + InternData( + imgUrl = "https://reqres.in/img/faces/7-image.jpg", + title = "[유한킴벌리] 그린캠프 w.대학생 숲 활동가", + dDay = 2, + workingPeriod = 4, + isScrapped = false, + ), + InternData( + imgUrl = "https://reqres.in/img/faces/7-image.jpg", + title = "[유한킴벌리] 그린캠프 w.대학생 숲 활동가", + dDay = 2, + workingPeriod = 4, + isScrapped = true, + ), +) \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/search/searchprocess/models/SearchProcessState.kt b/feature/src/main/java/com/terning/feature/search/searchprocess/models/SearchProcessState.kt index 1caf08b48..f00b0f1ca 100644 --- a/feature/src/main/java/com/terning/feature/search/searchprocess/models/SearchProcessState.kt +++ b/feature/src/main/java/com/terning/feature/search/searchprocess/models/SearchProcessState.kt @@ -1,9 +1,12 @@ package com.terning.feature.search.searchprocess.models +import com.terning.feature.home.home.model.InternData + data class SearchProcessState( val text: String = "", val query: String = "", val showSearchResults: Boolean = false, val existSearchResults: Boolean = false, + val searchResults: List = emptyList(), ) \ No newline at end of file From 89fd781cc5be629e189e3266ee59e0f4f2ea6299 Mon Sep 17 00:00:00 2001 From: arinming Date: Mon, 15 Jul 2024 19:22:08 +0900 Subject: [PATCH 15/19] =?UTF-8?q?[FEAT/#80]=20=EA=B2=BD=EB=A1=9C=20?= =?UTF-8?q?=EC=B4=88=EA=B8=B0=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- feature/src/main/java/com/terning/feature/main/MainNavigator.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feature/src/main/java/com/terning/feature/main/MainNavigator.kt b/feature/src/main/java/com/terning/feature/main/MainNavigator.kt index 361fb6103..f74336ff4 100644 --- a/feature/src/main/java/com/terning/feature/main/MainNavigator.kt +++ b/feature/src/main/java/com/terning/feature/main/MainNavigator.kt @@ -24,7 +24,7 @@ class MainNavigator( @Composable get() = navController .currentBackStackEntryAsState().value?.destination - val startDestination = Search + val startDestination = SignIn val currentTab: MainTab? @Composable get() = MainTab.find { tab -> From dfd0c0bfb9977f42c73e689d8a181c1af976a289 Mon Sep 17 00:00:00 2001 From: Hyobeen-Park Date: Mon, 15 Jul 2024 23:47:45 +0900 Subject: [PATCH 16/19] =?UTF-8?q?[CHORE/#51]=20=ED=95=A8=EC=88=98=EB=AA=85?= =?UTF-8?q?=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../feature/home/changefilter/ChangeFilterRoute.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/feature/src/main/java/com/terning/feature/home/changefilter/ChangeFilterRoute.kt b/feature/src/main/java/com/terning/feature/home/changefilter/ChangeFilterRoute.kt index 166a0d3b8..643857488 100644 --- a/feature/src/main/java/com/terning/feature/home/changefilter/ChangeFilterRoute.kt +++ b/feature/src/main/java/com/terning/feature/home/changefilter/ChangeFilterRoute.kt @@ -56,7 +56,7 @@ fun ChangeFilterScreen( top = paddingValues.calculateTopPadding(), ) ) { - showTitle( + ShowTitle( mainTitle = stringResource(id = R.string.change_filter_grade_main), subTitle = stringResource(id = R.string.filtering_status1_sub), modifier = Modifier.padding( @@ -81,7 +81,7 @@ fun ChangeFilterScreen( ) ) - showTitle( + ShowTitle( mainTitle = stringResource(id = R.string.filtering_status2_title), subTitle = stringResource(id = R.string.filtering_status2_sub), modifier = Modifier.padding( @@ -96,7 +96,7 @@ fun ChangeFilterScreen( onButtonClick = { viewModel.setWorkingPeriod(it) } ) - showTitle( + ShowTitle( mainTitle = stringResource(id = R.string.filtering_status3_title), subTitle = stringResource(id = R.string.filtering_status3_sub), modifier = Modifier.padding( @@ -126,7 +126,7 @@ fun ChangeFilterScreen( } @Composable -private fun showTitle( +private fun ShowTitle( mainTitle: String, subTitle: String, modifier: Modifier = Modifier, From 76e30b2f1bc1c72ba3c82721e6195f0542ea9e4d Mon Sep 17 00:00:00 2001 From: Hyobeen-Park Date: Mon, 15 Jul 2024 23:55:10 +0900 Subject: [PATCH 17/19] =?UTF-8?q?[MOD/#51]=20navController=20HomeRoute?= =?UTF-8?q?=EB=A1=9C=20=EC=9D=B4=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/terning/feature/home/home/HomeRoute.kt | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/feature/src/main/java/com/terning/feature/home/home/HomeRoute.kt b/feature/src/main/java/com/terning/feature/home/home/HomeRoute.kt index 6049417a4..e35492375 100644 --- a/feature/src/main/java/com/terning/feature/home/home/HomeRoute.kt +++ b/feature/src/main/java/com/terning/feature/home/home/HomeRoute.kt @@ -60,14 +60,17 @@ fun HomeRoute( val currentSortBy: MutableState = remember { mutableIntStateOf(0) } - HomeScreen(currentSortBy, navController) + HomeScreen( + currentSortBy, + onChangeFilterClick = { navController.navigateChangeFilter() } + ) } @OptIn(ExperimentalFoundationApi::class) @Composable fun HomeScreen( currentSortBy: MutableState, - navController: NavHostController, + onChangeFilterClick: () -> Unit, viewModel: HomeViewModel = hiltViewModel(), ) { val userNameState = viewModel.userName @@ -118,7 +121,7 @@ fun HomeScreen( .background(White) ) { ShowRecommendTitle() - ShowInternFilter(userNameState = userNameState, navController) + ShowInternFilter(userNameState = userNameState, onChangeFilterClick) HorizontalDivider( thickness = 4.dp, @@ -214,13 +217,13 @@ private fun ShowRecommendTitle() { } @Composable -private fun ShowInternFilter(userNameState: UserNameState, navController: NavHostController) { +private fun ShowInternFilter(userNameState: UserNameState, onChangeFilterClick: () -> Unit) { if (userNameState.internFilter?.grade == null) { HomeFilteringScreen( grade = stringResource(id = R.string.home_recommend_no_filtering_hyphen), period = stringResource(id = R.string.home_recommend_no_filtering_hyphen), startYear = stringResource(id = R.string.home_recommend_no_filtering_hyphen), - onChangeFilterClick = { navController.navigateChangeFilter() }, + onChangeFilterClick = { onChangeFilterClick() }, ) } else { with(userNameState.internFilter) { @@ -236,7 +239,7 @@ private fun ShowInternFilter(userNameState: UserNameState, navController: NavHos ), startYear = startYear.toString() + stringResource(id = R.string.home_recommend_filtering_startYear) + " " + startMonth.toString() + stringResource(id = R.string.home_recommend_filtering_startMonth), - onChangeFilterClick = { navController.navigateChangeFilter() }, + onChangeFilterClick = { onChangeFilterClick() }, ) } } From 8d02b6b3b13aabd9905eceba83a3545cee68d3dc Mon Sep 17 00:00:00 2001 From: Hyobeen-Park Date: Mon, 15 Jul 2024 23:57:44 +0900 Subject: [PATCH 18/19] =?UTF-8?q?[CHORE/#51]=20=EC=BD=94=EB=93=9C=20?= =?UTF-8?q?=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../home/changefilter/component/ChangeFilteringRadioGroup.kt | 4 ++-- .../main/java/com/terning/feature/home/home/HomeViewModel.kt | 1 - .../src/main/java/com/terning/feature/main/MainNavigator.kt | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/feature/src/main/java/com/terning/feature/home/changefilter/component/ChangeFilteringRadioGroup.kt b/feature/src/main/java/com/terning/feature/home/changefilter/component/ChangeFilteringRadioGroup.kt index ad7e222a0..ca60a3b12 100644 --- a/feature/src/main/java/com/terning/feature/home/changefilter/component/ChangeFilteringRadioGroup.kt +++ b/feature/src/main/java/com/terning/feature/home/changefilter/component/ChangeFilteringRadioGroup.kt @@ -42,7 +42,7 @@ fun ChangeFilteringRadioGroup( val selectedIndex = remember { mutableIntStateOf(0) } var selectedButton = remember { mutableStateListOf(false, false, false, false) } - if(filterType == 0) { + if (filterType == 0) { selectedButton[ internFilterData?.grade ?: 0 ] = true @@ -55,7 +55,7 @@ fun ChangeFilteringRadioGroup( LazyVerticalGrid( columns = GridCells.Fixed(options.size), horizontalArrangement = Arrangement.spacedBy(12.dp), - modifier = Modifier + modifier = modifier .fillMaxWidth() .wrapContentHeight() .padding(horizontal = 24.dp) diff --git a/feature/src/main/java/com/terning/feature/home/home/HomeViewModel.kt b/feature/src/main/java/com/terning/feature/home/home/HomeViewModel.kt index 0cc14b5bd..00dbb12f9 100644 --- a/feature/src/main/java/com/terning/feature/home/home/HomeViewModel.kt +++ b/feature/src/main/java/com/terning/feature/home/home/HomeViewModel.kt @@ -47,7 +47,6 @@ class HomeViewModel @Inject constructor( private val _recommendInternState = MutableStateFlow>( getRecommendData() -// listOf() ) val recommendInternData get() = _recommendInternState.asStateFlow() diff --git a/feature/src/main/java/com/terning/feature/main/MainNavigator.kt b/feature/src/main/java/com/terning/feature/main/MainNavigator.kt index 1b50c7d23..b538c3e58 100644 --- a/feature/src/main/java/com/terning/feature/main/MainNavigator.kt +++ b/feature/src/main/java/com/terning/feature/main/MainNavigator.kt @@ -10,9 +10,9 @@ import androidx.navigation.compose.currentBackStackEntryAsState import androidx.navigation.compose.rememberNavController import androidx.navigation.navOptions import com.terning.feature.calendar.navigation.navigateCalendar -import com.terning.feature.home.home.navigation.Home import com.terning.feature.home.home.navigation.navigateHome import com.terning.feature.mypage.navigation.navigateMyPage +import com.terning.feature.onboarding.signin.navigation.SignIn import com.terning.feature.search.search.navigation.navigateSearch class MainNavigator( @@ -22,7 +22,7 @@ class MainNavigator( @Composable get() = navController .currentBackStackEntryAsState().value?.destination - val startDestination = Home + val startDestination = SignIn val currentTab: MainTab? @Composable get() = MainTab.find { tab -> From 12a396e891289d6e80f9b582c5d79fc48a596d58 Mon Sep 17 00:00:00 2001 From: arinming Date: Tue, 16 Jul 2024 00:25:56 +0900 Subject: [PATCH 19/19] =?UTF-8?q?[REFACTOR/#80]=20=EC=A4=84=EB=B0=94?= =?UTF-8?q?=EA=BF=88=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/terning/feature/home/home/HomeViewModel.kt | 6 +++--- .../src/main/java/com/terning/feature/main/MainNavigator.kt | 2 +- .../java/com/terning/feature/search/search/SearchRoute.kt | 1 - .../feature/search/searchprocess/SearchProcessRoute.kt | 2 -- .../feature/search/searchprocess/SearchProcessViewModel.kt | 1 - 5 files changed, 4 insertions(+), 8 deletions(-) diff --git a/feature/src/main/java/com/terning/feature/home/home/HomeViewModel.kt b/feature/src/main/java/com/terning/feature/home/home/HomeViewModel.kt index 7a1a88d0e..94e29b4f7 100644 --- a/feature/src/main/java/com/terning/feature/home/home/HomeViewModel.kt +++ b/feature/src/main/java/com/terning/feature/home/home/HomeViewModel.kt @@ -24,7 +24,7 @@ import javax.inject.Inject class HomeViewModel @Inject constructor( ) : ViewModel() { - private val _userName by mutableStateOf( + private val _userName by mutableStateOf( UserNameState( userName = "남지우자랑스러운티엘이되", internFilter = InternFilterData( @@ -37,7 +37,7 @@ class HomeViewModel @Inject constructor( ) val userName get() = _userName - private val _scrapState = MutableStateFlow( + private val _scrapState = MutableStateFlow( UserScrapState( isScrapExist = true, scrapData = getScrapData() @@ -45,7 +45,7 @@ class HomeViewModel @Inject constructor( ) val scrapData get() = _scrapState.asStateFlow() - private val _recommendInternState = MutableStateFlow>( + private val _recommendInternState = MutableStateFlow( getRecommendData() ) val recommendInternData get() = _recommendInternState.asStateFlow() diff --git a/feature/src/main/java/com/terning/feature/main/MainNavigator.kt b/feature/src/main/java/com/terning/feature/main/MainNavigator.kt index f74336ff4..361fb6103 100644 --- a/feature/src/main/java/com/terning/feature/main/MainNavigator.kt +++ b/feature/src/main/java/com/terning/feature/main/MainNavigator.kt @@ -24,7 +24,7 @@ class MainNavigator( @Composable get() = navController .currentBackStackEntryAsState().value?.destination - val startDestination = SignIn + val startDestination = Search val currentTab: MainTab? @Composable get() = MainTab.find { tab -> 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 67e792d95..17becd309 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 @@ -100,5 +100,4 @@ fun SearchScreen( SearchInternList(type = InternListType.SCRAP) } } - } 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 4f0c46e4c..26d84657b 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 @@ -73,7 +73,6 @@ fun SearchProcessScreen( var sheetState by remember { mutableStateOf(false) } val internSearchResultData by viewModel.internSearchResultData.collectAsStateWithLifecycle() - if (sheetState) { SortingBottomSheet( onDismiss = { @@ -176,7 +175,6 @@ fun SearchProcessScreen( ) } } - } else { Spacer( modifier = Modifier.padding(top = 87.dp) 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 103bb6f84..589f3106a 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 @@ -42,7 +42,6 @@ class SearchProcessViewModel @Inject constructor() : ViewModel() { } } - private fun getRecommendData(): List = listOf( InternData( imgUrl = "https://reqres.in/img/faces/7-image.jpg",