From a9861ef0734f1828c1e99b3bcbf5e0814ff5a7fe Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Fri, 12 Jul 2024 00:32:38 +0900 Subject: [PATCH 01/26] =?UTF-8?q?[UI/#48]=20StartScreen=20UI=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/terning/feature/main/MainNavigator.kt | 3 +- .../com/terning/feature/main/MainScreen.kt | 2 + .../feature/onboarding/splash/SplashScreen.kt | 8 +++ .../feature/onboarding/start/StartScreen.kt | 52 ++++++++++++++++++ .../start/navigation/StartNavigation.kt | 28 ++++++++++ feature/src/main/res/drawable/img_start.png | Bin 0 -> 18386 bytes feature/src/main/res/values/strings.xml | 5 ++ 7 files changed, 97 insertions(+), 1 deletion(-) create mode 100644 feature/src/main/java/com/terning/feature/onboarding/splash/SplashScreen.kt create mode 100644 feature/src/main/java/com/terning/feature/onboarding/start/StartScreen.kt create mode 100644 feature/src/main/java/com/terning/feature/onboarding/start/navigation/StartNavigation.kt create mode 100644 feature/src/main/res/drawable/img_start.png 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 859ae0c3a..32fc3f2af 100644 --- a/feature/src/main/java/com/terning/feature/main/MainNavigator.kt +++ b/feature/src/main/java/com/terning/feature/main/MainNavigator.kt @@ -13,6 +13,7 @@ import com.terning.feature.calendar.navigation.navigateCalendar import com.terning.feature.home.navigation.navigateHome import com.terning.feature.mypage.navigation.navigateMyPage import com.terning.feature.onboarding.signin.navigation.SignIn +import com.terning.feature.onboarding.start.navigation.Start import com.terning.feature.search.search.navigation.navigateSearch class MainNavigator( @@ -22,7 +23,7 @@ class MainNavigator( @Composable get() = navController .currentBackStackEntryAsState().value?.destination - val startDestination = SignIn + val startDestination = Start 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 305ed227c..f1b65b039 100644 --- a/feature/src/main/java/com/terning/feature/main/MainScreen.kt +++ b/feature/src/main/java/com/terning/feature/main/MainScreen.kt @@ -26,6 +26,7 @@ import com.terning.feature.mypage.navigation.myPageNavGraph import com.terning.feature.onboarding.filtering.navigation.filteringNavGraph import com.terning.feature.onboarding.signin.navigation.signInNavGraph import com.terning.feature.onboarding.signup.navigation.signUpNavGraph +import com.terning.feature.onboarding.start.navigation.startNavGraph import com.terning.feature.search.search.navigation.searchNavGraph import com.terning.feature.search.searchprocess.navigation.searchProcessNavGraph @@ -60,6 +61,7 @@ fun MainScreen( signUpNavGraph(navHostController = navigator.navController) filteringNavGraph(navHostController = navigator.navController) searchProcessNavGraph(navHostController = navigator.navController) + startNavGraph(navHostController = navigator.navController) } } } diff --git a/feature/src/main/java/com/terning/feature/onboarding/splash/SplashScreen.kt b/feature/src/main/java/com/terning/feature/onboarding/splash/SplashScreen.kt new file mode 100644 index 000000000..e966d29c6 --- /dev/null +++ b/feature/src/main/java/com/terning/feature/onboarding/splash/SplashScreen.kt @@ -0,0 +1,8 @@ +package com.terning.feature.onboarding.splash + +import androidx.compose.runtime.Composable + +@Composable +fun SplashScreen(){ + +} \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/onboarding/start/StartScreen.kt b/feature/src/main/java/com/terning/feature/onboarding/start/StartScreen.kt new file mode 100644 index 000000000..c71105573 --- /dev/null +++ b/feature/src/main/java/com/terning/feature/onboarding/start/StartScreen.kt @@ -0,0 +1,52 @@ +package com.terning.feature.onboarding.start + +import androidx.compose.foundation.Image +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.padding +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.unit.dp +import androidx.navigation.NavController +import com.terning.core.designsystem.component.button.RectangleButton +import com.terning.core.designsystem.theme.TerningTheme +import com.terning.feature.R +import com.terning.feature.onboarding.filtering.navigation.navigateFiltering + +@Composable +fun StartScreen( + modifier: Modifier = Modifier, + navController: NavController +) { + Column( + modifier = modifier.fillMaxSize(), + horizontalAlignment = Alignment.CenterHorizontally + ) { + Spacer(modifier = modifier.weight(1f)) + Text( + text = stringResource(id = R.string.start_title), + style = TerningTheme.typography.title1, + modifier = modifier + .padding(bottom = 35.dp), + textAlign = TextAlign.Center + ) + Image( + painter = painterResource(id = R.drawable.img_start), + contentDescription = stringResource(id = R.string.start_main_image), + ) + Spacer(modifier = modifier.weight(1f)) + RectangleButton( + style = TerningTheme.typography.button0, + paddingVertical = 20.dp, + text = R.string.start_button, + onButtonClick = { navController.navigateFiltering() }, + modifier = modifier.padding(bottom = 12.dp) + ) + } +} \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/onboarding/start/navigation/StartNavigation.kt b/feature/src/main/java/com/terning/feature/onboarding/start/navigation/StartNavigation.kt new file mode 100644 index 000000000..053b764ac --- /dev/null +++ b/feature/src/main/java/com/terning/feature/onboarding/start/navigation/StartNavigation.kt @@ -0,0 +1,28 @@ +package com.terning.feature.onboarding.start.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.onboarding.start.StartScreen +import kotlinx.serialization.Serializable + +fun NavController.navigateStart(navOptions: NavOptions? = null) { + navigate( + route = Start, + navOptions = navOptions + ) +} + +fun NavGraphBuilder.startNavGraph( + navHostController: NavHostController +) { + composable { + StartScreen(navController = navHostController) + } +} + +@Serializable +data object Start : Route \ No newline at end of file diff --git a/feature/src/main/res/drawable/img_start.png b/feature/src/main/res/drawable/img_start.png new file mode 100644 index 0000000000000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9wle9x?JOw>1mkJ++IF`lCsC?&|s|Dr$}w&Ow6^(E=MPp z!7l^=(}W;>fBNe#2QNPhN?tgiZo7+Y$dFM{Ne1&r45W;gpfZQL8i>95Xf7!mb-I8f zRo!^=rU?4G8>lr96BK7`jvX6e>P5%FfVZJ9fM$O9;f{ZnTefT&0o5-g{|Jk#F|iuN zZ+ia4M`*Am#B5kHxgG7&Rp=lDf$yP1=uQIf(jYn%joFh@7=JAn5d=rQ}*_S zA8g#byn6pmeHyRH%FNVORREk1IWqh%$mKr+5ie=|weSN7A*(;p()G>fKqoW}qswS} z)k7{`ck_B-;c4lZ%lnmsVq&-CsmPy0DVvf(ew*o0)P-qE8;t0_4Fz5)GLR4O%akphqy z8hs~BXnR)D(9L|0c57TlYtV5L=&#D44v}LH=vm`NNeOL`GZ7cMq>KIt%R=ZOu??#~ zSpyOJT&09YV2;g(!F_%5HCND|sDa6spSq~jR&e?ZvXfB*mh literal 0 HcmV?d00001 diff --git a/feature/src/main/res/values/strings.xml b/feature/src/main/res/values/strings.xml index 390a5972c..6fec143b8 100644 --- a/feature/src/main/res/values/strings.xml +++ b/feature/src/main/res/values/strings.xml @@ -53,4 +53,9 @@ list Calendar Transition + + 터치 3번으로\n원하는 대학생 인턴 공고를 띄워드릴게요 + 시작화면 이미지 + 시작하기 + \ No newline at end of file From 78e6f627fc3c91f9e2d5ec1c7518de2c6498facd Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Fri, 12 Jul 2024 02:42:49 +0900 Subject: [PATCH 02/26] =?UTF-8?q?[FEAT/#48]=20=EC=95=A0=EB=8B=88=EB=A9=94?= =?UTF-8?q?=EC=9D=B4=EC=85=98=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../feature/onboarding/start/StartScreen.kt | 77 +++++++++++++------ 1 file changed, 53 insertions(+), 24 deletions(-) diff --git a/feature/src/main/java/com/terning/feature/onboarding/start/StartScreen.kt b/feature/src/main/java/com/terning/feature/onboarding/start/StartScreen.kt index c71105573..472dd6d92 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/start/StartScreen.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/start/StartScreen.kt @@ -1,12 +1,20 @@ package com.terning.feature.onboarding.start +import androidx.compose.animation.AnimatedVisibility +import androidx.compose.animation.fadeIn import androidx.compose.foundation.Image +import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.padding import androidx.compose.material3.Text import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.getValue +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.res.painterResource @@ -18,35 +26,56 @@ import com.terning.core.designsystem.component.button.RectangleButton import com.terning.core.designsystem.theme.TerningTheme import com.terning.feature.R import com.terning.feature.onboarding.filtering.navigation.navigateFiltering +import kotlinx.coroutines.delay @Composable fun StartScreen( modifier: Modifier = Modifier, navController: NavController ) { - Column( - modifier = modifier.fillMaxSize(), - horizontalAlignment = Alignment.CenterHorizontally + var isVisible by remember { mutableStateOf(false) } + + LaunchedEffect(key1 = true) { + delay(1500) + isVisible = true + } + + Box( + modifier = modifier.fillMaxSize() ) { - Spacer(modifier = modifier.weight(1f)) - Text( - text = stringResource(id = R.string.start_title), - style = TerningTheme.typography.title1, - modifier = modifier - .padding(bottom = 35.dp), - textAlign = TextAlign.Center - ) - Image( - painter = painterResource(id = R.drawable.img_start), - contentDescription = stringResource(id = R.string.start_main_image), - ) - Spacer(modifier = modifier.weight(1f)) - RectangleButton( - style = TerningTheme.typography.button0, - paddingVertical = 20.dp, - text = R.string.start_button, - onButtonClick = { navController.navigateFiltering() }, - modifier = modifier.padding(bottom = 12.dp) - ) + Column( + modifier = Modifier.fillMaxSize(), + horizontalAlignment = Alignment.CenterHorizontally + ) { + Spacer(modifier = Modifier.weight(1f)) + Text( + text = stringResource(id = R.string.start_title), + style = TerningTheme.typography.title1, + modifier = Modifier.padding(bottom = 35.dp), + textAlign = TextAlign.Center + ) + Image( + painter = painterResource(id = R.drawable.img_start), + contentDescription = stringResource(id = R.string.start_main_image), + ) + Spacer(modifier = Modifier.weight(2f)) + } + Box( + modifier = Modifier + .align(Alignment.BottomCenter) + .padding(bottom = 12.dp) + ) { + AnimatedVisibility( + visible = isVisible, + enter = fadeIn(initialAlpha = 0.3f), + ) { + RectangleButton( + style = TerningTheme.typography.button0, + paddingVertical = 20.dp, + text = R.string.start_button, + onButtonClick = { navController.navigateFiltering() }, + ) + } + } } -} \ No newline at end of file +} From 145076bea4d5197123a684ea29c8b7d6889491f3 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Fri, 12 Jul 2024 03:04:34 +0900 Subject: [PATCH 03/26] =?UTF-8?q?[FEAT/#48]=20TopAppBar=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../topappbar/BackButtonTopAppBar.kt | 4 +-- .../topappbar/TerningBasicTopAppBar.kt | 25 ++++++------- .../onboarding/filtering/FilteringRoute.kt | 17 --------- .../onboarding/filtering/FilteringScreen.kt | 36 +++++++++++++++++++ .../filtering/FilteringViewModel.kt | 6 ++++ .../filtering/component/FilteringStatus.kt | 8 +++++ .../navigation/FilteringNavigation.kt | 4 +-- .../searchprocess/SearchProcessRoute.kt | 2 +- 8 files changed, 65 insertions(+), 37 deletions(-) delete mode 100644 feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringRoute.kt create mode 100644 feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringScreen.kt create mode 100644 feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringViewModel.kt create mode 100644 feature/src/main/java/com/terning/feature/onboarding/filtering/component/FilteringStatus.kt 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..e73c93977 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 @@ -5,8 +5,8 @@ import androidx.compose.ui.Modifier @Composable fun BackButtonTopAppBar( - title: String, - modifier: Modifier, + modifier: Modifier = Modifier, + title: String = "", onBackButtonClick: (() -> Unit), ) { TerningBasicTopAppBar( diff --git a/core/src/main/java/com/terning/core/designsystem/component/topappbar/TerningBasicTopAppBar.kt b/core/src/main/java/com/terning/core/designsystem/component/topappbar/TerningBasicTopAppBar.kt index cabda466c..792033cde 100644 --- a/core/src/main/java/com/terning/core/designsystem/component/topappbar/TerningBasicTopAppBar.kt +++ b/core/src/main/java/com/terning/core/designsystem/component/topappbar/TerningBasicTopAppBar.kt @@ -5,7 +5,6 @@ import androidx.compose.foundation.layout.padding import androidx.compose.material3.CenterAlignedTopAppBar import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.Icon -import androidx.compose.material3.IconButton import androidx.compose.material3.Text import androidx.compose.material3.TopAppBarDefaults import androidx.compose.runtime.Composable @@ -17,6 +16,7 @@ import androidx.compose.ui.unit.dp import com.terning.core.R import com.terning.core.designsystem.theme.TerningTheme import com.terning.core.designsystem.theme.White +import com.terning.core.extension.noRippleClickable @OptIn(ExperimentalMaterial3Api::class) @Composable @@ -29,28 +29,23 @@ fun TerningBasicTopAppBar( ) { CenterAlignedTopAppBar( title = { - Text( text = title, textAlign = TextAlign.Center, style = TerningTheme.typography.title2 ) - }, - modifier = modifier, navigationIcon = { if (showBackButton) { - IconButton( - onClick = { - onBackButtonClick.invoke() - } - ) { - Icon( - painter = painterResource(id = R.drawable.ic_back), - contentDescription = stringResource(id = R.string.ic_back), - modifier = Modifier.padding(start = 8.dp) - ) - } + Icon( + painter = painterResource(id = R.drawable.ic_back), + contentDescription = stringResource(id = R.string.ic_back), + modifier = modifier + .padding(start = 8.dp) + .noRippleClickable { + onBackButtonClick() + } + ) } else { actions.getOrNull(0)?.invoke() } diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringRoute.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringRoute.kt deleted file mode 100644 index f4c413bba..000000000 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringRoute.kt +++ /dev/null @@ -1,17 +0,0 @@ -package com.terning.feature.onboarding.filtering - -import androidx.compose.material3.Text -import androidx.compose.runtime.Composable -import androidx.navigation.NavController - -@Composable -fun FilteringRoute( - navController: NavController -) { - FilteringScreen() -} - -@Composable -fun FilteringScreen() { - Text(text = "filtering") -} diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringScreen.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringScreen.kt new file mode 100644 index 000000000..1c9c46fe1 --- /dev/null +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringScreen.kt @@ -0,0 +1,36 @@ +package com.terning.feature.onboarding.filtering + +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.padding +import androidx.compose.material3.Scaffold +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.unit.dp +import androidx.navigation.NavController +import com.terning.core.designsystem.component.topappbar.BackButtonTopAppBar + +@Composable +fun FilteringScreen( + navController: NavController, + modifier: Modifier = Modifier +) { + Scaffold( + modifier = modifier, + topBar = { + BackButtonTopAppBar( + onBackButtonClick = { navController.navigateUp() } + ) + } + ) { paddingValues -> + Column( + modifier = Modifier + .fillMaxSize() + .padding(paddingValues) + ) { + + } + } +} + + diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringViewModel.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringViewModel.kt new file mode 100644 index 000000000..ebac89950 --- /dev/null +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringViewModel.kt @@ -0,0 +1,6 @@ +package com.terning.feature.onboarding.filtering + +import androidx.lifecycle.ViewModel + +class FilteringViewModel: ViewModel() { +} \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/component/FilteringStatus.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/component/FilteringStatus.kt new file mode 100644 index 000000000..e34b3f577 --- /dev/null +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/component/FilteringStatus.kt @@ -0,0 +1,8 @@ +package com.terning.feature.onboarding.filtering.component + +import androidx.compose.runtime.Composable + +@Composable +fun FilteringStatus(){ + +} \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/FilteringNavigation.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/FilteringNavigation.kt index e69874fbd..5ac9ed32c 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/FilteringNavigation.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/FilteringNavigation.kt @@ -6,7 +6,7 @@ import androidx.navigation.NavHostController import androidx.navigation.NavOptions import androidx.navigation.compose.composable import com.terning.core.navigation.Route -import com.terning.feature.onboarding.filtering.FilteringRoute +import com.terning.feature.onboarding.filtering.FilteringScreen import kotlinx.serialization.Serializable fun NavController.navigateFiltering(navOptions: NavOptions? = null) { @@ -20,7 +20,7 @@ fun NavGraphBuilder.filteringNavGraph( navHostController: NavHostController ) { composable { - FilteringRoute( + FilteringScreen( navController = navHostController ) } 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 3736f0516..4cc94b38f 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 @@ -66,7 +66,7 @@ fun SearchProcessScreen( if (state.showSearchResults) R.string.search_process_result_top_bar_title else R.string.search_process_top_bar_title ), - onBackButtonClick = { navController.popBackStack() }, + onBackButtonClick = { navController.navigateUp() }, modifier = Modifier ) } From 1d01e28ec94743a940aa1b7c9931421f86b1d2e3 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Fri, 12 Jul 2024 03:08:06 +0900 Subject: [PATCH 04/26] =?UTF-8?q?[ADD/#48]=20Filtering=20Screen=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 --- .../{FilteringScreen.kt => FilteringOneScreen.kt} | 7 ++++--- .../feature/onboarding/filtering/FilteringThreeScreen.kt | 8 ++++++++ .../feature/onboarding/filtering/FilteringTwoScreen.kt | 8 ++++++++ .../filtering/navigation/FilteringNavigation.kt | 4 ++-- 4 files changed, 22 insertions(+), 5 deletions(-) rename feature/src/main/java/com/terning/feature/onboarding/filtering/{FilteringScreen.kt => FilteringOneScreen.kt} (83%) create mode 100644 feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringThreeScreen.kt create mode 100644 feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringTwoScreen.kt diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringScreen.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringOneScreen.kt similarity index 83% rename from feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringScreen.kt rename to feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringOneScreen.kt index 1c9c46fe1..4137da04b 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringScreen.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringOneScreen.kt @@ -6,14 +6,15 @@ import androidx.compose.foundation.layout.padding import androidx.compose.material3.Scaffold import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier -import androidx.compose.ui.unit.dp +import androidx.hilt.navigation.compose.hiltViewModel import androidx.navigation.NavController import com.terning.core.designsystem.component.topappbar.BackButtonTopAppBar @Composable -fun FilteringScreen( +fun FilteringOneScreen( navController: NavController, - modifier: Modifier = Modifier + modifier: Modifier = Modifier, + filteringViewModel: FilteringViewModel = hiltViewModel() ) { Scaffold( modifier = modifier, diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringThreeScreen.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringThreeScreen.kt new file mode 100644 index 000000000..23ed0814b --- /dev/null +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringThreeScreen.kt @@ -0,0 +1,8 @@ +package com.terning.feature.onboarding.filtering + +import androidx.compose.runtime.Composable + +@Composable +fun FilteringThreeScreen(){ + +} \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringTwoScreen.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringTwoScreen.kt new file mode 100644 index 000000000..1c25b1991 --- /dev/null +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringTwoScreen.kt @@ -0,0 +1,8 @@ +package com.terning.feature.onboarding.filtering + +import androidx.compose.runtime.Composable + +@Composable +fun FilteringTwoScreen(){ + +} \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/FilteringNavigation.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/FilteringNavigation.kt index 5ac9ed32c..634a6f9ec 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/FilteringNavigation.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/FilteringNavigation.kt @@ -6,7 +6,7 @@ import androidx.navigation.NavHostController import androidx.navigation.NavOptions import androidx.navigation.compose.composable import com.terning.core.navigation.Route -import com.terning.feature.onboarding.filtering.FilteringScreen +import com.terning.feature.onboarding.filtering.FilteringOneScreen import kotlinx.serialization.Serializable fun NavController.navigateFiltering(navOptions: NavOptions? = null) { @@ -20,7 +20,7 @@ fun NavGraphBuilder.filteringNavGraph( navHostController: NavHostController ) { composable { - FilteringScreen( + FilteringOneScreen( navController = navHostController ) } From 382341329fe85753f0d33f70cce0d7c46073fb04 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Fri, 12 Jul 2024 03:42:30 +0900 Subject: [PATCH 05/26] =?UTF-8?q?[FEAT/#48]=20TerningBasicImage=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 --- .../component/image/TerningBasicImage.kt | 29 ++++++++++++ core/src/main/res/values/strings.xml | 3 ++ .../filtering/FilteringOneScreen.kt | 3 +- .../filtering/component/FilteringStatus.kt | 12 ++++- .../res/drawable/ic_filtering_status1.xml | 44 +++++++++++++++++++ 5 files changed, 89 insertions(+), 2 deletions(-) create mode 100644 core/src/main/java/com/terning/core/designsystem/component/image/TerningBasicImage.kt create mode 100644 feature/src/main/res/drawable/ic_filtering_status1.xml diff --git a/core/src/main/java/com/terning/core/designsystem/component/image/TerningBasicImage.kt b/core/src/main/java/com/terning/core/designsystem/component/image/TerningBasicImage.kt new file mode 100644 index 000000000..d2f260d14 --- /dev/null +++ b/core/src/main/java/com/terning/core/designsystem/component/image/TerningBasicImage.kt @@ -0,0 +1,29 @@ +package com.terning.core.designsystem.component.image + +import androidx.compose.foundation.Image +import androidx.compose.runtime.Composable +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.Preview +import com.terning.core.R +import com.terning.core.designsystem.theme.TerningPointTheme + +@Composable +fun TerningBasicImage( + painter: Int +) { + Image( + painter = painterResource(id = painter), + contentDescription = stringResource(id = R.string.image_content_descriptin) + ) +} + +@Preview(showBackground = true) +@Composable +fun TerningBasicImagePreview() { + TerningPointTheme { + TerningBasicImage( + painter = R.drawable.ic_back + ) + } +} \ No newline at end of file diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index 3de74512c..bb4bcf58e 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -25,4 +25,7 @@ 회원가입 바텀시트 저장하기 + + TerningBasicImage + \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringOneScreen.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringOneScreen.kt index 4137da04b..d313ddf3d 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringOneScreen.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringOneScreen.kt @@ -9,6 +9,7 @@ import androidx.compose.ui.Modifier import androidx.hilt.navigation.compose.hiltViewModel import androidx.navigation.NavController import com.terning.core.designsystem.component.topappbar.BackButtonTopAppBar +import com.terning.feature.onboarding.filtering.component.FilteringStatus @Composable fun FilteringOneScreen( @@ -29,7 +30,7 @@ fun FilteringOneScreen( .fillMaxSize() .padding(paddingValues) ) { - + FilteringStatus() } } } diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/component/FilteringStatus.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/component/FilteringStatus.kt index e34b3f577..c23db038a 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/component/FilteringStatus.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/component/FilteringStatus.kt @@ -1,8 +1,18 @@ package com.terning.feature.onboarding.filtering.component +import androidx.compose.foundation.layout.Row import androidx.compose.runtime.Composable +import androidx.compose.ui.res.painterResource +import com.terning.core.designsystem.component.image.TerningBasicImage +import com.terning.feature.R @Composable -fun FilteringStatus(){ +fun FilteringStatus( +) { + Row( + + ) { + TerningBasicImage(painter = R.drawable.ic_filtering_status1) + } } \ No newline at end of file diff --git a/feature/src/main/res/drawable/ic_filtering_status1.xml b/feature/src/main/res/drawable/ic_filtering_status1.xml new file mode 100644 index 000000000..e88d9c279 --- /dev/null +++ b/feature/src/main/res/drawable/ic_filtering_status1.xml @@ -0,0 +1,44 @@ + + + + + + + + + + From d1b435d9b50dc5cb72c6a44b5e824a8e1360ee31 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Fri, 12 Jul 2024 04:37:00 +0900 Subject: [PATCH 06/26] =?UTF-8?q?[FEAT/#48]=20Text=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{TerningBasicImage.kt => TerningImage.kt} | 11 +++-- .../res/drawable/ic_filtering_status2.xml | 42 +++++++++++++++++++ .../res/drawable/ic_filtering_status3.xml | 40 ++++++++++++++++++ .../filtering/FilteringOneScreen.kt | 34 +++++++++++++-- .../filtering/component/FilteringStatus.kt | 18 -------- feature/src/main/res/values/strings.xml | 4 ++ 6 files changed, 123 insertions(+), 26 deletions(-) rename core/src/main/java/com/terning/core/designsystem/component/image/{TerningBasicImage.kt => TerningImage.kt} (79%) create mode 100644 core/src/main/res/drawable/ic_filtering_status2.xml create mode 100644 core/src/main/res/drawable/ic_filtering_status3.xml delete mode 100644 feature/src/main/java/com/terning/feature/onboarding/filtering/component/FilteringStatus.kt diff --git a/core/src/main/java/com/terning/core/designsystem/component/image/TerningBasicImage.kt b/core/src/main/java/com/terning/core/designsystem/component/image/TerningImage.kt similarity index 79% rename from core/src/main/java/com/terning/core/designsystem/component/image/TerningBasicImage.kt rename to core/src/main/java/com/terning/core/designsystem/component/image/TerningImage.kt index d2f260d14..776291ac7 100644 --- a/core/src/main/java/com/terning/core/designsystem/component/image/TerningBasicImage.kt +++ b/core/src/main/java/com/terning/core/designsystem/component/image/TerningImage.kt @@ -2,6 +2,7 @@ package com.terning.core.designsystem.component.image import androidx.compose.foundation.Image import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview @@ -9,12 +10,14 @@ import com.terning.core.R import com.terning.core.designsystem.theme.TerningPointTheme @Composable -fun TerningBasicImage( - painter: Int +fun TerningImage( + painter: Int, + modifier: Modifier = Modifier ) { Image( painter = painterResource(id = painter), - contentDescription = stringResource(id = R.string.image_content_descriptin) + contentDescription = stringResource(id = R.string.image_content_descriptin), + modifier = modifier ) } @@ -22,7 +25,7 @@ fun TerningBasicImage( @Composable fun TerningBasicImagePreview() { TerningPointTheme { - TerningBasicImage( + TerningImage( painter = R.drawable.ic_back ) } diff --git a/core/src/main/res/drawable/ic_filtering_status2.xml b/core/src/main/res/drawable/ic_filtering_status2.xml new file mode 100644 index 000000000..81b9eb4bc --- /dev/null +++ b/core/src/main/res/drawable/ic_filtering_status2.xml @@ -0,0 +1,42 @@ + + + + + + + + + + diff --git a/core/src/main/res/drawable/ic_filtering_status3.xml b/core/src/main/res/drawable/ic_filtering_status3.xml new file mode 100644 index 000000000..d80473b73 --- /dev/null +++ b/core/src/main/res/drawable/ic_filtering_status3.xml @@ -0,0 +1,40 @@ + + + + + + + + + + diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringOneScreen.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringOneScreen.kt index d313ddf3d..841fb8779 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringOneScreen.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringOneScreen.kt @@ -4,12 +4,17 @@ import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxSize 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.compose.ui.unit.dp import androidx.hilt.navigation.compose.hiltViewModel import androidx.navigation.NavController +import com.terning.core.designsystem.component.image.TerningImage import com.terning.core.designsystem.component.topappbar.BackButtonTopAppBar -import com.terning.feature.onboarding.filtering.component.FilteringStatus +import com.terning.core.designsystem.theme.TerningTheme +import com.terning.feature.R @Composable fun FilteringOneScreen( @@ -17,6 +22,7 @@ fun FilteringOneScreen( modifier: Modifier = Modifier, filteringViewModel: FilteringViewModel = hiltViewModel() ) { + val name: String = "남지우" Scaffold( modifier = modifier, topBar = { @@ -30,9 +36,29 @@ fun FilteringOneScreen( .fillMaxSize() .padding(paddingValues) ) { - FilteringStatus() + TerningImage( + painter = R.drawable.ic_filtering_status1, + modifier = modifier.padding( + top = 20.dp, + start = 24.dp + ) + ) + Text( + text = stringResource(id = R.string.filtering_title, name), + style = TerningTheme.typography.title3, + modifier = modifier.padding( + top = 19.dp, + start = 24.dp + ) + ) + Text( + text = stringResource(id = R.string.filtering_sub, name), + style = TerningTheme.typography.body5, + modifier = modifier.padding( + top = 3.dp, + start = 24.dp + ) + ) } } } - - diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/component/FilteringStatus.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/component/FilteringStatus.kt deleted file mode 100644 index c23db038a..000000000 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/component/FilteringStatus.kt +++ /dev/null @@ -1,18 +0,0 @@ -package com.terning.feature.onboarding.filtering.component - -import androidx.compose.foundation.layout.Row -import androidx.compose.runtime.Composable -import androidx.compose.ui.res.painterResource -import com.terning.core.designsystem.component.image.TerningBasicImage -import com.terning.feature.R - -@Composable -fun FilteringStatus( - -) { - Row( - - ) { - TerningBasicImage(painter = R.drawable.ic_filtering_status1) - } -} \ 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 e1523e03d..a75c8896b 100644 --- a/feature/src/main/res/values/strings.xml +++ b/feature/src/main/res/values/strings.xml @@ -79,4 +79,8 @@ 시작화면 이미지 시작하기 + + %s님의 재학 상태를 선택해주세요 + 휴학중이라면, 휴학 전 마지막 수료 학년을 선택해주세요 + \ No newline at end of file From b7fe480da05a96cfd0d52946c3550ed78cda3fde Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Fri, 12 Jul 2024 04:59:55 +0900 Subject: [PATCH 07/26] =?UTF-8?q?[FEAT/#48]=20string=20=EC=B6=94=EC=B6=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../filtering/FilteringOneScreen.kt | 2 + .../component/RadioFilteringGroup.kt | 57 +++++++++++++++++++ feature/src/main/res/values/strings.xml | 24 +++++++- 3 files changed, 81 insertions(+), 2 deletions(-) create mode 100644 feature/src/main/java/com/terning/feature/onboarding/filtering/component/RadioFilteringGroup.kt diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringOneScreen.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringOneScreen.kt index 841fb8779..3032cd990 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringOneScreen.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringOneScreen.kt @@ -15,6 +15,7 @@ import com.terning.core.designsystem.component.image.TerningImage import com.terning.core.designsystem.component.topappbar.BackButtonTopAppBar import com.terning.core.designsystem.theme.TerningTheme import com.terning.feature.R +import com.terning.feature.onboarding.filtering.component.RadioFilteringGroup @Composable fun FilteringOneScreen( @@ -59,6 +60,7 @@ fun FilteringOneScreen( start = 24.dp ) ) + RadioFilteringGroup() } } } diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/component/RadioFilteringGroup.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/component/RadioFilteringGroup.kt new file mode 100644 index 000000000..0c4bead35 --- /dev/null +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/component/RadioFilteringGroup.kt @@ -0,0 +1,57 @@ +//package com.terning.feature.onboarding.filtering.component +// +//import androidx.compose.foundation.Image +//import androidx.compose.foundation.layout.Arrangement +//import androidx.compose.foundation.layout.aspectRatio +//import androidx.compose.foundation.layout.padding +//import androidx.compose.foundation.lazy.grid.GridCells +//import androidx.compose.foundation.lazy.grid.LazyVerticalGrid +//import androidx.compose.foundation.lazy.grid.items +//import androidx.compose.runtime.Composable +//import androidx.compose.runtime.getValue +//import androidx.compose.runtime.mutableIntStateOf +//import androidx.compose.runtime.saveable.rememberSaveable +//import androidx.compose.runtime.setValue +//import androidx.compose.ui.res.painterResource +//import androidx.compose.ui.res.stringResource +//import androidx.compose.ui.unit.dp +//import com.terning.core.R +//import com.terning.core.designsystem.component.button.RoundButton +//import com.terning.core.extension.noRippleClickable +// +//@Composable +//fun RadioFilteringGroup(){ +// val options = listOf( +// RoundButton( +// style = , +// paddingVertical = , +// cornerRadius = , +// text = , +// onButtonClick = { /*TODO*/ }) +// ) +// +// var selectedOption by rememberSaveable { mutableIntStateOf(options[0]) } +// +// LazyVerticalGrid( +// columns = GridCells.Fixed(3), +// verticalArrangement = Arrangement.spacedBy(20.dp), +// horizontalArrangement = Arrangement.spacedBy(24.dp), +// modifier = modifier +// .padding(horizontal = 42.dp) +// ) { +// items(options) { option -> +// Image( +// painter = painterResource( +// id = if (option == selectedOption) R.drawable.ic_selected_character +// else option +// ), +// contentDescription = stringResource(id = R.string.sign_up_bottom_sheet_description), +// modifier = modifier +// .aspectRatio(1f) +// .noRippleClickable { +// selectedOption = option +// } +// ) +// } +// } +//} \ 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 a75c8896b..43dd66a7d 100644 --- a/feature/src/main/res/values/strings.xml +++ b/feature/src/main/res/values/strings.xml @@ -80,7 +80,27 @@ 시작하기 - %s님의 재학 상태를 선택해주세요 - 휴학중이라면, 휴학 전 마지막 수료 학년을 선택해주세요 + %s님의 재학 상태를 선택해주세요 + *5년제 혹은 초과학기생인 경우 4학년으로 선택해주세요 + 휴학중이라면, 휴학 전 마지막 수료 학년을 선택해주세요 + 1학년 + 2학년 + 3학년 + 4학년 + 대학생의 꽃 인턴, 어린 나이에 미리 도전해볼래요! + 미리 대학생 인턴 경험하고, 사회 생활을 해 보고 싶어요 + 4학년이 되기 전, 인턴으로 유의미한 스펙을 쌓고 싶어요 + 사회인으로의 첫 발걸음, 인턴으로 채우고 싶어요 + 희망하는 인턴 근무 기간을 선택해 주세요 + 선택한 기간동안 근무할 수 있는 인턴 공고를 찾아드릴게요 + 1개월 ~ 3개월 + 4개월 ~ 6개월 + 7개월 이상 + 짧은 기간 안에 스펙을 쌓고 싶은\n‘인턴 초년생'에게 추천해요! + 좀 더 오랜 시간동안의 회사 경험을 원하는\n‘성숙 인턴러'에게 추천해요! + 산업에 오랜 기간 딥다이브 하고 싶은\n‘예비 사회인'에게 추천해요! + 입사를 계획중인 달을 선택해주세요 + 선택한 달부터 근무를 시작할 수 있는 공고를 찾아드릴게요 + 다음으로 \ No newline at end of file From d395dbcde1e05d949aac6a8f7e911d33fc3be46d Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Fri, 12 Jul 2024 07:59:34 +0900 Subject: [PATCH 08/26] =?UTF-8?q?[FEAT/#48]=20FilteringButton=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../filtering/FilteringOneScreen.kt | 28 +++++-- .../filtering/component/FilteringButton.kt | 77 +++++++++++++++++++ .../component/RadioFilteringGroup.kt | 57 -------------- .../component/StatusOneRadioGroup.kt | 72 +++++++++++++++++ feature/src/main/res/values/strings.xml | 11 ++- 5 files changed, 176 insertions(+), 69 deletions(-) create mode 100644 feature/src/main/java/com/terning/feature/onboarding/filtering/component/FilteringButton.kt delete mode 100644 feature/src/main/java/com/terning/feature/onboarding/filtering/component/RadioFilteringGroup.kt create mode 100644 feature/src/main/java/com/terning/feature/onboarding/filtering/component/StatusOneRadioGroup.kt diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringOneScreen.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringOneScreen.kt index 3032cd990..aaaeff00c 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringOneScreen.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringOneScreen.kt @@ -11,19 +11,22 @@ 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.image.TerningImage import com.terning.core.designsystem.component.topappbar.BackButtonTopAppBar import com.terning.core.designsystem.theme.TerningTheme import com.terning.feature.R -import com.terning.feature.onboarding.filtering.component.RadioFilteringGroup +import com.terning.feature.onboarding.filtering.component.StatusOneRadioGroup @Composable fun FilteringOneScreen( navController: NavController, modifier: Modifier = Modifier, - filteringViewModel: FilteringViewModel = hiltViewModel() + filteringViewModel: FilteringViewModel = hiltViewModel(), + onButtonClick: () -> Unit = {}, + onNextButton: () -> Unit = {} ) { - val name: String = "남지우" + val name = "남지우" Scaffold( modifier = modifier, topBar = { @@ -45,7 +48,7 @@ fun FilteringOneScreen( ) ) Text( - text = stringResource(id = R.string.filtering_title, name), + text = stringResource(id = R.string.filtering_status1_title, name), style = TerningTheme.typography.title3, modifier = modifier.padding( top = 19.dp, @@ -53,14 +56,27 @@ fun FilteringOneScreen( ) ) Text( - text = stringResource(id = R.string.filtering_sub, name), + text = stringResource(id = R.string.filtering_status1_sub, name), style = TerningTheme.typography.body5, modifier = modifier.padding( top = 3.dp, start = 24.dp ) ) - RadioFilteringGroup() + StatusOneRadioGroup( + onButtonClick = { + onButtonClick() + } + ) + Text( + text = stringResource(id = R.string.filtering_status1_warning), + style = TerningTheme.typography.detail3 + ) + RectangleButton( + style = TerningTheme.typography.button0, + paddingVertical = 20.dp, + text = R.string.filtering_button, + onButtonClick = { onNextButton() }) } } } diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/component/FilteringButton.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/component/FilteringButton.kt new file mode 100644 index 000000000..9aa64decd --- /dev/null +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/component/FilteringButton.kt @@ -0,0 +1,77 @@ +package com.terning.feature.onboarding.filtering.component + +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.graphics.Color +import androidx.compose.ui.res.stringResource +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.TerningSub3 +import com.terning.core.designsystem.theme.TerningSub4 +import com.terning.core.designsystem.theme.TerningSub5 +import com.terning.core.designsystem.theme.TerningTheme +import com.terning.core.util.NoRippleTheme + +@Composable +fun FilteringButton( + isSelected: Boolean, + @StringRes text: Int, + onButtonClick: () -> Unit, + modifier: Modifier = Modifier, +) { + val interactionSource = remember { MutableInteractionSource() } + val isPressed by interactionSource.collectIsPressedAsState() + val backgroundColor = when { + !isSelected && !isPressed -> Color.Transparent + !isSelected && isPressed -> TerningSub5 + isSelected && !isPressed -> TerningSub4 + else -> TerningSub3 + } + val textColor = when { + !isSelected -> Grey400 + else -> TerningMain + } + val borderColor = when { + !isSelected -> TerningMain + else -> TerningSub1 + } + + CompositionLocalProvider(LocalRippleTheme provides NoRippleTheme) { + Button( + contentPadding = PaddingValues(15.dp), + modifier = modifier.fillMaxWidth(), + interactionSource = interactionSource, + colors = ButtonDefaults.buttonColors( + containerColor = backgroundColor, + contentColor = textColor, + ), + border = BorderStroke( + width = 1.dp, + color = borderColor + ), + shape = RoundedCornerShape(15.dp), + onClick = { onButtonClick() } + ) { + Text( + text = stringResource(id = text), + style = TerningTheme.typography.button3, + ) + } + } +} diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/component/RadioFilteringGroup.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/component/RadioFilteringGroup.kt deleted file mode 100644 index 0c4bead35..000000000 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/component/RadioFilteringGroup.kt +++ /dev/null @@ -1,57 +0,0 @@ -//package com.terning.feature.onboarding.filtering.component -// -//import androidx.compose.foundation.Image -//import androidx.compose.foundation.layout.Arrangement -//import androidx.compose.foundation.layout.aspectRatio -//import androidx.compose.foundation.layout.padding -//import androidx.compose.foundation.lazy.grid.GridCells -//import androidx.compose.foundation.lazy.grid.LazyVerticalGrid -//import androidx.compose.foundation.lazy.grid.items -//import androidx.compose.runtime.Composable -//import androidx.compose.runtime.getValue -//import androidx.compose.runtime.mutableIntStateOf -//import androidx.compose.runtime.saveable.rememberSaveable -//import androidx.compose.runtime.setValue -//import androidx.compose.ui.res.painterResource -//import androidx.compose.ui.res.stringResource -//import androidx.compose.ui.unit.dp -//import com.terning.core.R -//import com.terning.core.designsystem.component.button.RoundButton -//import com.terning.core.extension.noRippleClickable -// -//@Composable -//fun RadioFilteringGroup(){ -// val options = listOf( -// RoundButton( -// style = , -// paddingVertical = , -// cornerRadius = , -// text = , -// onButtonClick = { /*TODO*/ }) -// ) -// -// var selectedOption by rememberSaveable { mutableIntStateOf(options[0]) } -// -// LazyVerticalGrid( -// columns = GridCells.Fixed(3), -// verticalArrangement = Arrangement.spacedBy(20.dp), -// horizontalArrangement = Arrangement.spacedBy(24.dp), -// modifier = modifier -// .padding(horizontal = 42.dp) -// ) { -// items(options) { option -> -// Image( -// painter = painterResource( -// id = if (option == selectedOption) R.drawable.ic_selected_character -// else option -// ), -// contentDescription = stringResource(id = R.string.sign_up_bottom_sheet_description), -// modifier = modifier -// .aspectRatio(1f) -// .noRippleClickable { -// selectedOption = option -// } -// ) -// } -// } -//} \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/component/StatusOneRadioGroup.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/component/StatusOneRadioGroup.kt new file mode 100644 index 000000000..975720d57 --- /dev/null +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/component/StatusOneRadioGroup.kt @@ -0,0 +1,72 @@ +package com.terning.feature.onboarding.filtering.component + +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.lazy.grid.GridCells +import androidx.compose.foundation.lazy.grid.LazyVerticalGrid +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.feature.R + +@Composable +fun StatusOneRadioGroup( + onButtonClick: (Int) -> Unit, + modifier: Modifier = Modifier +) { + val options = listOf( + R.string.filtering_status1_button1, + R.string.filtering_status1_button2, + R.string.filtering_status1_button3, + R.string.filtering_status1_button4 + ) + + val selectedOptions = listOf( + R.string.filtering_status1_description1, + R.string.filtering_status1_description2, + R.string.filtering_status1_description3, + R.string.filtering_status1_description4 + ) + + val selectedIndex = remember { mutableIntStateOf(options[0]) } + val buttonStates = remember { mutableStateListOf(false, false, false, false) } + + LazyVerticalGrid( + columns = GridCells.Fixed(1), + verticalArrangement = Arrangement.spacedBy(20.dp), + horizontalArrangement = Arrangement.spacedBy(24.dp), + modifier = modifier.padding(horizontal = 42.dp) + ) { + itemsIndexed(options) { index, option -> + + when (buttonStates[index]) { + false -> FilteringButton( + isSelected = false, + modifier = modifier.fillMaxWidth(), + text = option, + onButtonClick = { + selectedIndex.intValue = option + buttonStates[index] = !buttonStates[index] + onButtonClick(index) + } + ) + + true -> FilteringButton( + isSelected = true, + modifier = modifier.fillMaxWidth(), + text = selectedOptions[index], + onButtonClick = { + selectedIndex.intValue = option + buttonStates[index] = !buttonStates[index] + onButtonClick(index) + } + ) + } + } + } +} diff --git a/feature/src/main/res/values/strings.xml b/feature/src/main/res/values/strings.xml index 36db5c2dd..c94b2d101 100644 --- a/feature/src/main/res/values/strings.xml +++ b/feature/src/main/res/values/strings.xml @@ -39,7 +39,6 @@ 검색 결과 없을 때 아이콘 와 일치하는 검색 결과가 없어요 - @@ -86,7 +85,7 @@ 1학년 2학년 3학년 - 4학년 + 4학년 대학생의 꽃 인턴, 어린 나이에 미리 도전해볼래요! 미리 대학생 인턴 경험하고, 사회 생활을 해 보고 싶어요 4학년이 되기 전, 인턴으로 유의미한 스펙을 쌓고 싶어요 @@ -96,10 +95,10 @@ 1개월 ~ 3개월 4개월 ~ 6개월 7개월 이상 - 짧은 기간 안에 스펙을 쌓고 싶은\n‘인턴 초년생'에게 추천해요! - 좀 더 오랜 시간동안의 회사 경험을 원하는\n‘성숙 인턴러'에게 추천해요! - 산업에 오랜 기간 딥다이브 하고 싶은\n‘예비 사회인'에게 추천해요! - 입사를 계획중인 달을 선택해주세요 + 짧은 기간 안에 스펙을 쌓고 싶은\n\인턴 초년생\에게 추천해요! + 좀 더 오랜 시간동안의 회사 경험을 원하는\n\성숙 인턴러\에게 추천해요! + 산업에 오랜 기간 딥다이브 하고 싶은\n\예비 사회인\에게 추천해요! + 입사를 계획중인 달을 선택해주세요 선택한 달부터 근무를 시작할 수 있는 공고를 찾아드릴게요 다음으로 From d5149d18de3ac817a3c1f43e753924c312c12563 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Fri, 12 Jul 2024 16:55:51 +0900 Subject: [PATCH 09/26] =?UTF-8?q?[FEAT/#48]=20FilteringButton=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../filtering/component/FilteringButton.kt | 4 +-- .../component/StatusOneRadioGroup.kt | 36 +++++++------------ 2 files changed, 14 insertions(+), 26 deletions(-) diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/component/FilteringButton.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/component/FilteringButton.kt index 9aa64decd..18409729e 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/component/FilteringButton.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/component/FilteringButton.kt @@ -16,7 +16,6 @@ import androidx.compose.runtime.CompositionLocalProvider import androidx.compose.runtime.getValue import androidx.compose.runtime.remember import androidx.compose.ui.Modifier -import androidx.compose.ui.graphics.Color import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import com.terning.core.designsystem.theme.Grey400 @@ -26,6 +25,7 @@ import com.terning.core.designsystem.theme.TerningSub3 import com.terning.core.designsystem.theme.TerningSub4 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 @@ -38,7 +38,7 @@ fun FilteringButton( val interactionSource = remember { MutableInteractionSource() } val isPressed by interactionSource.collectIsPressedAsState() val backgroundColor = when { - !isSelected && !isPressed -> Color.Transparent + !isSelected && !isPressed -> White !isSelected && isPressed -> TerningSub5 isSelected && !isPressed -> TerningSub4 else -> TerningSub3 diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/component/StatusOneRadioGroup.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/component/StatusOneRadioGroup.kt index 975720d57..b43c38c0a 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/component/StatusOneRadioGroup.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/component/StatusOneRadioGroup.kt @@ -34,7 +34,7 @@ fun StatusOneRadioGroup( ) val selectedIndex = remember { mutableIntStateOf(options[0]) } - val buttonStates = remember { mutableStateListOf(false, false, false, false) } + val selectedButton = remember { mutableStateListOf(false, false, false, false) } LazyVerticalGrid( columns = GridCells.Fixed(1), @@ -44,29 +44,17 @@ fun StatusOneRadioGroup( ) { itemsIndexed(options) { index, option -> - when (buttonStates[index]) { - false -> FilteringButton( - isSelected = false, - modifier = modifier.fillMaxWidth(), - text = option, - onButtonClick = { - selectedIndex.intValue = option - buttonStates[index] = !buttonStates[index] - onButtonClick(index) - } - ) - - true -> FilteringButton( - isSelected = true, - modifier = modifier.fillMaxWidth(), - text = selectedOptions[index], - onButtonClick = { - selectedIndex.intValue = option - buttonStates[index] = !buttonStates[index] - onButtonClick(index) - } - ) - } + FilteringButton( + isSelected = selectedButton[index], + modifier = modifier.fillMaxWidth(), + text = if (selectedButton[index]) selectedOptions[index] else option, + onButtonClick = { + selectedIndex.intValue = option + selectedButton.indices.forEach { i -> selectedButton[i] = false } + selectedButton[index] = true + onButtonClick(index) + } + ) } } } From c43e4b9afd92101640544364a92db794bb47599e Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Fri, 12 Jul 2024 17:02:21 +0900 Subject: [PATCH 10/26] =?UTF-8?q?[UI/#48]=20FilteringOneScreen=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 --- .../onboarding/filtering/FilteringOneScreen.kt | 15 ++++++++++++--- .../filtering/component/StatusOneRadioGroup.kt | 5 ++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringOneScreen.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringOneScreen.kt index aaaeff00c..a5a9c903c 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringOneScreen.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringOneScreen.kt @@ -1,6 +1,7 @@ package com.terning.feature.onboarding.filtering import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.padding import androidx.compose.material3.Scaffold @@ -60,7 +61,8 @@ fun FilteringOneScreen( style = TerningTheme.typography.body5, modifier = modifier.padding( top = 3.dp, - start = 24.dp + start = 24.dp, + bottom = 25.dp ) ) StatusOneRadioGroup( @@ -70,13 +72,20 @@ fun FilteringOneScreen( ) Text( text = stringResource(id = R.string.filtering_status1_warning), - style = TerningTheme.typography.detail3 + style = TerningTheme.typography.detail3, + modifier = modifier.padding( + start = 24.dp, + top = 9.dp + ) ) + Spacer(modifier = modifier.weight(1f)) RectangleButton( style = TerningTheme.typography.button0, paddingVertical = 20.dp, text = R.string.filtering_button, - onButtonClick = { onNextButton() }) + onButtonClick = { onNextButton() }, + modifier = modifier.padding(bottom = 12.dp) + ) } } } diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/component/StatusOneRadioGroup.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/component/StatusOneRadioGroup.kt index b43c38c0a..a9c719667 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/component/StatusOneRadioGroup.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/component/StatusOneRadioGroup.kt @@ -38,9 +38,8 @@ fun StatusOneRadioGroup( LazyVerticalGrid( columns = GridCells.Fixed(1), - verticalArrangement = Arrangement.spacedBy(20.dp), - horizontalArrangement = Arrangement.spacedBy(24.dp), - modifier = modifier.padding(horizontal = 42.dp) + verticalArrangement = Arrangement.spacedBy(12.dp), + modifier = modifier.padding(horizontal = 24.dp) ) { itemsIndexed(options) { index, option -> From 3c4ab6ba2060e8c55a72ab9559a1a4a3c7611570 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Fri, 12 Jul 2024 17:13:52 +0900 Subject: [PATCH 11/26] =?UTF-8?q?[FEAT/#48]=20Filtering=20=EB=B2=84?= =?UTF-8?q?=ED=8A=BC=20=EC=97=B0=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/terning/feature/main/MainScreen.kt | 8 +++-- .../filtering/FilteringOneScreen.kt | 12 +++++-- .../filtering/FilteringThreeScreen.kt | 5 ++- .../filtering/FilteringTwoScreen.kt | 5 ++- ...avigation.kt => FilteringOneNavigation.kt} | 10 +++--- .../navigation/FilteringThreeNavigation.kt | 30 ++++++++++++++++++ .../navigation/FilteringTwoNavigation.kt | 31 +++++++++++++++++++ .../feature/onboarding/signup/SignUpRoute.kt | 6 ++-- .../feature/onboarding/start/StartScreen.kt | 4 +-- 9 files changed, 94 insertions(+), 17 deletions(-) rename feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/{FilteringNavigation.kt => FilteringOneNavigation.kt} (75%) create mode 100644 feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/FilteringThreeNavigation.kt create mode 100644 feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/FilteringTwoNavigation.kt 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 ec9ae7f8d..469836de3 100644 --- a/feature/src/main/java/com/terning/feature/main/MainScreen.kt +++ b/feature/src/main/java/com/terning/feature/main/MainScreen.kt @@ -23,7 +23,9 @@ import com.terning.core.util.NoRippleInteractionSource import com.terning.feature.calendar.navigation.calendarNavGraph import com.terning.feature.home.home.navigation.homeNavGraph import com.terning.feature.mypage.navigation.myPageNavGraph -import com.terning.feature.onboarding.filtering.navigation.filteringNavGraph +import com.terning.feature.onboarding.filtering.navigation.filteringOneNavGraph +import com.terning.feature.onboarding.filtering.navigation.filteringThreeNavGraph +import com.terning.feature.onboarding.filtering.navigation.filteringTwoNavGraph import com.terning.feature.onboarding.signin.navigation.signInNavGraph import com.terning.feature.onboarding.signup.navigation.signUpNavGraph import com.terning.feature.onboarding.start.navigation.startNavGraph @@ -59,7 +61,9 @@ fun MainScreen( myPageNavGraph() signInNavGraph(navHostController = navigator.navController) signUpNavGraph(navHostController = navigator.navController) - filteringNavGraph(navHostController = navigator.navController) + filteringOneNavGraph(navHostController = navigator.navController) + filteringTwoNavGraph(navHostController = navigator.navController) + filteringThreeNavGraph(navHostController = navigator.navController) searchProcessNavGraph(navHostController = navigator.navController) startNavGraph(navHostController = navigator.navController) } diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringOneScreen.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringOneScreen.kt index a5a9c903c..4f31855f6 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringOneScreen.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringOneScreen.kt @@ -7,6 +7,8 @@ import androidx.compose.foundation.layout.padding import androidx.compose.material3.Scaffold import androidx.compose.material3.Text import androidx.compose.runtime.Composable +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp @@ -18,6 +20,7 @@ import com.terning.core.designsystem.component.topappbar.BackButtonTopAppBar import com.terning.core.designsystem.theme.TerningTheme import com.terning.feature.R import com.terning.feature.onboarding.filtering.component.StatusOneRadioGroup +import com.terning.feature.onboarding.filtering.navigation.navigateFilteringTwo @Composable fun FilteringOneScreen( @@ -25,9 +28,10 @@ fun FilteringOneScreen( modifier: Modifier = Modifier, filteringViewModel: FilteringViewModel = hiltViewModel(), onButtonClick: () -> Unit = {}, - onNextButton: () -> Unit = {} ) { val name = "남지우" + val isButtonValid = remember { mutableStateOf(false) } + Scaffold( modifier = modifier, topBar = { @@ -68,6 +72,7 @@ fun FilteringOneScreen( StatusOneRadioGroup( onButtonClick = { onButtonClick() + isButtonValid.value = true } ) Text( @@ -83,8 +88,9 @@ fun FilteringOneScreen( style = TerningTheme.typography.button0, paddingVertical = 20.dp, text = R.string.filtering_button, - onButtonClick = { onNextButton() }, - modifier = modifier.padding(bottom = 12.dp) + onButtonClick = { navController.navigateFilteringTwo() }, + modifier = modifier.padding(bottom = 12.dp), + isEnabled = isButtonValid.value ) } } diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringThreeScreen.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringThreeScreen.kt index 23ed0814b..d06d50dad 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringThreeScreen.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringThreeScreen.kt @@ -1,8 +1,11 @@ package com.terning.feature.onboarding.filtering import androidx.compose.runtime.Composable +import androidx.navigation.NavController @Composable -fun FilteringThreeScreen(){ +fun FilteringThreeScreen( + navController: NavController, +) { } \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringTwoScreen.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringTwoScreen.kt index 1c25b1991..af14cf7ad 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringTwoScreen.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringTwoScreen.kt @@ -1,8 +1,11 @@ package com.terning.feature.onboarding.filtering import androidx.compose.runtime.Composable +import androidx.navigation.NavController @Composable -fun FilteringTwoScreen(){ +fun FilteringTwoScreen( + navController: NavController, +){ } \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/FilteringNavigation.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/FilteringOneNavigation.kt similarity index 75% rename from feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/FilteringNavigation.kt rename to feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/FilteringOneNavigation.kt index 634a6f9ec..55be952bb 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/FilteringNavigation.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/FilteringOneNavigation.kt @@ -9,17 +9,17 @@ import com.terning.core.navigation.Route import com.terning.feature.onboarding.filtering.FilteringOneScreen import kotlinx.serialization.Serializable -fun NavController.navigateFiltering(navOptions: NavOptions? = null) { +fun NavController.navigateFilteringOne(navOptions: NavOptions? = null) { navigate( - route = Filtering, + route = FilteringOne, navOptions = navOptions ) } -fun NavGraphBuilder.filteringNavGraph( +fun NavGraphBuilder.filteringOneNavGraph( navHostController: NavHostController ) { - composable { + composable { FilteringOneScreen( navController = navHostController ) @@ -27,4 +27,4 @@ fun NavGraphBuilder.filteringNavGraph( } @Serializable -data object Filtering : Route \ No newline at end of file +data object FilteringOne : Route \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/FilteringThreeNavigation.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/FilteringThreeNavigation.kt new file mode 100644 index 000000000..d7faf0d22 --- /dev/null +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/FilteringThreeNavigation.kt @@ -0,0 +1,30 @@ +package com.terning.feature.onboarding.filtering.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.onboarding.filtering.FilteringTwoScreen +import kotlinx.serialization.Serializable + +fun NavController.navigateFilteringTwo(navOptions: NavOptions? = null) { + navigate( + route = FilteringTwo, + navOptions = navOptions + ) +} + +fun NavGraphBuilder.filteringTwoNavGraph( + navHostController: NavHostController +) { + composable { + FilteringTwoScreen( + navController = navHostController + ) + } +} + +@Serializable +data object FilteringTwo : Route \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/FilteringTwoNavigation.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/FilteringTwoNavigation.kt new file mode 100644 index 000000000..039555b43 --- /dev/null +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/FilteringTwoNavigation.kt @@ -0,0 +1,31 @@ +package com.terning.feature.onboarding.filtering.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.onboarding.filtering.FilteringThreeScreen +import com.terning.feature.onboarding.filtering.FilteringTwoScreen +import kotlinx.serialization.Serializable + +fun NavController.navigateFilteringThree(navOptions: NavOptions? = null) { + navigate( + route = FilteringTwo, + navOptions = navOptions + ) +} + +fun NavGraphBuilder.filteringThreeNavGraph( + navHostController: NavHostController +) { + composable { + FilteringThreeScreen( + navController = navHostController + ) + } +} + +@Serializable +data object FilteringThree : Route \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpRoute.kt b/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpRoute.kt index a85d688f2..87eaa2db0 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpRoute.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpRoute.kt @@ -18,14 +18,14 @@ import androidx.compose.ui.unit.dp import androidx.hilt.navigation.compose.hiltViewModel import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.navigation.NavController +import com.terning.core.designsystem.component.bottomsheet.SignUpBottomSheet import com.terning.core.designsystem.component.button.RectangleButton import com.terning.core.designsystem.component.textfield.NameTextField import com.terning.core.designsystem.theme.TerningTheme import com.terning.core.extension.addFocusCleaner import com.terning.core.extension.noRippleClickable import com.terning.feature.R -import com.terning.feature.onboarding.filtering.navigation.navigateFiltering -import com.terning.core.designsystem.component.bottomsheet.SignUpBottomSheet +import com.terning.feature.onboarding.filtering.navigation.navigateFilteringOne import com.terning.feature.onboarding.signup.component.SignUpProfile @Composable @@ -38,7 +38,7 @@ fun SignUpRoute( SignUpScreen( signUpViewModel = signUpViewModel, signUpState = signUpState, - onButtonClick = { navController.navigateFiltering() } + onButtonClick = { navController.navigateFilteringOne() } ) } diff --git a/feature/src/main/java/com/terning/feature/onboarding/start/StartScreen.kt b/feature/src/main/java/com/terning/feature/onboarding/start/StartScreen.kt index 472dd6d92..6f7932ad6 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/start/StartScreen.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/start/StartScreen.kt @@ -25,7 +25,7 @@ import androidx.navigation.NavController import com.terning.core.designsystem.component.button.RectangleButton import com.terning.core.designsystem.theme.TerningTheme import com.terning.feature.R -import com.terning.feature.onboarding.filtering.navigation.navigateFiltering +import com.terning.feature.onboarding.filtering.navigation.navigateFilteringOne import kotlinx.coroutines.delay @Composable @@ -73,7 +73,7 @@ fun StartScreen( style = TerningTheme.typography.button0, paddingVertical = 20.dp, text = R.string.start_button, - onButtonClick = { navController.navigateFiltering() }, + onButtonClick = { navController.navigateFilteringOne() }, ) } } From a3b3183c4adfeb3b7d6079c523afb7ec9b828651 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Fri, 12 Jul 2024 18:21:50 +0900 Subject: [PATCH 12/26] =?UTF-8?q?[UI/#48]=20FilteringTwoScreen=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 --- .../component/button}/FilteringButton.kt | 9 +- .../res/drawable/ic_filtering_status2.xml | 42 --------- .../res/drawable/ic_filtering_status3.xml | 40 --------- .../com/terning/feature/main/MainScreen.kt | 2 - .../filtering/FilteringOneScreen.kt | 8 +- .../filtering/FilteringThreeScreen.kt | 11 --- .../filtering/FilteringTwoScreen.kt | 90 ++++++++++++++++++- .../filtering/FilteringViewModel.kt | 8 +- .../component/StatusOneRadioGroup.kt | 5 +- .../component/StatusTwoRadioGroup.kt | 60 +++++++++++++ .../navigation/FilteringThreeNavigation.kt | 30 ------- .../navigation/FilteringTwoNavigation.kt | 11 +-- .../res/drawable/ic_filtering_status2.xml | 42 +++++++++ .../res/drawable/ic_filtering_status3.xml | 40 +++++++++ 14 files changed, 258 insertions(+), 140 deletions(-) rename {feature/src/main/java/com/terning/feature/onboarding/filtering/component => core/src/main/java/com/terning/core/designsystem/component/button}/FilteringButton.kt (91%) delete mode 100644 core/src/main/res/drawable/ic_filtering_status2.xml delete mode 100644 core/src/main/res/drawable/ic_filtering_status3.xml delete mode 100644 feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringThreeScreen.kt create mode 100644 feature/src/main/java/com/terning/feature/onboarding/filtering/component/StatusTwoRadioGroup.kt delete mode 100644 feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/FilteringThreeNavigation.kt create mode 100644 feature/src/main/res/drawable/ic_filtering_status2.xml create mode 100644 feature/src/main/res/drawable/ic_filtering_status3.xml diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/component/FilteringButton.kt b/core/src/main/java/com/terning/core/designsystem/component/button/FilteringButton.kt similarity index 91% rename from feature/src/main/java/com/terning/feature/onboarding/filtering/component/FilteringButton.kt rename to core/src/main/java/com/terning/core/designsystem/component/button/FilteringButton.kt index 18409729e..52521ec58 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/component/FilteringButton.kt +++ b/core/src/main/java/com/terning/core/designsystem/component/button/FilteringButton.kt @@ -1,4 +1,4 @@ -package com.terning.feature.onboarding.filtering.component +package com.terning.core.designsystem.component.button import androidx.annotation.StringRes import androidx.compose.foundation.BorderStroke @@ -17,6 +17,7 @@ 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.unit.Dp import androidx.compose.ui.unit.dp import com.terning.core.designsystem.theme.Grey400 import com.terning.core.designsystem.theme.TerningMain @@ -32,6 +33,8 @@ import com.terning.core.util.NoRippleTheme fun FilteringButton( isSelected: Boolean, @StringRes text: Int, + cornerRadius: Dp, + paddingVertical: Dp, onButtonClick: () -> Unit, modifier: Modifier = Modifier, ) { @@ -54,7 +57,7 @@ fun FilteringButton( CompositionLocalProvider(LocalRippleTheme provides NoRippleTheme) { Button( - contentPadding = PaddingValues(15.dp), + contentPadding = PaddingValues(paddingVertical), modifier = modifier.fillMaxWidth(), interactionSource = interactionSource, colors = ButtonDefaults.buttonColors( @@ -65,7 +68,7 @@ fun FilteringButton( width = 1.dp, color = borderColor ), - shape = RoundedCornerShape(15.dp), + shape = RoundedCornerShape(cornerRadius), onClick = { onButtonClick() } ) { Text( diff --git a/core/src/main/res/drawable/ic_filtering_status2.xml b/core/src/main/res/drawable/ic_filtering_status2.xml deleted file mode 100644 index 81b9eb4bc..000000000 --- a/core/src/main/res/drawable/ic_filtering_status2.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - diff --git a/core/src/main/res/drawable/ic_filtering_status3.xml b/core/src/main/res/drawable/ic_filtering_status3.xml deleted file mode 100644 index d80473b73..000000000 --- a/core/src/main/res/drawable/ic_filtering_status3.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - 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 469836de3..25e155bc0 100644 --- a/feature/src/main/java/com/terning/feature/main/MainScreen.kt +++ b/feature/src/main/java/com/terning/feature/main/MainScreen.kt @@ -24,7 +24,6 @@ import com.terning.feature.calendar.navigation.calendarNavGraph import com.terning.feature.home.home.navigation.homeNavGraph import com.terning.feature.mypage.navigation.myPageNavGraph import com.terning.feature.onboarding.filtering.navigation.filteringOneNavGraph -import com.terning.feature.onboarding.filtering.navigation.filteringThreeNavGraph import com.terning.feature.onboarding.filtering.navigation.filteringTwoNavGraph import com.terning.feature.onboarding.signin.navigation.signInNavGraph import com.terning.feature.onboarding.signup.navigation.signUpNavGraph @@ -63,7 +62,6 @@ fun MainScreen( signUpNavGraph(navHostController = navigator.navController) filteringOneNavGraph(navHostController = navigator.navController) filteringTwoNavGraph(navHostController = navigator.navController) - filteringThreeNavGraph(navHostController = navigator.navController) searchProcessNavGraph(navHostController = navigator.navController) startNavGraph(navHostController = navigator.navController) } diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringOneScreen.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringOneScreen.kt index 4f31855f6..33c76066f 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringOneScreen.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringOneScreen.kt @@ -29,7 +29,6 @@ fun FilteringOneScreen( filteringViewModel: FilteringViewModel = hiltViewModel(), onButtonClick: () -> Unit = {}, ) { - val name = "남지우" val isButtonValid = remember { mutableStateOf(false) } Scaffold( @@ -53,7 +52,10 @@ fun FilteringOneScreen( ) ) Text( - text = stringResource(id = R.string.filtering_status1_title, name), + text = stringResource( + id = R.string.filtering_status1_title, + filteringViewModel.name + ), style = TerningTheme.typography.title3, modifier = modifier.padding( top = 19.dp, @@ -61,7 +63,7 @@ fun FilteringOneScreen( ) ) Text( - text = stringResource(id = R.string.filtering_status1_sub, name), + text = stringResource(id = R.string.filtering_status1_sub, filteringViewModel.name), style = TerningTheme.typography.body5, modifier = modifier.padding( top = 3.dp, diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringThreeScreen.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringThreeScreen.kt deleted file mode 100644 index d06d50dad..000000000 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringThreeScreen.kt +++ /dev/null @@ -1,11 +0,0 @@ -package com.terning.feature.onboarding.filtering - -import androidx.compose.runtime.Composable -import androidx.navigation.NavController - -@Composable -fun FilteringThreeScreen( - navController: NavController, -) { - -} \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringTwoScreen.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringTwoScreen.kt index af14cf7ad..57fc3e770 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringTwoScreen.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringTwoScreen.kt @@ -1,11 +1,97 @@ package com.terning.feature.onboarding.filtering +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.padding +import androidx.compose.material3.Scaffold +import androidx.compose.material3.Text import androidx.compose.runtime.Composable +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.ui.Modifier +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.image.TerningImage +import com.terning.core.designsystem.component.topappbar.BackButtonTopAppBar +import com.terning.core.designsystem.theme.TerningTheme +import com.terning.feature.R +import com.terning.feature.onboarding.filtering.component.StatusTwoRadioGroup +import com.terning.feature.onboarding.filtering.navigation.navigateFilteringTwo @Composable fun FilteringTwoScreen( navController: NavController, -){ + modifier: Modifier = Modifier, + filteringViewModel: FilteringViewModel = hiltViewModel(), + onButtonClick: () -> Unit = {}, +) { -} \ No newline at end of file + val isButtonValid = remember { mutableStateOf(false) } + + Scaffold( + modifier = modifier, + topBar = { + BackButtonTopAppBar( + onBackButtonClick = { navController.navigateUp() } + ) + } + ) { paddingValues -> + Column( + modifier = Modifier + .fillMaxSize() + .padding(paddingValues) + ) { + TerningImage( + painter = R.drawable.ic_filtering_status2, + modifier = modifier.padding( + top = 20.dp, + start = 24.dp + ) + ) + Text( + text = stringResource(id = R.string.filtering_status2_title), + style = TerningTheme.typography.title3, + modifier = modifier.padding( + top = 19.dp, + start = 24.dp + ) + ) + Text( + text = stringResource(id = R.string.filtering_status2_sub), + style = TerningTheme.typography.body5, + modifier = modifier.padding( + top = 3.dp, + start = 24.dp, + bottom = 25.dp + ) + ) + StatusTwoRadioGroup( + onButtonClick = { + onButtonClick() + isButtonValid.value = true + } + ) + Text( + text = stringResource(id = R.string.filtering_status1_warning), + style = TerningTheme.typography.detail3, + modifier = modifier.padding( + start = 24.dp, + top = 9.dp + ) + ) + Spacer(modifier = modifier.weight(1f)) + RectangleButton( + style = TerningTheme.typography.button0, + paddingVertical = 25.dp, + text = R.string.filtering_button, + onButtonClick = { navController.navigateFilteringTwo() }, + modifier = modifier.padding(bottom = 12.dp), + isEnabled = isButtonValid.value + ) + } + } +} diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringViewModel.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringViewModel.kt index ebac89950..b05c6266f 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringViewModel.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringViewModel.kt @@ -1,6 +1,12 @@ package com.terning.feature.onboarding.filtering import androidx.lifecycle.ViewModel +import dagger.hilt.android.lifecycle.HiltViewModel +import javax.inject.Inject + +@HiltViewModel +class FilteringViewModel @Inject constructor() : ViewModel() { + + val name = "남지우" -class FilteringViewModel: ViewModel() { } \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/component/StatusOneRadioGroup.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/component/StatusOneRadioGroup.kt index a9c719667..def61d2b4 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/component/StatusOneRadioGroup.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/component/StatusOneRadioGroup.kt @@ -12,6 +12,7 @@ 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.FilteringButton import com.terning.feature.R @Composable @@ -52,7 +53,9 @@ fun StatusOneRadioGroup( selectedButton.indices.forEach { i -> selectedButton[i] = false } selectedButton[index] = true onButtonClick(index) - } + }, + cornerRadius = 15.dp, + paddingVertical = 15.dp ) } } diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/component/StatusTwoRadioGroup.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/component/StatusTwoRadioGroup.kt new file mode 100644 index 000000000..fe2fdd0de --- /dev/null +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/component/StatusTwoRadioGroup.kt @@ -0,0 +1,60 @@ +package com.terning.feature.onboarding.filtering.component + +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.lazy.grid.GridCells +import androidx.compose.foundation.lazy.grid.LazyVerticalGrid +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.FilteringButton +import com.terning.feature.R + +@Composable +fun StatusTwoRadioGroup( + onButtonClick: (Int) -> Unit, + modifier: Modifier = Modifier +) { + val options = listOf( + R.string.filtering_status2_button1, + R.string.filtering_status2_button2, + R.string.filtering_status2_button3, + ) + + val selectedOptions = listOf( + R.string.filtering_status2_description1, + R.string.filtering_status2_description2, + R.string.filtering_status2_description3, + ) + + val selectedIndex = remember { mutableIntStateOf(options[0]) } + val selectedButton = remember { mutableStateListOf(false, false, false) } + + LazyVerticalGrid( + columns = GridCells.Fixed(1), + verticalArrangement = Arrangement.spacedBy(12.dp), + modifier = modifier.padding(horizontal = 24.dp) + ) { + itemsIndexed(options) { index, option -> + + FilteringButton( + isSelected = selectedButton[index], + modifier = modifier.fillMaxWidth(), + text = if (selectedButton[index]) selectedOptions[index] else option, + onButtonClick = { + selectedIndex.intValue = option + selectedButton.indices.forEach { i -> selectedButton[i] = false } + selectedButton[index] = true + onButtonClick(index) + }, + cornerRadius = 15.dp, + paddingVertical = if (selectedButton[index]) 17.dp else 26.dp + ) + } + } +} diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/FilteringThreeNavigation.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/FilteringThreeNavigation.kt deleted file mode 100644 index d7faf0d22..000000000 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/FilteringThreeNavigation.kt +++ /dev/null @@ -1,30 +0,0 @@ -package com.terning.feature.onboarding.filtering.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.onboarding.filtering.FilteringTwoScreen -import kotlinx.serialization.Serializable - -fun NavController.navigateFilteringTwo(navOptions: NavOptions? = null) { - navigate( - route = FilteringTwo, - navOptions = navOptions - ) -} - -fun NavGraphBuilder.filteringTwoNavGraph( - navHostController: NavHostController -) { - composable { - FilteringTwoScreen( - navController = navHostController - ) - } -} - -@Serializable -data object FilteringTwo : Route \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/FilteringTwoNavigation.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/FilteringTwoNavigation.kt index 039555b43..fbf52f81f 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/FilteringTwoNavigation.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/FilteringTwoNavigation.kt @@ -1,3 +1,5 @@ +@file:JvmName("FilteringThreeNavigationKt") + package com.terning.feature.onboarding.filtering.navigation import androidx.navigation.NavController @@ -6,26 +8,25 @@ import androidx.navigation.NavHostController import androidx.navigation.NavOptions import androidx.navigation.compose.composable import com.terning.core.navigation.Route -import com.terning.feature.onboarding.filtering.FilteringThreeScreen import com.terning.feature.onboarding.filtering.FilteringTwoScreen import kotlinx.serialization.Serializable -fun NavController.navigateFilteringThree(navOptions: NavOptions? = null) { +fun NavController.navigateFilteringTwo(navOptions: NavOptions? = null) { navigate( route = FilteringTwo, navOptions = navOptions ) } -fun NavGraphBuilder.filteringThreeNavGraph( +fun NavGraphBuilder.filteringTwoNavGraph( navHostController: NavHostController ) { composable { - FilteringThreeScreen( + FilteringTwoScreen( navController = navHostController ) } } @Serializable -data object FilteringThree : Route \ No newline at end of file +data object FilteringTwo : Route \ No newline at end of file diff --git a/feature/src/main/res/drawable/ic_filtering_status2.xml b/feature/src/main/res/drawable/ic_filtering_status2.xml new file mode 100644 index 000000000..3ee9d62dd --- /dev/null +++ b/feature/src/main/res/drawable/ic_filtering_status2.xml @@ -0,0 +1,42 @@ + + + + + + + + + + diff --git a/feature/src/main/res/drawable/ic_filtering_status3.xml b/feature/src/main/res/drawable/ic_filtering_status3.xml new file mode 100644 index 000000000..410bbeb99 --- /dev/null +++ b/feature/src/main/res/drawable/ic_filtering_status3.xml @@ -0,0 +1,40 @@ + + + + + + + + + + From 7569fec7856766491888d3e233b218b10d161cd7 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Fri, 12 Jul 2024 18:33:49 +0900 Subject: [PATCH 13/26] =?UTF-8?q?[UI/#48]=20FilteringTwoScreen=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 --- .../component/button/FilteringButton.kt | 2 + .../com/terning/feature/main/MainNavigator.kt | 5 +- .../com/terning/feature/main/MainScreen.kt | 4 +- .../filtering/FilteringThreeScreen.kt | 83 +++++++++++++++++++ .../component/StatusThreeRadioGroup.kt | 4 + .../component/StatusTwoRadioGroup.kt | 1 + .../navigation/FilteringThreeNavigation.kt | 4 + .../FilteringStartScreen.kt} | 4 +- .../navigation/FilteringStartNavigation.kt} | 16 ++-- 9 files changed, 108 insertions(+), 15 deletions(-) create mode 100644 feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringThreeScreen.kt create mode 100644 feature/src/main/java/com/terning/feature/onboarding/filtering/component/StatusThreeRadioGroup.kt create mode 100644 feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/FilteringThreeNavigation.kt rename feature/src/main/java/com/terning/feature/onboarding/{start/StartScreen.kt => filteringstart/FilteringStartScreen.kt} (97%) rename feature/src/main/java/com/terning/feature/onboarding/{start/navigation/StartNavigation.kt => filteringstart/navigation/FilteringStartNavigation.kt} (50%) diff --git a/core/src/main/java/com/terning/core/designsystem/component/button/FilteringButton.kt b/core/src/main/java/com/terning/core/designsystem/component/button/FilteringButton.kt index 52521ec58..968c0f285 100644 --- a/core/src/main/java/com/terning/core/designsystem/component/button/FilteringButton.kt +++ b/core/src/main/java/com/terning/core/designsystem/component/button/FilteringButton.kt @@ -17,6 +17,7 @@ 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 @@ -74,6 +75,7 @@ fun FilteringButton( Text( text = stringResource(id = text), style = TerningTheme.typography.button3, + textAlign = TextAlign.Center ) } } 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 90f4eee44..53042f701 100644 --- a/feature/src/main/java/com/terning/feature/main/MainNavigator.kt +++ b/feature/src/main/java/com/terning/feature/main/MainNavigator.kt @@ -12,8 +12,7 @@ import androidx.navigation.navOptions import com.terning.feature.calendar.navigation.navigateCalendar 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.onboarding.start.navigation.Start +import com.terning.feature.onboarding.filteringstart.navigation.FilteringStart import com.terning.feature.search.search.navigation.navigateSearch class MainNavigator( @@ -23,7 +22,7 @@ class MainNavigator( @Composable get() = navController .currentBackStackEntryAsState().value?.destination - val startDestination = Start + val startDestination = FilteringStart 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 25e155bc0..633c39d7a 100644 --- a/feature/src/main/java/com/terning/feature/main/MainScreen.kt +++ b/feature/src/main/java/com/terning/feature/main/MainScreen.kt @@ -25,9 +25,9 @@ import com.terning.feature.home.home.navigation.homeNavGraph import com.terning.feature.mypage.navigation.myPageNavGraph import com.terning.feature.onboarding.filtering.navigation.filteringOneNavGraph import com.terning.feature.onboarding.filtering.navigation.filteringTwoNavGraph +import com.terning.feature.onboarding.filteringstart.navigation.filteringStartNavGraph import com.terning.feature.onboarding.signin.navigation.signInNavGraph import com.terning.feature.onboarding.signup.navigation.signUpNavGraph -import com.terning.feature.onboarding.start.navigation.startNavGraph import com.terning.feature.search.search.navigation.searchNavGraph import com.terning.feature.search.searchprocess.navigation.searchProcessNavGraph @@ -63,7 +63,7 @@ fun MainScreen( filteringOneNavGraph(navHostController = navigator.navController) filteringTwoNavGraph(navHostController = navigator.navController) searchProcessNavGraph(navHostController = navigator.navController) - startNavGraph(navHostController = navigator.navController) + filteringStartNavGraph(navHostController = navigator.navController) } } } diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringThreeScreen.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringThreeScreen.kt new file mode 100644 index 000000000..4d6c7ea85 --- /dev/null +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringThreeScreen.kt @@ -0,0 +1,83 @@ +package com.terning.feature.onboarding.filtering + +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.padding +import androidx.compose.material3.Scaffold +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.ui.Modifier +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.image.TerningImage +import com.terning.core.designsystem.component.topappbar.BackButtonTopAppBar +import com.terning.core.designsystem.theme.TerningTheme +import com.terning.feature.R +import com.terning.feature.onboarding.filtering.component.StatusTwoRadioGroup +import com.terning.feature.onboarding.filtering.navigation.navigateFilteringTwo + +@Composable +fun FilteringThreeScreen( + navController: NavController, + modifier: Modifier = Modifier, + filteringViewModel: FilteringViewModel = hiltViewModel(), + onButtonClick: () -> Unit = {}, +) { + + val isButtonValid = remember { mutableStateOf(false) } + + Scaffold( + modifier = modifier, + topBar = { + BackButtonTopAppBar( + onBackButtonClick = { navController.navigateUp() } + ) + } + ) { paddingValues -> + Column( + modifier = Modifier + .fillMaxSize() + .padding(paddingValues) + ) { + TerningImage( + painter = R.drawable.ic_filtering_status2, + modifier = modifier.padding( + top = 20.dp, + start = 24.dp + ) + ) + Text( + text = stringResource(id = R.string.filtering_status3_title), + style = TerningTheme.typography.title3, + modifier = modifier.padding( + top = 19.dp, + start = 24.dp + ) + ) + Text( + text = stringResource(id = R.string.filtering_status3_sub), + style = TerningTheme.typography.body5, + modifier = modifier.padding( + top = 3.dp, + start = 24.dp, + bottom = 25.dp + ) + ) + Spacer(modifier = modifier.weight(1f)) + RectangleButton( + style = TerningTheme.typography.button0, + paddingVertical = 25.dp, + text = R.string.filtering_button, + onButtonClick = { navController.navigateFilteringTwo() }, + modifier = modifier.padding(bottom = 12.dp), + isEnabled = isButtonValid.value + ) + } + } +} diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/component/StatusThreeRadioGroup.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/component/StatusThreeRadioGroup.kt new file mode 100644 index 000000000..97c078a31 --- /dev/null +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/component/StatusThreeRadioGroup.kt @@ -0,0 +1,4 @@ +package com.terning.feature.onboarding.filtering.component + +class StatusThreeRadioGroup { +} \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/component/StatusTwoRadioGroup.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/component/StatusTwoRadioGroup.kt index fe2fdd0de..9b6ef316a 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/component/StatusTwoRadioGroup.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/component/StatusTwoRadioGroup.kt @@ -11,6 +11,7 @@ import androidx.compose.runtime.mutableIntStateOf import androidx.compose.runtime.mutableStateListOf import androidx.compose.runtime.remember import androidx.compose.ui.Modifier +import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp import com.terning.core.designsystem.component.button.FilteringButton import com.terning.feature.R diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/FilteringThreeNavigation.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/FilteringThreeNavigation.kt new file mode 100644 index 000000000..9edc51e72 --- /dev/null +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/FilteringThreeNavigation.kt @@ -0,0 +1,4 @@ +package com.terning.feature.onboarding.filtering.navigation + +class FilteringThreeNavigation { +} \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/onboarding/start/StartScreen.kt b/feature/src/main/java/com/terning/feature/onboarding/filteringstart/FilteringStartScreen.kt similarity index 97% rename from feature/src/main/java/com/terning/feature/onboarding/start/StartScreen.kt rename to feature/src/main/java/com/terning/feature/onboarding/filteringstart/FilteringStartScreen.kt index 6f7932ad6..ce6b24823 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/start/StartScreen.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/filteringstart/FilteringStartScreen.kt @@ -1,4 +1,4 @@ -package com.terning.feature.onboarding.start +package com.terning.feature.onboarding.filteringstart import androidx.compose.animation.AnimatedVisibility import androidx.compose.animation.fadeIn @@ -29,7 +29,7 @@ import com.terning.feature.onboarding.filtering.navigation.navigateFilteringOne import kotlinx.coroutines.delay @Composable -fun StartScreen( +fun FilteringStartScreen( modifier: Modifier = Modifier, navController: NavController ) { diff --git a/feature/src/main/java/com/terning/feature/onboarding/start/navigation/StartNavigation.kt b/feature/src/main/java/com/terning/feature/onboarding/filteringstart/navigation/FilteringStartNavigation.kt similarity index 50% rename from feature/src/main/java/com/terning/feature/onboarding/start/navigation/StartNavigation.kt rename to feature/src/main/java/com/terning/feature/onboarding/filteringstart/navigation/FilteringStartNavigation.kt index 053b764ac..15cb69b4d 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/start/navigation/StartNavigation.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/filteringstart/navigation/FilteringStartNavigation.kt @@ -1,4 +1,4 @@ -package com.terning.feature.onboarding.start.navigation +package com.terning.feature.onboarding.filteringstart.navigation import androidx.navigation.NavController import androidx.navigation.NavGraphBuilder @@ -6,23 +6,23 @@ import androidx.navigation.NavHostController import androidx.navigation.NavOptions import androidx.navigation.compose.composable import com.terning.core.navigation.Route -import com.terning.feature.onboarding.start.StartScreen +import com.terning.feature.onboarding.filteringstart.FilteringStartScreen import kotlinx.serialization.Serializable -fun NavController.navigateStart(navOptions: NavOptions? = null) { +fun NavController.navigateFilteringStart(navOptions: NavOptions? = null) { navigate( - route = Start, + route = FilteringStart, navOptions = navOptions ) } -fun NavGraphBuilder.startNavGraph( +fun NavGraphBuilder.filteringStartNavGraph( navHostController: NavHostController ) { - composable { - StartScreen(navController = navHostController) + composable { + FilteringStartScreen(navController = navHostController) } } @Serializable -data object Start : Route \ No newline at end of file +data object FilteringStart : Route \ No newline at end of file From e3b7d1c5ac9275784d36af79f0f35bf2a140109b Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Fri, 12 Jul 2024 22:36:04 +0900 Subject: [PATCH 14/26] =?UTF-8?q?[FEAT/#48]=20navigation=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/main/MainScreen.kt | 2 ++ .../filtering/FilteringThreeScreen.kt | 6 ++-- .../filtering/FilteringTwoScreen.kt | 4 +-- .../navigation/FilteringThreeNavigation.kt | 4 --- .../navigation/FilteringTwoNavigation.kt | 2 -- .../filtering/navigation/ThreeNavigation.kt | 30 +++++++++++++++++++ 6 files changed, 36 insertions(+), 12 deletions(-) delete mode 100644 feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/FilteringThreeNavigation.kt create mode 100644 feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/ThreeNavigation.kt 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 633c39d7a..e1de6c5e2 100644 --- a/feature/src/main/java/com/terning/feature/main/MainScreen.kt +++ b/feature/src/main/java/com/terning/feature/main/MainScreen.kt @@ -24,6 +24,7 @@ import com.terning.feature.calendar.navigation.calendarNavGraph import com.terning.feature.home.home.navigation.homeNavGraph import com.terning.feature.mypage.navigation.myPageNavGraph import com.terning.feature.onboarding.filtering.navigation.filteringOneNavGraph +import com.terning.feature.onboarding.filtering.navigation.filteringThreeNavGraph import com.terning.feature.onboarding.filtering.navigation.filteringTwoNavGraph import com.terning.feature.onboarding.filteringstart.navigation.filteringStartNavGraph import com.terning.feature.onboarding.signin.navigation.signInNavGraph @@ -62,6 +63,7 @@ fun MainScreen( signUpNavGraph(navHostController = navigator.navController) filteringOneNavGraph(navHostController = navigator.navController) filteringTwoNavGraph(navHostController = navigator.navController) + filteringThreeNavGraph(navHostController = navigator.navController) searchProcessNavGraph(navHostController = navigator.navController) filteringStartNavGraph(navHostController = navigator.navController) } diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringThreeScreen.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringThreeScreen.kt index 4d6c7ea85..c5a4253fa 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringThreeScreen.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringThreeScreen.kt @@ -19,8 +19,7 @@ import com.terning.core.designsystem.component.image.TerningImage import com.terning.core.designsystem.component.topappbar.BackButtonTopAppBar import com.terning.core.designsystem.theme.TerningTheme import com.terning.feature.R -import com.terning.feature.onboarding.filtering.component.StatusTwoRadioGroup -import com.terning.feature.onboarding.filtering.navigation.navigateFilteringTwo +import com.terning.feature.onboarding.filtering.navigation.navigateFilteringThree @Composable fun FilteringThreeScreen( @@ -29,7 +28,6 @@ fun FilteringThreeScreen( filteringViewModel: FilteringViewModel = hiltViewModel(), onButtonClick: () -> Unit = {}, ) { - val isButtonValid = remember { mutableStateOf(false) } Scaffold( @@ -74,7 +72,7 @@ fun FilteringThreeScreen( style = TerningTheme.typography.button0, paddingVertical = 25.dp, text = R.string.filtering_button, - onButtonClick = { navController.navigateFilteringTwo() }, + onButtonClick = { navController.navigateFilteringThree() }, modifier = modifier.padding(bottom = 12.dp), isEnabled = isButtonValid.value ) diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringTwoScreen.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringTwoScreen.kt index 57fc3e770..d7f7d534c 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringTwoScreen.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringTwoScreen.kt @@ -20,7 +20,7 @@ import com.terning.core.designsystem.component.topappbar.BackButtonTopAppBar import com.terning.core.designsystem.theme.TerningTheme import com.terning.feature.R import com.terning.feature.onboarding.filtering.component.StatusTwoRadioGroup -import com.terning.feature.onboarding.filtering.navigation.navigateFilteringTwo +import com.terning.feature.onboarding.filtering.navigation.navigateFilteringThree @Composable fun FilteringTwoScreen( @@ -88,7 +88,7 @@ fun FilteringTwoScreen( style = TerningTheme.typography.button0, paddingVertical = 25.dp, text = R.string.filtering_button, - onButtonClick = { navController.navigateFilteringTwo() }, + onButtonClick = { navController.navigateFilteringThree() }, modifier = modifier.padding(bottom = 12.dp), isEnabled = isButtonValid.value ) diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/FilteringThreeNavigation.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/FilteringThreeNavigation.kt deleted file mode 100644 index 9edc51e72..000000000 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/FilteringThreeNavigation.kt +++ /dev/null @@ -1,4 +0,0 @@ -package com.terning.feature.onboarding.filtering.navigation - -class FilteringThreeNavigation { -} \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/FilteringTwoNavigation.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/FilteringTwoNavigation.kt index fbf52f81f..d7faf0d22 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/FilteringTwoNavigation.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/FilteringTwoNavigation.kt @@ -1,5 +1,3 @@ -@file:JvmName("FilteringThreeNavigationKt") - package com.terning.feature.onboarding.filtering.navigation import androidx.navigation.NavController diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/ThreeNavigation.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/ThreeNavigation.kt new file mode 100644 index 000000000..8c98afbae --- /dev/null +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/ThreeNavigation.kt @@ -0,0 +1,30 @@ +package com.terning.feature.onboarding.filtering.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.onboarding.filtering.FilteringThreeScreen +import kotlinx.serialization.Serializable + +fun NavController.navigateFilteringThree(navOptions: NavOptions? = null) { + navigate( + route = FilteringThree, + navOptions = navOptions + ) +} + +fun NavGraphBuilder.filteringThreeNavGraph( + navHostController: NavHostController +) { + composable { + FilteringThreeScreen( + navController = navHostController + ) + } +} + +@Serializable +data object FilteringThree : Route \ No newline at end of file From ab9dd9facc7b9aace645f1a33c10efa3c7345ceb Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Fri, 12 Jul 2024 22:41:33 +0900 Subject: [PATCH 15/26] =?UTF-8?q?[FEAT/#48]=20button3=5Fa=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/terning/core/designsystem/theme/Type.kt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/core/src/main/java/com/terning/core/designsystem/theme/Type.kt b/core/src/main/java/com/terning/core/designsystem/theme/Type.kt index fd067ced8..a650fd23e 100644 --- a/core/src/main/java/com/terning/core/designsystem/theme/Type.kt +++ b/core/src/main/java/com/terning/core/designsystem/theme/Type.kt @@ -39,6 +39,7 @@ class TerningTypography internal constructor( button1: TextStyle, button2: TextStyle, button3: TextStyle, + button3_a: TextStyle, button4: TextStyle, button5: TextStyle, button6: TextStyle, @@ -88,6 +89,8 @@ class TerningTypography internal constructor( private set var button3: TextStyle by mutableStateOf(button3) private set + var button3_a: TextStyle by mutableStateOf(button3_a) + private set var button4: TextStyle by mutableStateOf(button4) private set var button5: TextStyle by mutableStateOf(button5) @@ -129,6 +132,7 @@ class TerningTypography internal constructor( button1: TextStyle = this.button1, button2: TextStyle = this.button2, button3: TextStyle = this.button3, + button3_a: TextStyle = this.button3_a, button4: TextStyle = this.button4, button5: TextStyle = this.button5, button6: TextStyle = this.button6, @@ -159,6 +163,7 @@ class TerningTypography internal constructor( button1, button2, button3, + button3_a, button4, button5, button6, @@ -191,6 +196,7 @@ class TerningTypography internal constructor( button1 = other.button1 button2 = other.button2 button3 = other.button3 + button3_a = other.button3_a button4 = other.button4 button5 = other.button5 button6 = other.button6 @@ -340,6 +346,13 @@ fun TerningTypography(): TerningTypography { letterSpacing = (0.002).em, lineHeight = (15.6).sp, ), + button3_a = TextStyle( + fontFamily = PretendardMedium, + fontWeight = FontWeight.Medium, + fontSize = 13.sp, + letterSpacing = (0.002).em, + lineHeight = (19.6).sp, + ), button4 = TextStyle( fontFamily = PretendardMedium, fontWeight = FontWeight.Medium, From 6f334c3781ec32320f712a6ef64468538e8602c8 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Fri, 12 Jul 2024 23:52:14 +0900 Subject: [PATCH 16/26] =?UTF-8?q?[FEAT/#48]=20padding=20vertical=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/build.gradle.kts | 5 + .../component/button/FilteringButton.kt | 2 +- .../component/datepicker/DatePicker.kt | 376 ++++++++++++++++++ .../filtering/FilteringThreeScreen.kt | 11 +- .../component/StatusTwoRadioGroup.kt | 2 +- 5 files changed, 393 insertions(+), 3 deletions(-) create mode 100644 core/src/main/java/com/terning/core/designsystem/component/datepicker/DatePicker.kt diff --git a/core/build.gradle.kts b/core/build.gradle.kts index eae55974c..9a88a1270 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -66,4 +66,9 @@ dependencies { testImplementation(libs.junit) androidTestImplementation(libs.androidx.junit) androidTestImplementation(libs.androidx.espresso.core) + + implementation("org.jetbrains.kotlinx:kotlinx-collections-immutable:0.3.5") + implementation(platform(libs.okhttp.bom)) + implementation(libs.okhttp) + implementation(libs.okhttp.logging) } \ No newline at end of file diff --git a/core/src/main/java/com/terning/core/designsystem/component/button/FilteringButton.kt b/core/src/main/java/com/terning/core/designsystem/component/button/FilteringButton.kt index 968c0f285..ded84d07e 100644 --- a/core/src/main/java/com/terning/core/designsystem/component/button/FilteringButton.kt +++ b/core/src/main/java/com/terning/core/designsystem/component/button/FilteringButton.kt @@ -74,7 +74,7 @@ fun FilteringButton( ) { Text( text = stringResource(id = text), - style = TerningTheme.typography.button3, + style = TerningTheme.typography.button3_a, textAlign = TextAlign.Center ) } diff --git a/core/src/main/java/com/terning/core/designsystem/component/datepicker/DatePicker.kt b/core/src/main/java/com/terning/core/designsystem/component/datepicker/DatePicker.kt new file mode 100644 index 000000000..7e376479f --- /dev/null +++ b/core/src/main/java/com/terning/core/designsystem/component/datepicker/DatePicker.kt @@ -0,0 +1,376 @@ +package com.terning.core.designsystem.component.datepicker + +import androidx.compose.foundation.background +import androidx.compose.foundation.border +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.defaultMinSize +import androidx.compose.foundation.layout.fillMaxHeight +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.layout.width +import androidx.compose.foundation.lazy.LazyColumn +import androidx.compose.foundation.lazy.rememberLazyListState +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material3.Button +import androidx.compose.material3.ExperimentalMaterial3Api +import androidx.compose.material3.HorizontalDivider +import androidx.compose.material3.Icon +import androidx.compose.material3.ModalBottomSheet +import androidx.compose.material3.Text +import androidx.compose.material3.rememberModalBottomSheetState +import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.derivedStateOf +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.draw.alpha +import androidx.compose.ui.draw.clip +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.res.vectorResource +import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import java.text.SimpleDateFormat +import java.util.Calendar +import java.util.Locale +import okhttp3.internal.immutableListOf +import com.terning.core.R +import com.terning.core.designsystem.theme.Black +import com.terning.core.designsystem.theme.CalPink +import com.terning.core.designsystem.theme.CalPurple +import com.terning.core.designsystem.theme.Grey150 +import com.terning.core.designsystem.theme.TerningPointTheme +import com.terning.core.designsystem.theme.White +import com.terning.core.extension.noRippleClickable +import okhttp3.internal.toImmutableList + +@Composable +fun DatePicker( + value: String, + placeHolder: String, + borderColor: Color, + isEditable: Boolean, + onClicked: () -> Unit = {}, + modifier: Modifier = Modifier, +) { + val isEmpty by remember(value) { derivedStateOf { value.isEmpty() } } + + val newModifier = modifier + .fillMaxWidth() + .defaultMinSize(minHeight = 39.dp) + .clip(RoundedCornerShape(9.dp)) + .then( + if (isEmpty || !isEditable) { + Modifier + } else { + Modifier.border( + width = 1.dp, + color = borderColor, + shape = RoundedCornerShape(10.dp) + ) + } + ) + + val backgroundColor = remember(isEmpty, isEditable) { + if (isEmpty || !isEditable) { + Grey150 + } else { + White + } + } + + Box( + modifier = newModifier + .background(backgroundColor, RoundedCornerShape(9.dp)) + .noRippleClickable { if (isEditable) onClicked() } + ) { + Row( + modifier = Modifier + .padding(horizontal = 14.dp, vertical = 10.dp) + .fillMaxWidth(), + horizontalArrangement = Arrangement.SpaceBetween, + verticalAlignment = Alignment.CenterVertically + ) { + Text( + modifier = Modifier.padding(), + text = if (isEmpty) placeHolder else value, + color = if (isEmpty) Color.Red else Color.Blue, + ) + Icon( + imageVector = ImageVector.vectorResource(id = R.drawable.ic_right), + contentDescription = "date picker icon", + tint = Color.Green + ) + } + } +} + +@OptIn(ExperimentalMaterial3Api::class) +@Composable +fun DataPickerBottomSheet(onSelected: (String) -> Unit, onDismissRequest: () -> Unit) { + val sheetState = rememberModalBottomSheetState() + + val formatter = SimpleDateFormat("yyyy.MM.dd", Locale.KOREA) + var chosenYear by remember { mutableIntStateOf(currentYear) } + var chosenMonth by remember { mutableIntStateOf(currentMonth) } + var chosenDay by remember { mutableIntStateOf(currentDay) } + + val isValidDate by remember { derivedStateOf { calculateValidDate(chosenYear, chosenMonth, chosenDay) } } + + ModalBottomSheet( + onDismissRequest = onDismissRequest, + sheetState = sheetState + ) { + DatePickerUI( + isValidDate = isValidDate, + chosenYear = chosenYear, + chosenMonth = chosenMonth, + chosenDay = chosenDay, + onYearChosen = { chosenYear = it }, + onMonthChosen = { chosenMonth = it }, + onDayChosen = { chosenDay = it } + ) + Spacer(modifier = Modifier.height(20.dp)) + Button( + modifier = Modifier + .padding(horizontal = 20.dp) + .fillMaxWidth() + .background( + color = if (isValidDate) Black else Color.Red, + shape = RoundedCornerShape(9.dp) + ), + onClick = { + if (isValidDate) { + val calendar = Calendar.getInstance().apply { + set(chosenYear, chosenMonth - 1, chosenDay) + } + val formattedDate = formatter.format(calendar.time) + + onSelected(formattedDate) + } + } + ) + { + Text(text = "확인") + } + Spacer(modifier = Modifier.height(60.dp)) + } +} + +fun calculateValidDate(year: Int, month: Int, day: Int): Boolean { + val givenCalendar = Calendar.getInstance().apply { + set(year, month - 1, day) + } + val referenceCalendar = Calendar.getInstance() + + return !givenCalendar.after(referenceCalendar) +} + +@Composable +fun DatePickerUI( + isValidDate: Boolean, + chosenYear: Int, + chosenMonth: Int, + chosenDay: Int, + onYearChosen: (Int) -> Unit, + onMonthChosen: (Int) -> Unit, + onDayChosen: (Int) -> Unit, +) { + Column( + horizontalAlignment = Alignment.CenterHorizontally, + modifier = Modifier + .fillMaxWidth() + .padding(vertical = 10.dp, horizontal = 5.dp) + ) { + DateSelectionSection( + isValidDate = isValidDate, + chosenYear = chosenYear, + chosenMonth = chosenMonth, + chosenDay = chosenDay, + onYearChosen = { onYearChosen(it.toInt()) }, + onMonthChosen = { onMonthChosen(it.toInt()) }, + onDayChosen = { onDayChosen(it.toInt()) }, + ) + } +} + +@Composable +fun DateSelectionSection( + isValidDate: Boolean, + chosenYear: Int, + chosenMonth: Int, + chosenDay: Int, + onYearChosen: (String) -> Unit, + onMonthChosen: (String) -> Unit, + onDayChosen: (String) -> Unit, +) { + Row( + horizontalArrangement = Arrangement.Center, + modifier = Modifier.fillMaxWidth() + ) { + DateItemsPicker( + isValidDate = isValidDate, + max = currentYear - 1950, + items = years.toImmutableList(), + firstIndex = (chosenYear - START_YEAR), + onItemSelected = onYearChosen + ) + Spacer(modifier = Modifier.width(10.dp)) + DateItemsPicker( + isValidDate = isValidDate, + max = currentMonth, + items = monthsNumber.toImmutableList(), + firstIndex = chosenMonth, + onItemSelected = onMonthChosen + ) + Spacer(modifier = Modifier.width(10.dp)) + DateItemsPicker( + isValidDate = isValidDate, + max = currentDay - 1, + items = when { + (chosenYear % 4 == 0) && chosenMonth == 2 -> days29.toImmutableList() + chosenMonth == 2 -> days28.toImmutableList() + days30Months.contains(chosenMonth) -> days30.toImmutableList() + else -> days31.toImmutableList() + }, + firstIndex = chosenDay - 1, + onItemSelected = onDayChosen + ) + } +} + +@Composable +fun DateItemsPicker( + isValidDate: Boolean, + max: Int, + items: List, + firstIndex: Int, + onItemSelected: (String) -> Unit, + modifier: Modifier = Modifier +) { + val listState = rememberLazyListState(firstIndex) + val currentValue = remember { mutableStateOf("") } + + LaunchedEffect(!listState.isScrollInProgress, isValidDate) { + if (isValidDate) { + onItemSelected(currentValue.value) + listState.animateScrollToItem(index = listState.firstVisibleItemIndex) + } else { + if (max < currentValue.value.toInt()) { + listState.animateScrollToItem(index = max) + onItemSelected(currentValue.value) + } + } + } + + Box( + modifier = Modifier.height(108.dp), + contentAlignment = Alignment.Center + ) { + Column( + modifier = modifier.fillMaxHeight(), + verticalArrangement = Arrangement.SpaceEvenly + ) { + HorizontalDivider( + modifier = Modifier.size(height = 1.dp, width = 60.dp), + color = Black + ) + HorizontalDivider( + modifier = Modifier.size(height = 1.dp, width = 60.dp), + color = Black + ) + } + LazyColumn( + modifier = modifier, + horizontalAlignment = Alignment.CenterHorizontally, + state = listState, + ) { + items(items.size) { + val index = it % items.size + val firstVisibleItemIndex by remember { + derivedStateOf { listState.firstVisibleItemIndex } + } + if (it == firstVisibleItemIndex + 1) { + currentValue.value = items[index] + } + + Spacer(modifier = Modifier.height(6.dp)) + + Text( + text = items[index], + modifier = Modifier.alpha(if (it == firstVisibleItemIndex + 1) 1f else 0.3f), + textAlign = TextAlign.Center + ) + + Spacer(modifier = Modifier.height(6.dp)) + } + } + } +} + +private val currentYear = Calendar.getInstance().get(Calendar.YEAR) +private val currentMonth = Calendar.getInstance().get(Calendar.MONTH) +private val currentDay = Calendar.getInstance().get(Calendar.DAY_OF_MONTH) + +private const val START_YEAR = 1950 +private const val END_YEAR = 2100 +private val years = (listOf("") + (START_YEAR..END_YEAR).map { it.toString() } + listOf("")).toImmutableList() +private val monthsNumber = (listOf("") + (1..12).map { it.toString() } + listOf("")).toImmutableList() +private val days28 = (listOf("") + (1..28).map { it.toString() } + listOf("")).toImmutableList() +private val days29 = (listOf("") + (1..29).map { it.toString() } + listOf("")).toImmutableList() +private val days30 = (listOf("") + (1..30).map { it.toString() } + listOf("")).toImmutableList() // 4,6,9,11 +private val days31 = (listOf("") + (1..31).map { it.toString() } + listOf("")).toImmutableList() // 1,3,5,7,8,10.12 +private val days30Months = immutableListOf(4, 6, 9, 11) + +//@@Preview(showBackground = true) +//@Composable +//private fun DatePickerPreview() { +// TerningPointTheme { +// DatePicker( +// value = "2024.12.25", +// onClicked = {}, +// borderColor = getLevelTextColor(2), +// placeHolder = "날짜를 입력해주세요.", +// isEditable = true +// ) +// } +//} + +//@Preview(showBackground = true) +//@Composable +//private fun CustomDatePickerPreview() { +// val chosenYear = remember { mutableIntStateOf(currentYear) } +// val chosenMonth = remember { mutableIntStateOf(currentMonth) } +// val chosenDay = remember { mutableIntStateOf(currentDay) } +// TerningPointTheme { +// DatePickerUI( +// isValidDate = true, +// chosenYear = chosenYear.value, +// chosenMonth = chosenMonth.value, +// chosenDay = chosenDay.value, +// onYearChosen = { chosenYear.value = it }, +// onMonthChosen = { chosenMonth.value = it }, +// onDayChosen = { chosenDay.value = it } +// ) +// } +//} + +@Composable +fun getLevelTextColor(rank: Int) = when (rank) { + 1 -> CalPink + 2 -> CalPurple + 3 -> Color.Green + else -> Color.Red +} \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringThreeScreen.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringThreeScreen.kt index c5a4253fa..b076595b9 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringThreeScreen.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringThreeScreen.kt @@ -1,5 +1,6 @@ package com.terning.feature.onboarding.filtering +import androidx.compose.animation.fadeIn import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize @@ -15,8 +16,10 @@ 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.DatePicker import com.terning.core.designsystem.component.image.TerningImage import com.terning.core.designsystem.component.topappbar.BackButtonTopAppBar +import com.terning.core.designsystem.theme.TerningMain import com.terning.core.designsystem.theme.TerningTheme import com.terning.feature.R import com.terning.feature.onboarding.filtering.navigation.navigateFilteringThree @@ -44,7 +47,7 @@ fun FilteringThreeScreen( .padding(paddingValues) ) { TerningImage( - painter = R.drawable.ic_filtering_status2, + painter = R.drawable.ic_filtering_status3, modifier = modifier.padding( top = 20.dp, start = 24.dp @@ -67,6 +70,12 @@ fun FilteringThreeScreen( bottom = 25.dp ) ) + DatePicker( + value = "value", + placeHolder= "placeHolder", + borderColor = TerningMain, + isEditable= false, + ) Spacer(modifier = modifier.weight(1f)) RectangleButton( style = TerningTheme.typography.button0, diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/component/StatusTwoRadioGroup.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/component/StatusTwoRadioGroup.kt index 9b6ef316a..163334fcb 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/component/StatusTwoRadioGroup.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/component/StatusTwoRadioGroup.kt @@ -54,7 +54,7 @@ fun StatusTwoRadioGroup( onButtonClick(index) }, cornerRadius = 15.dp, - paddingVertical = if (selectedButton[index]) 17.dp else 26.dp + paddingVertical = if (selectedButton[index]) 15.dp else 26.dp ) } } From 08ad2bb2d67763f34a6dc157a9a7e26d7424f146 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Sat, 13 Jul 2024 03:28:54 +0900 Subject: [PATCH 17/26] =?UTF-8?q?[FEAT/#48]=20Calendar=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/datepicker/DatePicker.kt | 271 ++---------------- .../filtering/FilteringThreeScreen.kt | 27 +- 2 files changed, 36 insertions(+), 262 deletions(-) diff --git a/core/src/main/java/com/terning/core/designsystem/component/datepicker/DatePicker.kt b/core/src/main/java/com/terning/core/designsystem/component/datepicker/DatePicker.kt index 7e376479f..1ef834540 100644 --- a/core/src/main/java/com/terning/core/designsystem/component/datepicker/DatePicker.kt +++ b/core/src/main/java/com/terning/core/designsystem/component/datepicker/DatePicker.kt @@ -1,13 +1,10 @@ package com.terning.core.designsystem.component.datepicker -import androidx.compose.foundation.background -import androidx.compose.foundation.border import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer -import androidx.compose.foundation.layout.defaultMinSize import androidx.compose.foundation.layout.fillMaxHeight import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height @@ -16,178 +13,39 @@ import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.rememberLazyListState -import androidx.compose.foundation.shape.RoundedCornerShape -import androidx.compose.material3.Button -import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.HorizontalDivider -import androidx.compose.material3.Icon -import androidx.compose.material3.ModalBottomSheet import androidx.compose.material3.Text -import androidx.compose.material3.rememberModalBottomSheetState import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.derivedStateOf 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.draw.alpha -import androidx.compose.ui.draw.clip -import androidx.compose.ui.graphics.Color -import androidx.compose.ui.graphics.vector.ImageVector -import androidx.compose.ui.res.vectorResource import androidx.compose.ui.text.style.TextAlign -import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp -import java.text.SimpleDateFormat -import java.util.Calendar -import java.util.Locale -import okhttp3.internal.immutableListOf -import com.terning.core.R -import com.terning.core.designsystem.theme.Black -import com.terning.core.designsystem.theme.CalPink -import com.terning.core.designsystem.theme.CalPurple -import com.terning.core.designsystem.theme.Grey150 -import com.terning.core.designsystem.theme.TerningPointTheme -import com.terning.core.designsystem.theme.White -import com.terning.core.extension.noRippleClickable +import com.terning.core.designsystem.theme.Grey300 +import com.terning.core.designsystem.theme.Grey500 +import com.terning.core.designsystem.theme.TerningMain +import com.terning.core.designsystem.theme.TerningTheme import okhttp3.internal.toImmutableList -@Composable -fun DatePicker( - value: String, - placeHolder: String, - borderColor: Color, - isEditable: Boolean, - onClicked: () -> Unit = {}, - modifier: Modifier = Modifier, -) { - val isEmpty by remember(value) { derivedStateOf { value.isEmpty() } } - - val newModifier = modifier - .fillMaxWidth() - .defaultMinSize(minHeight = 39.dp) - .clip(RoundedCornerShape(9.dp)) - .then( - if (isEmpty || !isEditable) { - Modifier - } else { - Modifier.border( - width = 1.dp, - color = borderColor, - shape = RoundedCornerShape(10.dp) - ) - } - ) - - val backgroundColor = remember(isEmpty, isEditable) { - if (isEmpty || !isEditable) { - Grey150 - } else { - White - } - } - - Box( - modifier = newModifier - .background(backgroundColor, RoundedCornerShape(9.dp)) - .noRippleClickable { if (isEditable) onClicked() } - ) { - Row( - modifier = Modifier - .padding(horizontal = 14.dp, vertical = 10.dp) - .fillMaxWidth(), - horizontalArrangement = Arrangement.SpaceBetween, - verticalAlignment = Alignment.CenterVertically - ) { - Text( - modifier = Modifier.padding(), - text = if (isEmpty) placeHolder else value, - color = if (isEmpty) Color.Red else Color.Blue, - ) - Icon( - imageVector = ImageVector.vectorResource(id = R.drawable.ic_right), - contentDescription = "date picker icon", - tint = Color.Green - ) - } - } -} - -@OptIn(ExperimentalMaterial3Api::class) -@Composable -fun DataPickerBottomSheet(onSelected: (String) -> Unit, onDismissRequest: () -> Unit) { - val sheetState = rememberModalBottomSheetState() - - val formatter = SimpleDateFormat("yyyy.MM.dd", Locale.KOREA) - var chosenYear by remember { mutableIntStateOf(currentYear) } - var chosenMonth by remember { mutableIntStateOf(currentMonth) } - var chosenDay by remember { mutableIntStateOf(currentDay) } - - val isValidDate by remember { derivedStateOf { calculateValidDate(chosenYear, chosenMonth, chosenDay) } } - - ModalBottomSheet( - onDismissRequest = onDismissRequest, - sheetState = sheetState - ) { - DatePickerUI( - isValidDate = isValidDate, - chosenYear = chosenYear, - chosenMonth = chosenMonth, - chosenDay = chosenDay, - onYearChosen = { chosenYear = it }, - onMonthChosen = { chosenMonth = it }, - onDayChosen = { chosenDay = it } - ) - Spacer(modifier = Modifier.height(20.dp)) - Button( - modifier = Modifier - .padding(horizontal = 20.dp) - .fillMaxWidth() - .background( - color = if (isValidDate) Black else Color.Red, - shape = RoundedCornerShape(9.dp) - ), - onClick = { - if (isValidDate) { - val calendar = Calendar.getInstance().apply { - set(chosenYear, chosenMonth - 1, chosenDay) - } - val formattedDate = formatter.format(calendar.time) - - onSelected(formattedDate) - } - } - ) - { - Text(text = "확인") - } - Spacer(modifier = Modifier.height(60.dp)) - } -} - -fun calculateValidDate(year: Int, month: Int, day: Int): Boolean { - val givenCalendar = Calendar.getInstance().apply { - set(year, month - 1, day) - } - val referenceCalendar = Calendar.getInstance() - - return !givenCalendar.after(referenceCalendar) -} +private const val START_YEAR = 2023 +private const val END_YEAR = 2025 +private val years = + (listOf("") + (START_YEAR..END_YEAR).map { it.toString() } + listOf("")).toImmutableList() +private val monthsNumber = + (listOf("") + (1..12).map { it.toString() } + listOf("")).toImmutableList() @Composable fun DatePickerUI( - isValidDate: Boolean, chosenYear: Int, chosenMonth: Int, - chosenDay: Int, - onYearChosen: (Int) -> Unit, - onMonthChosen: (Int) -> Unit, - onDayChosen: (Int) -> Unit, + onYearChosen: (Int) -> Unit = {}, + onMonthChosen: (Int) -> Unit = {}, ) { + Column( horizontalAlignment = Alignment.CenterHorizontally, modifier = Modifier @@ -195,66 +53,41 @@ fun DatePickerUI( .padding(vertical = 10.dp, horizontal = 5.dp) ) { DateSelectionSection( - isValidDate = isValidDate, chosenYear = chosenYear, chosenMonth = chosenMonth, - chosenDay = chosenDay, onYearChosen = { onYearChosen(it.toInt()) }, onMonthChosen = { onMonthChosen(it.toInt()) }, - onDayChosen = { onDayChosen(it.toInt()) }, ) } } @Composable fun DateSelectionSection( - isValidDate: Boolean, chosenYear: Int, chosenMonth: Int, - chosenDay: Int, onYearChosen: (String) -> Unit, onMonthChosen: (String) -> Unit, - onDayChosen: (String) -> Unit, ) { Row( horizontalArrangement = Arrangement.Center, modifier = Modifier.fillMaxWidth() ) { DateItemsPicker( - isValidDate = isValidDate, - max = currentYear - 1950, items = years.toImmutableList(), firstIndex = (chosenYear - START_YEAR), onItemSelected = onYearChosen ) Spacer(modifier = Modifier.width(10.dp)) DateItemsPicker( - isValidDate = isValidDate, - max = currentMonth, items = monthsNumber.toImmutableList(), firstIndex = chosenMonth, onItemSelected = onMonthChosen ) - Spacer(modifier = Modifier.width(10.dp)) - DateItemsPicker( - isValidDate = isValidDate, - max = currentDay - 1, - items = when { - (chosenYear % 4 == 0) && chosenMonth == 2 -> days29.toImmutableList() - chosenMonth == 2 -> days28.toImmutableList() - days30Months.contains(chosenMonth) -> days30.toImmutableList() - else -> days31.toImmutableList() - }, - firstIndex = chosenDay - 1, - onItemSelected = onDayChosen - ) } } @Composable fun DateItemsPicker( - isValidDate: Boolean, - max: Int, items: List, firstIndex: Int, onItemSelected: (String) -> Unit, @@ -263,16 +96,9 @@ fun DateItemsPicker( val listState = rememberLazyListState(firstIndex) val currentValue = remember { mutableStateOf("") } - LaunchedEffect(!listState.isScrollInProgress, isValidDate) { - if (isValidDate) { - onItemSelected(currentValue.value) - listState.animateScrollToItem(index = listState.firstVisibleItemIndex) - } else { - if (max < currentValue.value.toInt()) { - listState.animateScrollToItem(index = max) - onItemSelected(currentValue.value) - } - } + LaunchedEffect(!listState.isScrollInProgress) { + onItemSelected(currentValue.value) + listState.animateScrollToItem(index = listState.firstVisibleItemIndex) } Box( @@ -285,11 +111,11 @@ fun DateItemsPicker( ) { HorizontalDivider( modifier = Modifier.size(height = 1.dp, width = 60.dp), - color = Black + color = TerningMain ) HorizontalDivider( modifier = Modifier.size(height = 1.dp, width = 60.dp), - color = Black + color = TerningMain ) } LazyColumn( @@ -305,72 +131,15 @@ fun DateItemsPicker( if (it == firstVisibleItemIndex + 1) { currentValue.value = items[index] } - Spacer(modifier = Modifier.height(6.dp)) - Text( text = items[index], - modifier = Modifier.alpha(if (it == firstVisibleItemIndex + 1) 1f else 0.3f), + style = TerningTheme.typography.title3, + color = if (it == firstVisibleItemIndex + 1) Grey500 else Grey300, textAlign = TextAlign.Center ) - Spacer(modifier = Modifier.height(6.dp)) } } } } - -private val currentYear = Calendar.getInstance().get(Calendar.YEAR) -private val currentMonth = Calendar.getInstance().get(Calendar.MONTH) -private val currentDay = Calendar.getInstance().get(Calendar.DAY_OF_MONTH) - -private const val START_YEAR = 1950 -private const val END_YEAR = 2100 -private val years = (listOf("") + (START_YEAR..END_YEAR).map { it.toString() } + listOf("")).toImmutableList() -private val monthsNumber = (listOf("") + (1..12).map { it.toString() } + listOf("")).toImmutableList() -private val days28 = (listOf("") + (1..28).map { it.toString() } + listOf("")).toImmutableList() -private val days29 = (listOf("") + (1..29).map { it.toString() } + listOf("")).toImmutableList() -private val days30 = (listOf("") + (1..30).map { it.toString() } + listOf("")).toImmutableList() // 4,6,9,11 -private val days31 = (listOf("") + (1..31).map { it.toString() } + listOf("")).toImmutableList() // 1,3,5,7,8,10.12 -private val days30Months = immutableListOf(4, 6, 9, 11) - -//@@Preview(showBackground = true) -//@Composable -//private fun DatePickerPreview() { -// TerningPointTheme { -// DatePicker( -// value = "2024.12.25", -// onClicked = {}, -// borderColor = getLevelTextColor(2), -// placeHolder = "날짜를 입력해주세요.", -// isEditable = true -// ) -// } -//} - -//@Preview(showBackground = true) -//@Composable -//private fun CustomDatePickerPreview() { -// val chosenYear = remember { mutableIntStateOf(currentYear) } -// val chosenMonth = remember { mutableIntStateOf(currentMonth) } -// val chosenDay = remember { mutableIntStateOf(currentDay) } -// TerningPointTheme { -// DatePickerUI( -// isValidDate = true, -// chosenYear = chosenYear.value, -// chosenMonth = chosenMonth.value, -// chosenDay = chosenDay.value, -// onYearChosen = { chosenYear.value = it }, -// onMonthChosen = { chosenMonth.value = it }, -// onDayChosen = { chosenDay.value = it } -// ) -// } -//} - -@Composable -fun getLevelTextColor(rank: Int) = when (rank) { - 1 -> CalPink - 2 -> CalPurple - 3 -> Color.Green - else -> Color.Red -} \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringThreeScreen.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringThreeScreen.kt index b076595b9..2edcd0d0b 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringThreeScreen.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringThreeScreen.kt @@ -1,6 +1,5 @@ package com.terning.feature.onboarding.filtering -import androidx.compose.animation.fadeIn import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize @@ -8,21 +7,24 @@ import androidx.compose.foundation.layout.padding import androidx.compose.material3.Scaffold import androidx.compose.material3.Text import androidx.compose.runtime.Composable +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.Modifier 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.DatePicker +import com.terning.core.designsystem.component.datepicker.DatePickerUI import com.terning.core.designsystem.component.image.TerningImage import com.terning.core.designsystem.component.topappbar.BackButtonTopAppBar -import com.terning.core.designsystem.theme.TerningMain import com.terning.core.designsystem.theme.TerningTheme import com.terning.feature.R import com.terning.feature.onboarding.filtering.navigation.navigateFilteringThree +import java.util.Calendar @Composable fun FilteringThreeScreen( @@ -31,7 +33,10 @@ fun FilteringThreeScreen( filteringViewModel: FilteringViewModel = hiltViewModel(), onButtonClick: () -> Unit = {}, ) { - val isButtonValid = remember { mutableStateOf(false) } + var chosenYear by remember { mutableIntStateOf(Calendar.getInstance().get(Calendar.YEAR)) } + var chosenMonth by remember { mutableIntStateOf(Calendar.getInstance().get(Calendar.MONTH)) } + + val isDateMove by remember { mutableStateOf(false) } Scaffold( modifier = modifier, @@ -70,21 +75,21 @@ fun FilteringThreeScreen( bottom = 25.dp ) ) - DatePicker( - value = "value", - placeHolder= "placeHolder", - borderColor = TerningMain, - isEditable= false, + DatePickerUI( + chosenYear = chosenYear, + chosenMonth = chosenMonth, + onYearChosen = { chosenYear = it }, + onMonthChosen = { chosenMonth = it }, ) Spacer(modifier = modifier.weight(1f)) RectangleButton( style = TerningTheme.typography.button0, + isEnabled = isDateMove, paddingVertical = 25.dp, text = R.string.filtering_button, onButtonClick = { navController.navigateFilteringThree() }, modifier = modifier.padding(bottom = 12.dp), - isEnabled = isButtonValid.value ) } } -} +} \ No newline at end of file From e05f2c8a647553e442ae418072b7e33863eecc8b Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Sat, 13 Jul 2024 04:04:38 +0900 Subject: [PATCH 18/26] =?UTF-8?q?[FEAT/#48]=20StartHomeScreen=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/terning/feature/main/MainNavigator.kt | 4 +-- .../com/terning/feature/main/MainScreen.kt | 6 ++-- .../filtering/FilteringThreeScreen.kt | 3 +- .../StartFilteringScreen.kt} | 4 +-- .../navigation/StartFilteringNavigation.kt} | 16 +++++------ .../onboarding/starthome/StartHomeScreen.kt | 12 ++++++++ .../navigation/StartHomeNavigation.kt | 28 +++++++++++++++++++ 7 files changed, 58 insertions(+), 15 deletions(-) rename feature/src/main/java/com/terning/feature/onboarding/{filteringstart/FilteringStartScreen.kt => startfiltering/StartFilteringScreen.kt} (97%) rename feature/src/main/java/com/terning/feature/onboarding/{filteringstart/navigation/FilteringStartNavigation.kt => startfiltering/navigation/StartFilteringNavigation.kt} (51%) create mode 100644 feature/src/main/java/com/terning/feature/onboarding/starthome/StartHomeScreen.kt create mode 100644 feature/src/main/java/com/terning/feature/onboarding/starthome/navigation/StartHomeNavigation.kt 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 53042f701..34adba522 100644 --- a/feature/src/main/java/com/terning/feature/main/MainNavigator.kt +++ b/feature/src/main/java/com/terning/feature/main/MainNavigator.kt @@ -12,7 +12,7 @@ import androidx.navigation.navOptions import com.terning.feature.calendar.navigation.navigateCalendar import com.terning.feature.home.home.navigation.navigateHome import com.terning.feature.mypage.navigation.navigateMyPage -import com.terning.feature.onboarding.filteringstart.navigation.FilteringStart +import com.terning.feature.onboarding.startfiltering.navigation.StartFiltering import com.terning.feature.search.search.navigation.navigateSearch class MainNavigator( @@ -22,7 +22,7 @@ class MainNavigator( @Composable get() = navController .currentBackStackEntryAsState().value?.destination - val startDestination = FilteringStart + val startDestination = StartFiltering 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 e1de6c5e2..a364719a7 100644 --- a/feature/src/main/java/com/terning/feature/main/MainScreen.kt +++ b/feature/src/main/java/com/terning/feature/main/MainScreen.kt @@ -26,9 +26,10 @@ import com.terning.feature.mypage.navigation.myPageNavGraph import com.terning.feature.onboarding.filtering.navigation.filteringOneNavGraph import com.terning.feature.onboarding.filtering.navigation.filteringThreeNavGraph import com.terning.feature.onboarding.filtering.navigation.filteringTwoNavGraph -import com.terning.feature.onboarding.filteringstart.navigation.filteringStartNavGraph import com.terning.feature.onboarding.signin.navigation.signInNavGraph import com.terning.feature.onboarding.signup.navigation.signUpNavGraph +import com.terning.feature.onboarding.startfiltering.navigation.startFilteringNavGraph +import com.terning.feature.onboarding.starthome.navigation.startHomeNavGraph import com.terning.feature.search.search.navigation.searchNavGraph import com.terning.feature.search.searchprocess.navigation.searchProcessNavGraph @@ -65,7 +66,8 @@ fun MainScreen( filteringTwoNavGraph(navHostController = navigator.navController) filteringThreeNavGraph(navHostController = navigator.navController) searchProcessNavGraph(navHostController = navigator.navController) - filteringStartNavGraph(navHostController = navigator.navController) + startFilteringNavGraph(navHostController = navigator.navController) + startHomeNavGraph(navHostController = navigator.navController) } } } diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringThreeScreen.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringThreeScreen.kt index 2edcd0d0b..6f78ce9b6 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringThreeScreen.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringThreeScreen.kt @@ -24,6 +24,7 @@ import com.terning.core.designsystem.component.topappbar.BackButtonTopAppBar import com.terning.core.designsystem.theme.TerningTheme import com.terning.feature.R import com.terning.feature.onboarding.filtering.navigation.navigateFilteringThree +import com.terning.feature.onboarding.starthome.navigation.navigateStartHome import java.util.Calendar @Composable @@ -87,7 +88,7 @@ fun FilteringThreeScreen( isEnabled = isDateMove, paddingVertical = 25.dp, text = R.string.filtering_button, - onButtonClick = { navController.navigateFilteringThree() }, + onButtonClick = { navController.navigateStartHome() }, modifier = modifier.padding(bottom = 12.dp), ) } diff --git a/feature/src/main/java/com/terning/feature/onboarding/filteringstart/FilteringStartScreen.kt b/feature/src/main/java/com/terning/feature/onboarding/startfiltering/StartFilteringScreen.kt similarity index 97% rename from feature/src/main/java/com/terning/feature/onboarding/filteringstart/FilteringStartScreen.kt rename to feature/src/main/java/com/terning/feature/onboarding/startfiltering/StartFilteringScreen.kt index ce6b24823..7b1e760b6 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/filteringstart/FilteringStartScreen.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/startfiltering/StartFilteringScreen.kt @@ -1,4 +1,4 @@ -package com.terning.feature.onboarding.filteringstart +package com.terning.feature.onboarding.startfiltering import androidx.compose.animation.AnimatedVisibility import androidx.compose.animation.fadeIn @@ -29,7 +29,7 @@ import com.terning.feature.onboarding.filtering.navigation.navigateFilteringOne import kotlinx.coroutines.delay @Composable -fun FilteringStartScreen( +fun StartFilteringScreen( modifier: Modifier = Modifier, navController: NavController ) { diff --git a/feature/src/main/java/com/terning/feature/onboarding/filteringstart/navigation/FilteringStartNavigation.kt b/feature/src/main/java/com/terning/feature/onboarding/startfiltering/navigation/StartFilteringNavigation.kt similarity index 51% rename from feature/src/main/java/com/terning/feature/onboarding/filteringstart/navigation/FilteringStartNavigation.kt rename to feature/src/main/java/com/terning/feature/onboarding/startfiltering/navigation/StartFilteringNavigation.kt index 15cb69b4d..2bcf37a82 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/filteringstart/navigation/FilteringStartNavigation.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/startfiltering/navigation/StartFilteringNavigation.kt @@ -1,4 +1,4 @@ -package com.terning.feature.onboarding.filteringstart.navigation +package com.terning.feature.onboarding.startfiltering.navigation import androidx.navigation.NavController import androidx.navigation.NavGraphBuilder @@ -6,23 +6,23 @@ import androidx.navigation.NavHostController import androidx.navigation.NavOptions import androidx.navigation.compose.composable import com.terning.core.navigation.Route -import com.terning.feature.onboarding.filteringstart.FilteringStartScreen +import com.terning.feature.onboarding.startfiltering.StartFilteringScreen import kotlinx.serialization.Serializable -fun NavController.navigateFilteringStart(navOptions: NavOptions? = null) { +fun NavController.navigateStartFiltering(navOptions: NavOptions? = null) { navigate( - route = FilteringStart, + route = StartFiltering, navOptions = navOptions ) } -fun NavGraphBuilder.filteringStartNavGraph( +fun NavGraphBuilder.startFilteringNavGraph( navHostController: NavHostController ) { - composable { - FilteringStartScreen(navController = navHostController) + composable { + StartFilteringScreen(navController = navHostController) } } @Serializable -data object FilteringStart : Route \ No newline at end of file +data object StartFiltering : Route \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/onboarding/starthome/StartHomeScreen.kt b/feature/src/main/java/com/terning/feature/onboarding/starthome/StartHomeScreen.kt new file mode 100644 index 000000000..a95428266 --- /dev/null +++ b/feature/src/main/java/com/terning/feature/onboarding/starthome/StartHomeScreen.kt @@ -0,0 +1,12 @@ +package com.terning.feature.onboarding.starthome + +import androidx.compose.runtime.Composable +import androidx.navigation.NavController + +@Composable +fun StartHomeScreen( + navController: NavController + +) { + +} \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/onboarding/starthome/navigation/StartHomeNavigation.kt b/feature/src/main/java/com/terning/feature/onboarding/starthome/navigation/StartHomeNavigation.kt new file mode 100644 index 000000000..7cd5a3d3a --- /dev/null +++ b/feature/src/main/java/com/terning/feature/onboarding/starthome/navigation/StartHomeNavigation.kt @@ -0,0 +1,28 @@ +package com.terning.feature.onboarding.starthome.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.onboarding.starthome.StartHomeScreen +import kotlinx.serialization.Serializable + +fun NavController.navigateStartHome(navOptions: NavOptions? = null) { + navigate( + route = StartHome, + navOptions = navOptions + ) +} + +fun NavGraphBuilder.startHomeNavGraph( + navHostController: NavHostController +) { + composable { + StartHomeScreen(navController = navHostController) + } +} + +@Serializable +data object StartHome : Route \ No newline at end of file From c4adc815501a39b639370288fe9b40eb8419bba3 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Sat, 13 Jul 2024 04:33:00 +0900 Subject: [PATCH 19/26] =?UTF-8?q?[FEAT/#48]=20=EC=8A=A4=ED=81=AC=EB=A1=A4?= =?UTF-8?q?=20=EC=8B=9C=20=EB=B2=84=ED=8A=BC=20=ED=99=9C=EC=84=B1=ED=99=94?= =?UTF-8?q?=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/datepicker/DatePicker.kt | 23 +++++++++++++++---- .../filtering/FilteringThreeScreen.kt | 6 ++--- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/core/src/main/java/com/terning/core/designsystem/component/datepicker/DatePicker.kt b/core/src/main/java/com/terning/core/designsystem/component/datepicker/DatePicker.kt index 1ef834540..1fb60544a 100644 --- a/core/src/main/java/com/terning/core/designsystem/component/datepicker/DatePicker.kt +++ b/core/src/main/java/com/terning/core/designsystem/component/datepicker/DatePicker.kt @@ -21,6 +21,7 @@ import androidx.compose.runtime.derivedStateOf import androidx.compose.runtime.getValue 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.text.style.TextAlign @@ -44,6 +45,7 @@ fun DatePickerUI( chosenMonth: Int, onYearChosen: (Int) -> Unit = {}, onMonthChosen: (Int) -> Unit = {}, + onScrolledOccurred: (Boolean) -> Unit = {} ) { Column( @@ -57,6 +59,7 @@ fun DatePickerUI( chosenMonth = chosenMonth, onYearChosen = { onYearChosen(it.toInt()) }, onMonthChosen = { onMonthChosen(it.toInt()) }, + onScrolledOccurred = onScrolledOccurred ) } } @@ -67,6 +70,7 @@ fun DateSelectionSection( chosenMonth: Int, onYearChosen: (String) -> Unit, onMonthChosen: (String) -> Unit, + onScrolledOccurred: (Boolean) -> Unit ) { Row( horizontalArrangement = Arrangement.Center, @@ -75,13 +79,15 @@ fun DateSelectionSection( DateItemsPicker( items = years.toImmutableList(), firstIndex = (chosenYear - START_YEAR), - onItemSelected = onYearChosen + onItemSelected = onYearChosen, + onScrolledOccurred = onScrolledOccurred ) Spacer(modifier = Modifier.width(10.dp)) DateItemsPicker( items = monthsNumber.toImmutableList(), firstIndex = chosenMonth, - onItemSelected = onMonthChosen + onItemSelected = onMonthChosen, + onScrolledOccurred = onScrolledOccurred ) } } @@ -91,14 +97,21 @@ fun DateItemsPicker( items: List, firstIndex: Int, onItemSelected: (String) -> Unit, + onScrolledOccurred: (Boolean) -> Unit, modifier: Modifier = Modifier ) { val listState = rememberLazyListState(firstIndex) val currentValue = remember { mutableStateOf("") } + var isScrolled by remember { mutableStateOf(false) } - LaunchedEffect(!listState.isScrollInProgress) { - onItemSelected(currentValue.value) - listState.animateScrollToItem(index = listState.firstVisibleItemIndex) + LaunchedEffect(listState.isScrollInProgress) { + if (!listState.isScrollInProgress) { + onItemSelected(currentValue.value) + listState.animateScrollToItem(index = listState.firstVisibleItemIndex) + } else { + isScrolled = true + onScrolledOccurred(true) + } } Box( diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringThreeScreen.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringThreeScreen.kt index 6f78ce9b6..7d99334d0 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringThreeScreen.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringThreeScreen.kt @@ -23,7 +23,6 @@ import com.terning.core.designsystem.component.image.TerningImage import com.terning.core.designsystem.component.topappbar.BackButtonTopAppBar import com.terning.core.designsystem.theme.TerningTheme import com.terning.feature.R -import com.terning.feature.onboarding.filtering.navigation.navigateFilteringThree import com.terning.feature.onboarding.starthome.navigation.navigateStartHome import java.util.Calendar @@ -37,7 +36,7 @@ fun FilteringThreeScreen( var chosenYear by remember { mutableIntStateOf(Calendar.getInstance().get(Calendar.YEAR)) } var chosenMonth by remember { mutableIntStateOf(Calendar.getInstance().get(Calendar.MONTH)) } - val isDateMove by remember { mutableStateOf(false) } + var onScrolledOccurred by remember { mutableStateOf(false) } Scaffold( modifier = modifier, @@ -81,11 +80,12 @@ fun FilteringThreeScreen( chosenMonth = chosenMonth, onYearChosen = { chosenYear = it }, onMonthChosen = { chosenMonth = it }, + onScrolledOccurred = { onScrolledOccurred = true } ) Spacer(modifier = modifier.weight(1f)) RectangleButton( style = TerningTheme.typography.button0, - isEnabled = isDateMove, + isEnabled = onScrolledOccurred, paddingVertical = 25.dp, text = R.string.filtering_button, onButtonClick = { navController.navigateStartHome() }, From 439eb069ab832f6c2193a08560c1718399af637e Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Sat, 13 Jul 2024 07:05:41 +0900 Subject: [PATCH 20/26] =?UTF-8?q?[FEAT/#48]=20=EB=8D=B0=EC=9D=B4=ED=8A=B8?= =?UTF-8?q?=20=ED=94=BC=EC=BB=A4=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designsystem/component/datepicker/DatePicker.kt | 11 +++-------- .../onboarding/filtering/FilteringThreeScreen.kt | 13 +++++-------- .../startfiltering/StartFilteringScreen.kt | 2 +- 3 files changed, 9 insertions(+), 17 deletions(-) diff --git a/core/src/main/java/com/terning/core/designsystem/component/datepicker/DatePicker.kt b/core/src/main/java/com/terning/core/designsystem/component/datepicker/DatePicker.kt index 1fb60544a..602a171c6 100644 --- a/core/src/main/java/com/terning/core/designsystem/component/datepicker/DatePicker.kt +++ b/core/src/main/java/com/terning/core/designsystem/component/datepicker/DatePicker.kt @@ -104,14 +104,9 @@ fun DateItemsPicker( val currentValue = remember { mutableStateOf("") } var isScrolled by remember { mutableStateOf(false) } - LaunchedEffect(listState.isScrollInProgress) { - if (!listState.isScrollInProgress) { - onItemSelected(currentValue.value) - listState.animateScrollToItem(index = listState.firstVisibleItemIndex) - } else { - isScrolled = true - onScrolledOccurred(true) - } + LaunchedEffect(!listState.isScrollInProgress) { + onItemSelected(currentValue.value) + listState.animateScrollToItem(index = listState.firstVisibleItemIndex) } Box( diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringThreeScreen.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringThreeScreen.kt index 7d99334d0..cc3bef9c5 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringThreeScreen.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringThreeScreen.kt @@ -8,7 +8,6 @@ import androidx.compose.material3.Scaffold import androidx.compose.material3.Text import androidx.compose.runtime.Composable 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 @@ -31,12 +30,12 @@ fun FilteringThreeScreen( navController: NavController, modifier: Modifier = Modifier, filteringViewModel: FilteringViewModel = hiltViewModel(), - onButtonClick: () -> Unit = {}, ) { - var chosenYear by remember { mutableIntStateOf(Calendar.getInstance().get(Calendar.YEAR)) } - var chosenMonth by remember { mutableIntStateOf(Calendar.getInstance().get(Calendar.MONTH)) } + val currentYear = Calendar.getInstance().get(Calendar.YEAR) + val currentMonth = Calendar.getInstance().get(Calendar.MONTH) - var onScrolledOccurred by remember { mutableStateOf(false) } + var chosenYear by remember { mutableStateOf(currentYear) } + var chosenMonth by remember { mutableStateOf(currentMonth) } Scaffold( modifier = modifier, @@ -80,12 +79,10 @@ fun FilteringThreeScreen( chosenMonth = chosenMonth, onYearChosen = { chosenYear = it }, onMonthChosen = { chosenMonth = it }, - onScrolledOccurred = { onScrolledOccurred = true } ) Spacer(modifier = modifier.weight(1f)) RectangleButton( style = TerningTheme.typography.button0, - isEnabled = onScrolledOccurred, paddingVertical = 25.dp, text = R.string.filtering_button, onButtonClick = { navController.navigateStartHome() }, @@ -93,4 +90,4 @@ fun FilteringThreeScreen( ) } } -} \ No newline at end of file +} diff --git a/feature/src/main/java/com/terning/feature/onboarding/startfiltering/StartFilteringScreen.kt b/feature/src/main/java/com/terning/feature/onboarding/startfiltering/StartFilteringScreen.kt index 7b1e760b6..6fb5fe1db 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/startfiltering/StartFilteringScreen.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/startfiltering/StartFilteringScreen.kt @@ -36,7 +36,7 @@ fun StartFilteringScreen( var isVisible by remember { mutableStateOf(false) } LaunchedEffect(key1 = true) { - delay(1500) + delay(1000) isVisible = true } From 965cb71a1dabfec93afd962dc1608c24d6464cca Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Sat, 13 Jul 2024 07:33:39 +0900 Subject: [PATCH 21/26] [FEAT/#48] pull from develop --- .../component/datepicker/DatePicker.kt | 14 +++----------- .../java/com/terning/feature/intern/InternRoute.kt | 2 +- .../filtering/component/StatusThreeRadioGroup.kt | 4 ---- 3 files changed, 4 insertions(+), 16 deletions(-) delete mode 100644 feature/src/main/java/com/terning/feature/onboarding/filtering/component/StatusThreeRadioGroup.kt diff --git a/core/src/main/java/com/terning/core/designsystem/component/datepicker/DatePicker.kt b/core/src/main/java/com/terning/core/designsystem/component/datepicker/DatePicker.kt index 602a171c6..2a33c3fb6 100644 --- a/core/src/main/java/com/terning/core/designsystem/component/datepicker/DatePicker.kt +++ b/core/src/main/java/com/terning/core/designsystem/component/datepicker/DatePicker.kt @@ -21,7 +21,6 @@ import androidx.compose.runtime.derivedStateOf import androidx.compose.runtime.getValue 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.text.style.TextAlign @@ -45,7 +44,6 @@ fun DatePickerUI( chosenMonth: Int, onYearChosen: (Int) -> Unit = {}, onMonthChosen: (Int) -> Unit = {}, - onScrolledOccurred: (Boolean) -> Unit = {} ) { Column( @@ -59,7 +57,6 @@ fun DatePickerUI( chosenMonth = chosenMonth, onYearChosen = { onYearChosen(it.toInt()) }, onMonthChosen = { onMonthChosen(it.toInt()) }, - onScrolledOccurred = onScrolledOccurred ) } } @@ -70,7 +67,6 @@ fun DateSelectionSection( chosenMonth: Int, onYearChosen: (String) -> Unit, onMonthChosen: (String) -> Unit, - onScrolledOccurred: (Boolean) -> Unit ) { Row( horizontalArrangement = Arrangement.Center, @@ -80,14 +76,12 @@ fun DateSelectionSection( items = years.toImmutableList(), firstIndex = (chosenYear - START_YEAR), onItemSelected = onYearChosen, - onScrolledOccurred = onScrolledOccurred ) Spacer(modifier = Modifier.width(10.dp)) DateItemsPicker( items = monthsNumber.toImmutableList(), firstIndex = chosenMonth, onItemSelected = onMonthChosen, - onScrolledOccurred = onScrolledOccurred ) } } @@ -97,12 +91,10 @@ fun DateItemsPicker( items: List, firstIndex: Int, onItemSelected: (String) -> Unit, - onScrolledOccurred: (Boolean) -> Unit, modifier: Modifier = Modifier ) { val listState = rememberLazyListState(firstIndex) val currentValue = remember { mutableStateOf("") } - var isScrolled by remember { mutableStateOf(false) } LaunchedEffect(!listState.isScrollInProgress) { onItemSelected(currentValue.value) @@ -118,11 +110,11 @@ fun DateItemsPicker( verticalArrangement = Arrangement.SpaceEvenly ) { HorizontalDivider( - modifier = Modifier.size(height = 1.dp, width = 60.dp), + modifier = Modifier.size(height = 1.dp, width = 71.dp), color = TerningMain ) HorizontalDivider( - modifier = Modifier.size(height = 1.dp, width = 60.dp), + modifier = Modifier.size(height = 1.dp, width = 71.dp), color = TerningMain ) } @@ -139,7 +131,7 @@ fun DateItemsPicker( if (it == firstVisibleItemIndex + 1) { currentValue.value = items[index] } - Spacer(modifier = Modifier.height(6.dp)) + Spacer(modifier = Modifier.height(50.dp)) Text( text = items[index], style = TerningTheme.typography.title3, diff --git a/feature/src/main/java/com/terning/feature/intern/InternRoute.kt b/feature/src/main/java/com/terning/feature/intern/InternRoute.kt index 683a71389..5f8bcba53 100644 --- a/feature/src/main/java/com/terning/feature/intern/InternRoute.kt +++ b/feature/src/main/java/com/terning/feature/intern/InternRoute.kt @@ -61,7 +61,7 @@ fun InternScreen( offsetY = 2.dp ), onBackButtonClick = {}, - listOf( + actions = listOf( {}, { IconButton(onClick = {}) { diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/component/StatusThreeRadioGroup.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/component/StatusThreeRadioGroup.kt deleted file mode 100644 index 97c078a31..000000000 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/component/StatusThreeRadioGroup.kt +++ /dev/null @@ -1,4 +0,0 @@ -package com.terning.feature.onboarding.filtering.component - -class StatusThreeRadioGroup { -} \ No newline at end of file From 1b2e0d59bdb91e1422a88c96f2561660ac12a64a Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Sat, 13 Jul 2024 08:40:42 +0900 Subject: [PATCH 22/26] =?UTF-8?q?[FIX/#48]=20=EB=A7=88=EC=A7=80=EB=A7=89?= =?UTF-8?q?=20=EC=95=84=EC=9D=B4=ED=85=9C=20=EC=84=A0=ED=83=9D=20=EC=9D=B4?= =?UTF-8?q?=EC=8A=88=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designsystem/component/datepicker/DatePicker.kt | 10 +++++----- .../onboarding/filtering/FilteringThreeScreen.kt | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/com/terning/core/designsystem/component/datepicker/DatePicker.kt b/core/src/main/java/com/terning/core/designsystem/component/datepicker/DatePicker.kt index 2a33c3fb6..47b0b9783 100644 --- a/core/src/main/java/com/terning/core/designsystem/component/datepicker/DatePicker.kt +++ b/core/src/main/java/com/terning/core/designsystem/component/datepicker/DatePicker.kt @@ -34,9 +34,9 @@ import okhttp3.internal.toImmutableList private const val START_YEAR = 2023 private const val END_YEAR = 2025 private val years = - (listOf("") + (START_YEAR..END_YEAR).map { it.toString() } + listOf("")).toImmutableList() + (listOf("") + (START_YEAR..END_YEAR).map { it.toString() } + listOf("") + listOf("")).toImmutableList() private val monthsNumber = - (listOf("") + (1..12).map { it.toString() } + listOf("")).toImmutableList() + (listOf("") + (1..12).map { it.toString() } + listOf("") + listOf("")).toImmutableList() @Composable fun DatePickerUI( @@ -50,7 +50,7 @@ fun DatePickerUI( horizontalAlignment = Alignment.CenterHorizontally, modifier = Modifier .fillMaxWidth() - .padding(vertical = 10.dp, horizontal = 5.dp) + .padding(bottom = 62.dp) ) { DateSelectionSection( chosenYear = chosenYear, @@ -77,7 +77,7 @@ fun DateSelectionSection( firstIndex = (chosenYear - START_YEAR), onItemSelected = onYearChosen, ) - Spacer(modifier = Modifier.width(10.dp)) + Spacer(modifier = Modifier.width(25.dp)) DateItemsPicker( items = monthsNumber.toImmutableList(), firstIndex = chosenMonth, @@ -131,7 +131,7 @@ fun DateItemsPicker( if (it == firstVisibleItemIndex + 1) { currentValue.value = items[index] } - Spacer(modifier = Modifier.height(50.dp)) + Spacer(modifier = Modifier.height(6.dp)) Text( text = items[index], style = TerningTheme.typography.title3, diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringThreeScreen.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringThreeScreen.kt index cc3bef9c5..7d1680909 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringThreeScreen.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringThreeScreen.kt @@ -74,13 +74,14 @@ fun FilteringThreeScreen( bottom = 25.dp ) ) + Spacer(modifier = modifier.weight(1f)) DatePickerUI( chosenYear = chosenYear, chosenMonth = chosenMonth, onYearChosen = { chosenYear = it }, onMonthChosen = { chosenMonth = it }, ) - Spacer(modifier = modifier.weight(1f)) + Spacer(modifier = modifier.weight(3f)) RectangleButton( style = TerningTheme.typography.button0, paddingVertical = 25.dp, From 8fc721366addc36548b13e6e170f1ac69c0df289 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Sat, 13 Jul 2024 08:47:09 +0900 Subject: [PATCH 23/26] =?UTF-8?q?[FEAT/#48]=20StartHomeScreen=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../startfiltering/StartFilteringScreen.kt | 6 +- .../onboarding/starthome/StartHomeScreen.kt | 73 ++++++++++++++++++- feature/src/main/res/values/strings.xml | 12 ++- 3 files changed, 82 insertions(+), 9 deletions(-) diff --git a/feature/src/main/java/com/terning/feature/onboarding/startfiltering/StartFilteringScreen.kt b/feature/src/main/java/com/terning/feature/onboarding/startfiltering/StartFilteringScreen.kt index 6fb5fe1db..6c083aa5f 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/startfiltering/StartFilteringScreen.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/startfiltering/StartFilteringScreen.kt @@ -49,14 +49,14 @@ fun StartFilteringScreen( ) { Spacer(modifier = Modifier.weight(1f)) Text( - text = stringResource(id = R.string.start_title), + text = stringResource(id = R.string.start_filtering_title), style = TerningTheme.typography.title1, modifier = Modifier.padding(bottom = 35.dp), textAlign = TextAlign.Center ) Image( painter = painterResource(id = R.drawable.img_start), - contentDescription = stringResource(id = R.string.start_main_image), + contentDescription = stringResource(id = R.string.start_filtering_main_image), ) Spacer(modifier = Modifier.weight(2f)) } @@ -72,7 +72,7 @@ fun StartFilteringScreen( RectangleButton( style = TerningTheme.typography.button0, paddingVertical = 20.dp, - text = R.string.start_button, + text = R.string.start_filtering_button, onButtonClick = { navController.navigateFilteringOne() }, ) } diff --git a/feature/src/main/java/com/terning/feature/onboarding/starthome/StartHomeScreen.kt b/feature/src/main/java/com/terning/feature/onboarding/starthome/StartHomeScreen.kt index a95428266..86bd93a73 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/starthome/StartHomeScreen.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/starthome/StartHomeScreen.kt @@ -1,12 +1,81 @@ package com.terning.feature.onboarding.starthome +import androidx.compose.animation.AnimatedVisibility +import androidx.compose.animation.fadeIn +import androidx.compose.foundation.Image +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.padding +import androidx.compose.material3.Text import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.getValue +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.res.painterResource +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.unit.dp import androidx.navigation.NavController +import com.terning.core.designsystem.component.button.RectangleButton +import com.terning.core.designsystem.theme.TerningTheme +import com.terning.feature.R +import com.terning.feature.home.home.navigation.navigateHome +import kotlinx.coroutines.delay @Composable fun StartHomeScreen( + modifier: Modifier = Modifier, navController: NavController - ) { + var isVisible by remember { mutableStateOf(false) } + + LaunchedEffect(key1 = true) { + delay(1000) + isVisible = true + } -} \ No newline at end of file + Box( + modifier = modifier.fillMaxSize() + ) { + Column( + modifier = Modifier.fillMaxSize(), + horizontalAlignment = Alignment.CenterHorizontally + ) { + Spacer(modifier = Modifier.weight(1f)) + Text( + text = stringResource(id = R.string.start_home_title), + style = TerningTheme.typography.title1, + modifier = Modifier.padding(bottom = 35.dp), + textAlign = TextAlign.Center + ) + Image( + painter = painterResource(id = R.drawable.img_start), + contentDescription = stringResource(id = R.string.start_filtering_main_image), + ) + Spacer(modifier = Modifier.weight(2f)) + } + Box( + modifier = Modifier + .align(Alignment.BottomCenter) + .padding(bottom = 12.dp) + ) { + AnimatedVisibility( + visible = isVisible, + enter = fadeIn(initialAlpha = 0.3f), + ) { + RectangleButton( + style = TerningTheme.typography.button0, + paddingVertical = 20.dp, + text = R.string.start_home_next_button, + onButtonClick = { navController.navigateHome() }, + ) + } + } + } +} diff --git a/feature/src/main/res/values/strings.xml b/feature/src/main/res/values/strings.xml index 96333f3b6..6e1a8ce54 100644 --- a/feature/src/main/res/values/strings.xml +++ b/feature/src/main/res/values/strings.xml @@ -74,10 +74,14 @@ 필터링 설정에 일치하는 인턴 공고가 없어요!\n딱 맞는 인턴 공고가 올라오면 바로 알려드릴게요 인턴 공고가 없어요! - - 터치 3번으로\n원하는 대학생 인턴 공고를 띄워드릴게요 - 시작화면 이미지 - 시작하기 + + 터치 3번으로\n원하는 대학생 인턴 공고를 띄워드릴게요 + 시작화면 이미지 + 시작하기 + + + 이제 딱 맞는 공고와 함께\n터닝을 시작해 볼까요? + 내 맞춤 공고 바로 보러가기 %s님의 재학 상태를 선택해주세요 From a06c9680fbb5bfd024fdc16dc0aeadb6bc208db8 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Sat, 13 Jul 2024 09:32:39 +0900 Subject: [PATCH 24/26] =?UTF-8?q?[FEAT/#48]=20string=EC=97=90=20=EB=85=84,?= =?UTF-8?q?=20=EC=9B=94=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/datepicker/DatePicker.kt | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/com/terning/core/designsystem/component/datepicker/DatePicker.kt b/core/src/main/java/com/terning/core/designsystem/component/datepicker/DatePicker.kt index 47b0b9783..9fdbe6758 100644 --- a/core/src/main/java/com/terning/core/designsystem/component/datepicker/DatePicker.kt +++ b/core/src/main/java/com/terning/core/designsystem/component/datepicker/DatePicker.kt @@ -8,7 +8,6 @@ import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxHeight import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height -import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width import androidx.compose.foundation.lazy.LazyColumn @@ -48,9 +47,7 @@ fun DatePickerUI( Column( horizontalAlignment = Alignment.CenterHorizontally, - modifier = Modifier - .fillMaxWidth() - .padding(bottom = 62.dp) + modifier = Modifier.fillMaxWidth() ) { DateSelectionSection( chosenYear = chosenYear, @@ -76,12 +73,14 @@ fun DateSelectionSection( items = years.toImmutableList(), firstIndex = (chosenYear - START_YEAR), onItemSelected = onYearChosen, + isYear = true ) Spacer(modifier = Modifier.width(25.dp)) DateItemsPicker( items = monthsNumber.toImmutableList(), firstIndex = chosenMonth, onItemSelected = onMonthChosen, + isYear = false ) } } @@ -91,7 +90,8 @@ fun DateItemsPicker( items: List, firstIndex: Int, onItemSelected: (String) -> Unit, - modifier: Modifier = Modifier + modifier: Modifier = Modifier, + isYear: Boolean ) { val listState = rememberLazyListState(firstIndex) val currentValue = remember { mutableStateOf("") } @@ -133,7 +133,11 @@ fun DateItemsPicker( } Spacer(modifier = Modifier.height(6.dp)) Text( - text = items[index], + text = + when (isYear) { + true -> if (items[index].isNotEmpty()) "${items[index]}년" else "" + false -> if (items[index].isNotEmpty()) "${items[index]}월" else "" + }, style = TerningTheme.typography.title3, color = if (it == firstVisibleItemIndex + 1) Grey500 else Grey300, textAlign = TextAlign.Center From 3e8d879d5e192b0ed3b5a9565a039115c10f02cf Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Sat, 13 Jul 2024 20:34:52 +0900 Subject: [PATCH 25/26] =?UTF-8?q?[CHORE/#48]=20startDestination=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/terning/feature/main/MainNavigator.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 34adba522..b538c3e58 100644 --- a/feature/src/main/java/com/terning/feature/main/MainNavigator.kt +++ b/feature/src/main/java/com/terning/feature/main/MainNavigator.kt @@ -12,7 +12,7 @@ import androidx.navigation.navOptions import com.terning.feature.calendar.navigation.navigateCalendar import com.terning.feature.home.home.navigation.navigateHome import com.terning.feature.mypage.navigation.navigateMyPage -import com.terning.feature.onboarding.startfiltering.navigation.StartFiltering +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 = StartFiltering + val startDestination = SignIn val currentTab: MainTab? @Composable get() = MainTab.find { tab -> From d3b69e9775e43922f1843b65a93da6a8d4724e15 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Sat, 13 Jul 2024 20:39:16 +0900 Subject: [PATCH 26/26] =?UTF-8?q?[CHORE/#48]=20MONTH=20=EC=83=81=EC=88=98?= =?UTF-8?q?=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/designsystem/component/datepicker/DatePicker.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/com/terning/core/designsystem/component/datepicker/DatePicker.kt b/core/src/main/java/com/terning/core/designsystem/component/datepicker/DatePicker.kt index 9fdbe6758..3d572d9a8 100644 --- a/core/src/main/java/com/terning/core/designsystem/component/datepicker/DatePicker.kt +++ b/core/src/main/java/com/terning/core/designsystem/component/datepicker/DatePicker.kt @@ -32,10 +32,12 @@ import okhttp3.internal.toImmutableList private const val START_YEAR = 2023 private const val END_YEAR = 2025 +private const val START_MONTH = 1 +private const val END_MONTH = 12 private val years = (listOf("") + (START_YEAR..END_YEAR).map { it.toString() } + listOf("") + listOf("")).toImmutableList() private val monthsNumber = - (listOf("") + (1..12).map { it.toString() } + listOf("") + listOf("")).toImmutableList() + (listOf("") + (START_MONTH..END_MONTH).map { it.toString() } + listOf("") + listOf("")).toImmutableList() @Composable fun DatePickerUI(