From 8dd453cc84ecf533a6b0fdcf9fe14c153fc03093 Mon Sep 17 00:00:00 2001 From: arinming Date: Sun, 7 Jul 2024 03:19:37 +0900 Subject: [PATCH 01/16] =?UTF-8?q?[ADD/#11]=20TerningTextField=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 --- .../core/component/TerningTextField.kt | 27 +++++++++++++++++ .../com/terning/feature/search/SearchRoute.kt | 30 +++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 core/src/main/java/com/terning/core/component/TerningTextField.kt create mode 100644 feature/src/main/java/com/terning/feature/search/SearchRoute.kt diff --git a/core/src/main/java/com/terning/core/component/TerningTextField.kt b/core/src/main/java/com/terning/core/component/TerningTextField.kt new file mode 100644 index 000000000..c80cd304a --- /dev/null +++ b/core/src/main/java/com/terning/core/component/TerningTextField.kt @@ -0,0 +1,27 @@ +package com.terning.core.component + +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.text.BasicTextField +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import com.terning.core.designsystem.theme.TerningMain + +@Composable +fun TerningTextField( + value: String, + onValueChange: (String) -> Unit, + modifier: Modifier = Modifier, +) { + BasicTextField( + value = value, + onValueChange = onValueChange, + modifier = Modifier + .fillMaxWidth() + .background(TerningMain) + ) { + Column { + } + } +} \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/search/SearchRoute.kt b/feature/src/main/java/com/terning/feature/search/SearchRoute.kt new file mode 100644 index 000000000..fc8da5ff2 --- /dev/null +++ b/feature/src/main/java/com/terning/feature/search/SearchRoute.kt @@ -0,0 +1,30 @@ +package com.terning.feature.search + +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.tooling.preview.Preview +import com.terning.core.component.TerningTextField + +@Composable +fun SearchRoute() { + SearchScreen() +} + +@Composable +fun SearchScreen() { + Column(modifier = Modifier.fillMaxSize()) { + Text(text = "탐색 스크린") + TerningTextField(value = "") { + + } + } +} + +@Preview +@Composable +fun SearchScreenPreview() { + SearchScreen() +} \ No newline at end of file From 9819c4e9119d7ee07fbd0316693ca644d79eb788 Mon Sep 17 00:00:00 2001 From: arinming Date: Sun, 7 Jul 2024 03:19:37 +0900 Subject: [PATCH 02/16] =?UTF-8?q?[ADD/#11]=20TerningTextField=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 --- .../core/component/TerningTextField.kt | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 core/src/main/java/com/terning/core/component/TerningTextField.kt diff --git a/core/src/main/java/com/terning/core/component/TerningTextField.kt b/core/src/main/java/com/terning/core/component/TerningTextField.kt new file mode 100644 index 000000000..c80cd304a --- /dev/null +++ b/core/src/main/java/com/terning/core/component/TerningTextField.kt @@ -0,0 +1,27 @@ +package com.terning.core.component + +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.text.BasicTextField +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import com.terning.core.designsystem.theme.TerningMain + +@Composable +fun TerningTextField( + value: String, + onValueChange: (String) -> Unit, + modifier: Modifier = Modifier, +) { + BasicTextField( + value = value, + onValueChange = onValueChange, + modifier = Modifier + .fillMaxWidth() + .background(TerningMain) + ) { + Column { + } + } +} \ No newline at end of file From e7cf63f9aa28e827947336cf99d71c8414d465d4 Mon Sep 17 00:00:00 2001 From: arinming Date: Tue, 9 Jul 2024 23:30:30 +0900 Subject: [PATCH 03/16] =?UTF-8?q?[FIX/#23]=20=EA=B2=BD=EB=A1=9C=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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/feature/src/main/java/com/terning/feature/main/MainNavigator.kt b/feature/src/main/java/com/terning/feature/main/MainNavigator.kt index e67b04927..68d33fb38 100644 --- a/feature/src/main/java/com/terning/feature/main/MainNavigator.kt +++ b/feature/src/main/java/com/terning/feature/main/MainNavigator.kt @@ -12,6 +12,7 @@ import androidx.navigation.navOptions 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.search.navigation.Search import com.terning.feature.search.navigation.navigateSearch @@ -22,7 +23,7 @@ class MainNavigator( @Composable get() = navController .currentBackStackEntryAsState().value?.destination - val startDestination = Search + val startDestination = SignIn val currentTab: MainTab? @Composable get() = MainTab.find { tab -> From 42819eceb27074aaf82a43661c8c0a50daf9fbdd Mon Sep 17 00:00:00 2001 From: arinming Date: Sun, 7 Jul 2024 03:19:37 +0900 Subject: [PATCH 04/16] =?UTF-8?q?[ADD/#11]=20TerningTextField=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 --- .../core/component/TerningTextField.kt | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 core/src/main/java/com/terning/core/component/TerningTextField.kt diff --git a/core/src/main/java/com/terning/core/component/TerningTextField.kt b/core/src/main/java/com/terning/core/component/TerningTextField.kt new file mode 100644 index 000000000..c80cd304a --- /dev/null +++ b/core/src/main/java/com/terning/core/component/TerningTextField.kt @@ -0,0 +1,27 @@ +package com.terning.core.component + +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.text.BasicTextField +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import com.terning.core.designsystem.theme.TerningMain + +@Composable +fun TerningTextField( + value: String, + onValueChange: (String) -> Unit, + modifier: Modifier = Modifier, +) { + BasicTextField( + value = value, + onValueChange = onValueChange, + modifier = Modifier + .fillMaxWidth() + .background(TerningMain) + ) { + Column { + } + } +} \ No newline at end of file From 9d393a43173e33b6547b31b490fad0a0a67c2e1f Mon Sep 17 00:00:00 2001 From: arinming Date: Sun, 7 Jul 2024 03:19:37 +0900 Subject: [PATCH 05/16] =?UTF-8?q?[ADD/#11]=20TerningTextField=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 --- .../core/component/TerningTextField.kt | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 core/src/main/java/com/terning/core/component/TerningTextField.kt diff --git a/core/src/main/java/com/terning/core/component/TerningTextField.kt b/core/src/main/java/com/terning/core/component/TerningTextField.kt new file mode 100644 index 000000000..c80cd304a --- /dev/null +++ b/core/src/main/java/com/terning/core/component/TerningTextField.kt @@ -0,0 +1,27 @@ +package com.terning.core.component + +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.text.BasicTextField +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import com.terning.core.designsystem.theme.TerningMain + +@Composable +fun TerningTextField( + value: String, + onValueChange: (String) -> Unit, + modifier: Modifier = Modifier, +) { + BasicTextField( + value = value, + onValueChange = onValueChange, + modifier = Modifier + .fillMaxWidth() + .background(TerningMain) + ) { + Column { + } + } +} \ No newline at end of file From eed08f5f0c6380b32066aaa09f02f7cc16ee8550 Mon Sep 17 00:00:00 2001 From: arinming Date: Wed, 10 Jul 2024 02:56:33 +0900 Subject: [PATCH 06/16] =?UTF-8?q?[FEAT/#11]=20ImageSlider=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/search/SearchRoute.kt | 57 +++++------------- .../feature/search/component/DotsIndicator.kt | 27 +++++++++ .../feature/search/component/ImageSlider.kt | 58 +++++++++++++++++++ .../feature/search/component/IndicatorDots.kt | 23 ++++++++ 5 files changed, 124 insertions(+), 44 deletions(-) create mode 100644 feature/src/main/java/com/terning/feature/search/component/DotsIndicator.kt create mode 100644 feature/src/main/java/com/terning/feature/search/component/ImageSlider.kt create mode 100644 feature/src/main/java/com/terning/feature/search/component/IndicatorDots.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 beb7b7920..c82fa571f 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.search.navigation.Search import com.terning.feature.search.navigation.navigateSearch class MainNavigator( @@ -22,7 +23,7 @@ class MainNavigator( @Composable get() = navController .currentBackStackEntryAsState().value?.destination - val startDestination = SignIn + val startDestination = Search val currentTab: MainTab? @Composable get() = MainTab.find { tab -> diff --git a/feature/src/main/java/com/terning/feature/search/SearchRoute.kt b/feature/src/main/java/com/terning/feature/search/SearchRoute.kt index 90701416c..fc41b5340 100644 --- a/feature/src/main/java/com/terning/feature/search/SearchRoute.kt +++ b/feature/src/main/java/com/terning/feature/search/SearchRoute.kt @@ -1,22 +1,24 @@ package com.terning.feature.search +import androidx.compose.foundation.Image import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.shape.CircleShape import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp -import com.terning.core.designsystem.component.textfield.NameTextField import com.terning.core.designsystem.component.textfield.SearchTextField -import com.terning.core.designsystem.theme.Grey400 -import com.terning.core.designsystem.theme.TerningMain -import com.terning.core.designsystem.theme.WarningRed import com.terning.feature.R +import com.terning.feature.search.component.ImageSlider @Composable fun SearchRoute() { @@ -26,34 +28,11 @@ fun SearchRoute() { @Composable fun SearchScreen() { var text by remember { mutableStateOf("") } - - // TODO 프로필 스크린 TextField로, 삭제될 코드입니다 - var helperMessage by remember { mutableStateOf(R.string.profile_text_field_helper) } - var helperIcon by remember { mutableStateOf(null) } - var helperColor by remember { mutableStateOf(Grey400) } - val specialCharacterPattern = Regex("[!@#\$%^&*(),.?\":{}|<>\\[\\]\\\\/]") - - // TODO 프로필 스크린 TextField로, 삭제될 코드입니다 - fun updateHelper(text: String) { - helperMessage = when { - text.isEmpty() -> R.string.profile_text_field_helper - specialCharacterPattern.containsMatchIn(text) -> R.string.profile_text_field_warning - text.length <= 12 -> R.string.profile_text_field_check - else -> R.string.profile_text_field_helper - } - helperIcon = when { - text.isEmpty() -> null - specialCharacterPattern.containsMatchIn(text) -> R.drawable.ic_warning - text.length <= 12 -> R.drawable.ic_check - else -> null - } - helperColor = when { - text.isEmpty() -> Grey400 - specialCharacterPattern.containsMatchIn(text) -> WarningRed - text.length <= 12 -> TerningMain - else -> Grey400 - } - } + val images = listOf( + R.drawable.ic_nav_search, + R.drawable.ic_check, + R.drawable.ic_nav_my_page, + ) Column( modifier = Modifier @@ -70,17 +49,9 @@ fun SearchScreen() { leftIcon = R.drawable.ic_nav_search ) - // TODO 프로필 스크린 TextField로, 삭제될 코드입니다 - NameTextField( - text = text, - onValueChange = { newText -> - text = newText - updateHelper(newText) - }, - hint = stringResource(R.string.profile_text_field_hint), - helperMessage = stringResource(helperMessage), - helperIcon = helperIcon, - helperColor = helperColor + ImageSlider( + modifier = Modifier, + images = images ) } } diff --git a/feature/src/main/java/com/terning/feature/search/component/DotsIndicator.kt b/feature/src/main/java/com/terning/feature/search/component/DotsIndicator.kt new file mode 100644 index 000000000..f9c5f3900 --- /dev/null +++ b/feature/src/main/java/com/terning/feature/search/component/DotsIndicator.kt @@ -0,0 +1,27 @@ +package com.terning.feature.search.component + +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Row +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier + +@Composable +fun DotsIndicator( + modifier: Modifier = Modifier, + pageCount: Int, + currentPage: Int, +) { + Row( + horizontalArrangement = Arrangement.SpaceBetween, + verticalAlignment = Alignment.CenterVertically, + modifier = modifier + ) { + repeat(pageCount) { index -> + IndicatorDots( + isSelected = index == currentPage, + modifier = modifier + ) + } + } +} \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/search/component/ImageSlider.kt b/feature/src/main/java/com/terning/feature/search/component/ImageSlider.kt new file mode 100644 index 000000000..ca78861ff --- /dev/null +++ b/feature/src/main/java/com/terning/feature/search/component/ImageSlider.kt @@ -0,0 +1,58 @@ +package com.terning.feature.search.component + +import androidx.compose.foundation.ExperimentalFoundationApi +import androidx.compose.foundation.Image +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.wrapContentSize +import androidx.compose.foundation.pager.HorizontalPager +import androidx.compose.foundation.pager.rememberPagerState +import androidx.compose.material3.Card +import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.unit.dp +import kotlinx.coroutines.delay + +@OptIn(ExperimentalFoundationApi::class) +@Composable +fun ImageSlider( + modifier: Modifier = Modifier, images: List, +) { + val pagerState = rememberPagerState(pageCount = { images.size }) + + LaunchedEffect(Unit) { + while (true) { + delay(3000) + val nextPage = (pagerState.currentPage + 1) % pagerState.pageCount + pagerState.scrollToPage(nextPage) + } + } + Column( + modifier.fillMaxWidth(), + horizontalAlignment = Alignment.CenterHorizontally + ) { + Box(modifier = modifier.wrapContentSize()) { + HorizontalPager( + state = pagerState, + modifier = modifier + ) { currentPage -> + Card( + modifier + .wrapContentSize() + .padding(10.dp) + ) { + Image( + painter = painterResource(id = images[currentPage]), + contentDescription = null + ) + } + } + } + DotsIndicator(pageCount = images.size, currentPage = pagerState.currentPage) + } +} \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/search/component/IndicatorDots.kt b/feature/src/main/java/com/terning/feature/search/component/IndicatorDots.kt new file mode 100644 index 000000000..98ff586e5 --- /dev/null +++ b/feature/src/main/java/com/terning/feature/search/component/IndicatorDots.kt @@ -0,0 +1,23 @@ +package com.terning.feature.search.component + +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.shape.CircleShape +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.unit.dp + +@Composable +fun IndicatorDots( + isSelected: Boolean, modifier: Modifier, +) { + Box( + modifier = modifier + .padding(2.dp) + .clip(CircleShape) + .background(if (isSelected) Color(0xff373737) else Color(0xA8373737)) + ) +} \ No newline at end of file From 6846986ec9ee1015493db73efacacd8dbe925d5c Mon Sep 17 00:00:00 2001 From: arinming Date: Wed, 10 Jul 2024 04:26:00 +0900 Subject: [PATCH 07/16] =?UTF-8?q?[FEAT/#11]=20=EA=B4=91=EA=B3=A0=20?= =?UTF-8?q?=EC=BB=B4=ED=8F=AC=EB=84=8C=ED=8A=B8=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/terning/feature/search/SearchRoute.kt | 21 ++++++------ .../feature/search/component/DotsIndicator.kt | 4 ++- .../feature/search/component/ImageSlider.kt | 32 +++++++++++++------ .../feature/search/component/IndicatorDots.kt | 7 ++-- 4 files changed, 42 insertions(+), 22 deletions(-) diff --git a/feature/src/main/java/com/terning/feature/search/SearchRoute.kt b/feature/src/main/java/com/terning/feature/search/SearchRoute.kt index fc41b5340..d4934e5da 100644 --- a/feature/src/main/java/com/terning/feature/search/SearchRoute.kt +++ b/feature/src/main/java/com/terning/feature/search/SearchRoute.kt @@ -1,6 +1,7 @@ package com.terning.feature.search import androidx.compose.foundation.Image +import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding @@ -37,17 +38,17 @@ fun SearchScreen() { Column( modifier = Modifier .fillMaxWidth() - .padding(horizontal = 16.dp) ) { - - SearchTextField( - text = text, - onValueChange = { newText -> - text = newText - }, - hint = stringResource(R.string.search_text_field_hint), - leftIcon = R.drawable.ic_nav_search - ) + Box(modifier = Modifier.padding(16.dp)) { + SearchTextField( + text = text, + onValueChange = { newText -> + text = newText + }, + hint = stringResource(R.string.search_text_field_hint), + leftIcon = R.drawable.ic_nav_search + ) + } ImageSlider( modifier = Modifier, diff --git a/feature/src/main/java/com/terning/feature/search/component/DotsIndicator.kt b/feature/src/main/java/com/terning/feature/search/component/DotsIndicator.kt index f9c5f3900..908eb460e 100644 --- a/feature/src/main/java/com/terning/feature/search/component/DotsIndicator.kt +++ b/feature/src/main/java/com/terning/feature/search/component/DotsIndicator.kt @@ -2,9 +2,11 @@ package com.terning.feature.search.component import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.padding import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.unit.dp @Composable fun DotsIndicator( @@ -15,7 +17,7 @@ fun DotsIndicator( Row( horizontalArrangement = Arrangement.SpaceBetween, verticalAlignment = Alignment.CenterVertically, - modifier = modifier + modifier = Modifier.padding(8.dp) ) { repeat(pageCount) { index -> IndicatorDots( diff --git a/feature/src/main/java/com/terning/feature/search/component/ImageSlider.kt b/feature/src/main/java/com/terning/feature/search/component/ImageSlider.kt index ca78861ff..ddfb8c0bf 100644 --- a/feature/src/main/java/com/terning/feature/search/component/ImageSlider.kt +++ b/feature/src/main/java/com/terning/feature/search/component/ImageSlider.kt @@ -1,10 +1,11 @@ package com.terning.feature.search.component -import androidx.compose.foundation.ExperimentalFoundationApi import androidx.compose.foundation.Image +import androidx.compose.foundation.background import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.wrapContentSize import androidx.compose.foundation.pager.HorizontalPager @@ -16,12 +17,13 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.res.painterResource import androidx.compose.ui.unit.dp +import com.terning.core.designsystem.theme.Grey200 import kotlinx.coroutines.delay -@OptIn(ExperimentalFoundationApi::class) @Composable fun ImageSlider( - modifier: Modifier = Modifier, images: List, + modifier: Modifier = Modifier, + images: List, ) { val pagerState = rememberPagerState(pageCount = { images.size }) @@ -33,26 +35,38 @@ fun ImageSlider( } } Column( - modifier.fillMaxWidth(), + modifier + .fillMaxWidth() + .background(Grey200), horizontalAlignment = Alignment.CenterHorizontally ) { - Box(modifier = modifier.wrapContentSize()) { + Box( + modifier = modifier + .wrapContentSize(), + contentAlignment = Alignment.BottomCenter + ) { HorizontalPager( state = pagerState, - modifier = modifier + modifier = modifier.wrapContentSize() ) { currentPage -> Card( modifier .wrapContentSize() - .padding(10.dp) ) { Image( painter = painterResource(id = images[currentPage]), - contentDescription = null + contentDescription = null, + modifier = modifier + .fillMaxWidth() + .height(112.dp) + .padding(16.dp) ) } } + DotsIndicator( + pageCount = images.size, + currentPage = pagerState.currentPage + ) } - DotsIndicator(pageCount = images.size, currentPage = pagerState.currentPage) } } \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/search/component/IndicatorDots.kt b/feature/src/main/java/com/terning/feature/search/component/IndicatorDots.kt index 98ff586e5..dc91d16e5 100644 --- a/feature/src/main/java/com/terning/feature/search/component/IndicatorDots.kt +++ b/feature/src/main/java/com/terning/feature/search/component/IndicatorDots.kt @@ -3,12 +3,14 @@ package com.terning.feature.search.component import androidx.compose.foundation.background import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size import androidx.compose.foundation.shape.CircleShape import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip -import androidx.compose.ui.graphics.Color import androidx.compose.ui.unit.dp +import com.terning.core.designsystem.theme.TerningMain +import com.terning.core.designsystem.theme.White @Composable fun IndicatorDots( @@ -18,6 +20,7 @@ fun IndicatorDots( modifier = modifier .padding(2.dp) .clip(CircleShape) - .background(if (isSelected) Color(0xff373737) else Color(0xA8373737)) + .size(6.dp) + .background(if (isSelected) TerningMain else White) ) } \ No newline at end of file From 8f2970c9f90c612a1209af5400d8bd0c52393749 Mon Sep 17 00:00:00 2001 From: arinming Date: Wed, 10 Jul 2024 04:37:41 +0900 Subject: [PATCH 08/16] =?UTF-8?q?[FEAT/#11]=20=EC=9A=94=EC=A6=98=20?= =?UTF-8?q?=EB=8C=80=ED=95=99=EC=83=9D=EB=93=A4=EC=97=90=EA=B2=8C=20?= =?UTF-8?q?=EC=9D=B8=EA=B8=B0=20=EC=9E=88=EB=8A=94=20=EA=B3=B5=EA=B3=A0=20?= =?UTF-8?q?=ED=85=8D=EC=8A=A4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/textfield/SearchTextField.kt | 2 ++ .../com/terning/feature/main/MainNavigator.kt | 1 - .../com/terning/feature/search/SearchRoute.kt | 20 +++++++++++++------ feature/src/main/res/values/strings.xml | 2 +- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/core/src/main/java/com/terning/core/designsystem/component/textfield/SearchTextField.kt b/core/src/main/java/com/terning/core/designsystem/component/textfield/SearchTextField.kt index bc065431e..203e92b74 100644 --- a/core/src/main/java/com/terning/core/designsystem/component/textfield/SearchTextField.kt +++ b/core/src/main/java/com/terning/core/designsystem/component/textfield/SearchTextField.kt @@ -10,12 +10,14 @@ import com.terning.core.designsystem.theme.TerningTheme fun SearchTextField( text: String, onValueChange: (String) -> Unit, + readOnly: Boolean = false, hint: String, leftIcon: Int, ) { TerningBasicTextField( value = text, onValueChange = onValueChange, + readOnly = readOnly, textStyle = TerningTheme.typography.button3, textColor = Grey400, cursorBrush = SolidColor(Grey300), 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 c82fa571f..e67b04927 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,6 @@ import androidx.navigation.navOptions 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.search.navigation.Search import com.terning.feature.search.navigation.navigateSearch diff --git a/feature/src/main/java/com/terning/feature/search/SearchRoute.kt b/feature/src/main/java/com/terning/feature/search/SearchRoute.kt index d4934e5da..a866d8018 100644 --- a/feature/src/main/java/com/terning/feature/search/SearchRoute.kt +++ b/feature/src/main/java/com/terning/feature/search/SearchRoute.kt @@ -1,23 +1,21 @@ package com.terning.feature.search -import androidx.compose.foundation.Image import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.layout.size -import androidx.compose.foundation.shape.CircleShape +import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier -import androidx.compose.ui.draw.clip -import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import com.terning.core.designsystem.component.textfield.SearchTextField +import com.terning.core.designsystem.theme.Black +import com.terning.core.designsystem.theme.TerningTheme import com.terning.feature.R import com.terning.feature.search.component.ImageSlider @@ -45,8 +43,9 @@ fun SearchScreen() { onValueChange = { newText -> text = newText }, + readOnly = true, hint = stringResource(R.string.search_text_field_hint), - leftIcon = R.drawable.ic_nav_search + leftIcon = R.drawable.ic_nav_search, ) } @@ -54,5 +53,14 @@ fun SearchScreen() { modifier = Modifier, images = images ) + Column { + Text( + text = stringResource(id = R.string.search_today_popular), + modifier = Modifier.padding(16.dp), + style = TerningTheme.typography.title1, + color = Black, + ) + } + } } diff --git a/feature/src/main/res/values/strings.xml b/feature/src/main/res/values/strings.xml index 2247cdd3a..247539e52 100644 --- a/feature/src/main/res/values/strings.xml +++ b/feature/src/main/res/values/strings.xml @@ -23,7 +23,7 @@ 관심있는 인턴 공고 키워드를 검색해보세요 - + 요즘 대학생들에게 인기 있는 공고 From 314d59285f5b8e99e5cb3c8d2f00e5b8fc13e03b Mon Sep 17 00:00:00 2001 From: arinming Date: Wed, 10 Jul 2024 04:47:30 +0900 Subject: [PATCH 09/16] =?UTF-8?q?[FEAT/#11]=20=EA=B3=B5=EA=B3=A0=20?= =?UTF-8?q?=EB=A6=AC=EC=8A=A4=ED=8A=B8=20=ED=85=8D=EC=8A=A4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/terning/feature/search/SearchRoute.kt | 21 +++++++++++++++---- feature/src/main/res/values/strings.xml | 2 ++ 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/feature/src/main/java/com/terning/feature/search/SearchRoute.kt b/feature/src/main/java/com/terning/feature/search/SearchRoute.kt index a866d8018..5628d6d27 100644 --- a/feature/src/main/java/com/terning/feature/search/SearchRoute.kt +++ b/feature/src/main/java/com/terning/feature/search/SearchRoute.kt @@ -2,6 +2,7 @@ package com.terning.feature.search import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.material3.Text @@ -15,6 +16,7 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import com.terning.core.designsystem.component.textfield.SearchTextField import com.terning.core.designsystem.theme.Black +import com.terning.core.designsystem.theme.Grey400 import com.terning.core.designsystem.theme.TerningTheme import com.terning.feature.R import com.terning.feature.search.component.ImageSlider @@ -50,15 +52,26 @@ fun SearchScreen() { } ImageSlider( - modifier = Modifier, images = images ) - Column { + + Spacer(modifier = Modifier.padding(8.dp)) + + + Column( + modifier = Modifier.padding(horizontal = 16.dp), + ) { Text( text = stringResource(id = R.string.search_today_popular), - modifier = Modifier.padding(16.dp), + modifier = Modifier.padding(vertical = 4.dp), style = TerningTheme.typography.title1, - color = Black, + color = Black + ) + + Text( + text = stringResource(id = R.string.search_most_view_intern), + style = TerningTheme.typography.title5, + color = Grey400 ) } diff --git a/feature/src/main/res/values/strings.xml b/feature/src/main/res/values/strings.xml index 247539e52..39feacd21 100644 --- a/feature/src/main/res/values/strings.xml +++ b/feature/src/main/res/values/strings.xml @@ -24,6 +24,8 @@ 관심있는 인턴 공고 키워드를 검색해보세요 요즘 대학생들에게 인기 있는 공고 + 지금 조회수가 많은 공고들이에요 + 지금 스크랩 수가 많은 공고들이에요 From 7641fd4ddfdb438567390f0743c65523dfc3fbe2 Mon Sep 17 00:00:00 2001 From: arinming Date: Wed, 10 Jul 2024 05:25:26 +0900 Subject: [PATCH 10/16] =?UTF-8?q?[FEAT/#11]=20=EA=B3=B5=EA=B3=A0=20?= =?UTF-8?q?=EB=A6=AC=EC=8A=A4=ED=8A=B8=20=EC=BB=B4=ED=8F=AC=EB=84=8C?= =?UTF-8?q?=ED=8A=B8=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/terning/feature/search/SearchRoute.kt | 36 +++++------ .../feature/search/component/SearchIntern.kt | 63 +++++++++++++++++++ .../search/component/SearchInternList.kt | 39 ++++++++++++ 3 files changed, 119 insertions(+), 19 deletions(-) create mode 100644 feature/src/main/java/com/terning/feature/search/component/SearchIntern.kt create mode 100644 feature/src/main/java/com/terning/feature/search/component/SearchInternList.kt diff --git a/feature/src/main/java/com/terning/feature/search/SearchRoute.kt b/feature/src/main/java/com/terning/feature/search/SearchRoute.kt index 5628d6d27..35a2d51c3 100644 --- a/feature/src/main/java/com/terning/feature/search/SearchRoute.kt +++ b/feature/src/main/java/com/terning/feature/search/SearchRoute.kt @@ -5,6 +5,7 @@ import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding +import androidx.compose.material3.HorizontalDivider import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue @@ -16,10 +17,11 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import com.terning.core.designsystem.component.textfield.SearchTextField import com.terning.core.designsystem.theme.Black -import com.terning.core.designsystem.theme.Grey400 +import com.terning.core.designsystem.theme.Grey100 import com.terning.core.designsystem.theme.TerningTheme import com.terning.feature.R import com.terning.feature.search.component.ImageSlider +import com.terning.feature.search.component.SearchInternList @Composable fun SearchRoute() { @@ -57,23 +59,19 @@ fun SearchScreen() { Spacer(modifier = Modifier.padding(8.dp)) + Text( + text = stringResource(id = R.string.search_today_popular), + modifier = Modifier.padding(horizontal = 16.dp, vertical = 4.dp), + style = TerningTheme.typography.title1, + color = Black + ) - Column( - modifier = Modifier.padding(horizontal = 16.dp), - ) { - Text( - text = stringResource(id = R.string.search_today_popular), - modifier = Modifier.padding(vertical = 4.dp), - style = TerningTheme.typography.title1, - color = Black - ) - - Text( - text = stringResource(id = R.string.search_most_view_intern), - style = TerningTheme.typography.title5, - color = Grey400 - ) - } - + SearchInternList(type = "view") + HorizontalDivider( + thickness = 4.dp, + modifier = Modifier.padding(vertical = 8.dp), + color = Grey100, + ) + SearchInternList(type = "scrap") } -} +} \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/search/component/SearchIntern.kt b/feature/src/main/java/com/terning/feature/search/component/SearchIntern.kt new file mode 100644 index 000000000..89ba2c0db --- /dev/null +++ b/feature/src/main/java/com/terning/feature/search/component/SearchIntern.kt @@ -0,0 +1,63 @@ +package com.terning.feature.search.component + +import androidx.compose.foundation.Image +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.shadow +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.text.style.TextOverflow +import androidx.compose.ui.unit.dp +import com.terning.core.designsystem.theme.Black +import com.terning.core.designsystem.theme.Grey400 +import com.terning.core.designsystem.theme.TerningTheme +import com.terning.core.designsystem.theme.White +import com.terning.feature.R + +@Composable +fun SearchIntern() { + Column( + verticalArrangement = Arrangement.spacedBy( + 10.dp, + Alignment.Top + ), + horizontalAlignment = Alignment.CenterHorizontally, + modifier = Modifier + .shadow( + elevation = 4.dp, + // TODO 효빈 그림자 PR 풀 받아서 바꾸기 + spotColor = Color(0x26DDDDDD), + ambientColor = Color(0x26DDDDDD) + ) + .background( + color = White, + shape = RoundedCornerShape(size = 5.dp) + ) + .padding(vertical = 8.dp) + ) { + Image( + painter = painterResource(id = R.drawable.ic_nav_search), + contentDescription = null, + modifier = Modifier + .fillMaxWidth() + .padding(16.dp) + .background(Grey400) + ) + Text( + text = "[유한킴벌리]\n그린캠프 w. 대학생 숲 \n활동가 모집", + modifier = Modifier.padding(horizontal = 8.dp), + style = TerningTheme.typography.body6, + color = Black, + overflow = TextOverflow.Ellipsis, + maxLines = 3 + ) + } +} \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/search/component/SearchInternList.kt b/feature/src/main/java/com/terning/feature/search/component/SearchInternList.kt new file mode 100644 index 000000000..357b7a63a --- /dev/null +++ b/feature/src/main/java/com/terning/feature/search/component/SearchInternList.kt @@ -0,0 +1,39 @@ +package com.terning.feature.search.component + +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.lazy.LazyRow +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 com.terning.core.designsystem.theme.Grey400 +import com.terning.core.designsystem.theme.TerningTheme +import com.terning.feature.R + +@Composable +fun SearchInternList( + type: String, +) { + Column(modifier = Modifier.padding(horizontal = 16.dp)) { + Text( + text = stringResource( + id = if (type == "view") R.string.search_most_view_intern + else R.string.search_most_scrap_intern + ), + style = TerningTheme.typography.title5, + color = Grey400 + ) + + LazyRow( + modifier = Modifier.padding(vertical = 8.dp), + horizontalArrangement = Arrangement.spacedBy(12.dp), + ) { + items(5) { + SearchIntern() + } + } + } +} \ No newline at end of file From 628c9a6124aa3972e1f08a480b9907ad6fb0814c Mon Sep 17 00:00:00 2001 From: arinming Date: Wed, 10 Jul 2024 05:29:25 +0900 Subject: [PATCH 11/16] =?UTF-8?q?[FIX/#11]=20=ED=83=90=EC=83=89=20?= =?UTF-8?q?=ED=85=8D=EC=8A=A4=ED=8A=B8=20=ED=95=84=EB=93=9C=20=EC=83=89?= =?UTF-8?q?=EC=83=81=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/designsystem/component/textfield/SearchTextField.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/terning/core/designsystem/component/textfield/SearchTextField.kt b/core/src/main/java/com/terning/core/designsystem/component/textfield/SearchTextField.kt index 203e92b74..db4f28f59 100644 --- a/core/src/main/java/com/terning/core/designsystem/component/textfield/SearchTextField.kt +++ b/core/src/main/java/com/terning/core/designsystem/component/textfield/SearchTextField.kt @@ -4,6 +4,7 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.graphics.SolidColor import com.terning.core.designsystem.theme.Grey300 import com.terning.core.designsystem.theme.Grey400 +import com.terning.core.designsystem.theme.TerningMain import com.terning.core.designsystem.theme.TerningTheme @Composable @@ -21,11 +22,11 @@ fun SearchTextField( textStyle = TerningTheme.typography.button3, textColor = Grey400, cursorBrush = SolidColor(Grey300), - drawLineColor = Grey300, + drawLineColor = TerningMain, strokeWidth = 2f, hint = hint, hintColor = Grey300, leftIcon = leftIcon, - leftIconColor = Grey400, + leftIconColor = TerningMain, ) } \ No newline at end of file From 4d5a56972cfaf38687bc622ecb95c8c7829af6be Mon Sep 17 00:00:00 2001 From: arinming Date: Wed, 10 Jul 2024 05:42:33 +0900 Subject: [PATCH 12/16] =?UTF-8?q?[DELETE/#11]=20=EC=95=88=EC=93=B0?= =?UTF-8?q?=EB=8A=94=20=EC=BD=94=EB=93=9C=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/component/TerningTextField.kt | 27 ------------------- 1 file changed, 27 deletions(-) delete mode 100644 core/src/main/java/com/terning/core/component/TerningTextField.kt diff --git a/core/src/main/java/com/terning/core/component/TerningTextField.kt b/core/src/main/java/com/terning/core/component/TerningTextField.kt deleted file mode 100644 index c80cd304a..000000000 --- a/core/src/main/java/com/terning/core/component/TerningTextField.kt +++ /dev/null @@ -1,27 +0,0 @@ -package com.terning.core.component - -import androidx.compose.foundation.background -import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.foundation.text.BasicTextField -import androidx.compose.runtime.Composable -import androidx.compose.ui.Modifier -import com.terning.core.designsystem.theme.TerningMain - -@Composable -fun TerningTextField( - value: String, - onValueChange: (String) -> Unit, - modifier: Modifier = Modifier, -) { - BasicTextField( - value = value, - onValueChange = onValueChange, - modifier = Modifier - .fillMaxWidth() - .background(TerningMain) - ) { - Column { - } - } -} \ No newline at end of file From cb739201067d4d1cc599bd4e2e75e510cffaf1d5 Mon Sep 17 00:00:00 2001 From: arinming Date: Wed, 10 Jul 2024 05:44:12 +0900 Subject: [PATCH 13/16] =?UTF-8?q?[FIX/#11]=20=EA=B2=BD=EB=A1=9C=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= 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 e67b04927..beb7b7920 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.navigation.navigateHome import com.terning.feature.mypage.navigation.navigateMyPage -import com.terning.feature.search.navigation.Search +import com.terning.feature.onboarding.signin.navigation.SignIn import com.terning.feature.search.navigation.navigateSearch class MainNavigator( @@ -22,7 +22,7 @@ class MainNavigator( @Composable get() = navController .currentBackStackEntryAsState().value?.destination - val startDestination = Search + val startDestination = SignIn val currentTab: MainTab? @Composable get() = MainTab.find { tab -> From 3b353e67633e157317aca770e5025ac3e430b387 Mon Sep 17 00:00:00 2001 From: arinming Date: Wed, 10 Jul 2024 17:57:28 +0900 Subject: [PATCH 14/16] =?UTF-8?q?[REFACTOR/#11]=20padding=20=EA=B0=92=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 --- .../designsystem/component/textfield/SearchTextField.kt | 4 ++-- .../component/textfield/TerningBasicTextField.kt | 7 ++++--- .../component/topappbar/TerningBasicTopAppBar.kt | 6 ++++-- .../main/java/com/terning/feature/main/MainNavigator.kt | 4 ++-- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/core/src/main/java/com/terning/core/designsystem/component/textfield/SearchTextField.kt b/core/src/main/java/com/terning/core/designsystem/component/textfield/SearchTextField.kt index db4f28f59..29dc5cf87 100644 --- a/core/src/main/java/com/terning/core/designsystem/component/textfield/SearchTextField.kt +++ b/core/src/main/java/com/terning/core/designsystem/component/textfield/SearchTextField.kt @@ -11,14 +11,13 @@ import com.terning.core.designsystem.theme.TerningTheme fun SearchTextField( text: String, onValueChange: (String) -> Unit, - readOnly: Boolean = false, hint: String, leftIcon: Int, + readOnly: Boolean = false, ) { TerningBasicTextField( value = text, onValueChange = onValueChange, - readOnly = readOnly, textStyle = TerningTheme.typography.button3, textColor = Grey400, cursorBrush = SolidColor(Grey300), @@ -28,5 +27,6 @@ fun SearchTextField( hintColor = Grey300, leftIcon = leftIcon, leftIconColor = TerningMain, + readOnly = readOnly, ) } \ No newline at end of file diff --git a/core/src/main/java/com/terning/core/designsystem/component/textfield/TerningBasicTextField.kt b/core/src/main/java/com/terning/core/designsystem/component/textfield/TerningBasicTextField.kt index 358e42b5a..a9045ef5e 100644 --- a/core/src/main/java/com/terning/core/designsystem/component/textfield/TerningBasicTextField.kt +++ b/core/src/main/java/com/terning/core/designsystem/component/textfield/TerningBasicTextField.kt @@ -37,7 +37,6 @@ import com.terning.core.designsystem.theme.White fun TerningBasicTextField( value: String, onValueChange: (String) -> Unit, - readOnly: Boolean = false, textStyle: TextStyle, textColor: Color, hintColor: Color, @@ -52,6 +51,7 @@ fun TerningBasicTextField( helperMessage: String = "", helperIcon: Int? = null, helperColor: Color = TerningMain, + readOnly: Boolean = false, ) { val keyboardController = LocalSoftwareKeyboardController.current val focusManager = LocalFocusManager.current @@ -62,7 +62,6 @@ fun TerningBasicTextField( onValueChange = onValueChange, singleLine = true, maxLines = 1, - readOnly = readOnly, keyboardOptions = KeyboardOptions(imeAction = ImeAction.Done), keyboardActions = KeyboardActions( onDone = { @@ -124,7 +123,9 @@ fun TerningBasicTextField( ) } } - }) + }, + readOnly = readOnly, + ) Row( verticalAlignment = Alignment.CenterVertically, 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 1f54bb766..e08a6d6f8 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 @@ -1,14 +1,17 @@ package com.terning.core.designsystem.component.topappbar +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.runtime.Composable +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 com.terning.core.R import com.terning.core.designsystem.theme.TerningTheme @@ -22,13 +25,11 @@ fun TerningBasicTopAppBar( ) { CenterAlignedTopAppBar( title = { - Text( text = title, textAlign = TextAlign.Center, style = TerningTheme.typography.title2 ) - }, navigationIcon = { if (showBackButton) { @@ -49,5 +50,6 @@ fun TerningBasicTopAppBar( action() } }, + modifier = Modifier.padding(horizontal = 16.dp) ) } \ No newline at end of file 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 beb7b7920..e67b04927 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.navigation.navigateHome import com.terning.feature.mypage.navigation.navigateMyPage -import com.terning.feature.onboarding.signin.navigation.SignIn +import com.terning.feature.search.navigation.Search import com.terning.feature.search.navigation.navigateSearch class MainNavigator( @@ -22,7 +22,7 @@ class MainNavigator( @Composable get() = navController .currentBackStackEntryAsState().value?.destination - val startDestination = SignIn + val startDestination = Search val currentTab: MainTab? @Composable get() = MainTab.find { tab -> From 8321ae2fb5283672fa9b8e6acfc880590fb23539 Mon Sep 17 00:00:00 2001 From: arinming Date: Wed, 10 Jul 2024 17:57:52 +0900 Subject: [PATCH 15/16] =?UTF-8?q?[ADD/#11]=20InternListType=20Enum=20class?= =?UTF-8?q?=20=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/terning/feature/search/SearchRoute.kt | 19 ++++++++++++++----- .../search/component/InternListType.kt | 6 ++++++ .../search/component/SearchInternList.kt | 10 ++++++---- 3 files changed, 26 insertions(+), 9 deletions(-) create mode 100644 feature/src/main/java/com/terning/feature/search/component/InternListType.kt diff --git a/feature/src/main/java/com/terning/feature/search/SearchRoute.kt b/feature/src/main/java/com/terning/feature/search/SearchRoute.kt index 35a2d51c3..dc075791f 100644 --- a/feature/src/main/java/com/terning/feature/search/SearchRoute.kt +++ b/feature/src/main/java/com/terning/feature/search/SearchRoute.kt @@ -21,6 +21,7 @@ import com.terning.core.designsystem.theme.Grey100 import com.terning.core.designsystem.theme.TerningTheme import com.terning.feature.R import com.terning.feature.search.component.ImageSlider +import com.terning.feature.search.component.InternListType import com.terning.feature.search.component.SearchInternList @Composable @@ -41,15 +42,20 @@ fun SearchScreen() { modifier = Modifier .fillMaxWidth() ) { - Box(modifier = Modifier.padding(16.dp)) { + Box( + modifier = Modifier.padding( + horizontal = 24.dp, + vertical = 16.dp + ) + ) { SearchTextField( text = text, onValueChange = { newText -> text = newText }, - readOnly = true, hint = stringResource(R.string.search_text_field_hint), leftIcon = R.drawable.ic_nav_search, + readOnly = true, ) } @@ -61,17 +67,20 @@ fun SearchScreen() { Text( text = stringResource(id = R.string.search_today_popular), - modifier = Modifier.padding(horizontal = 16.dp, vertical = 4.dp), + modifier = Modifier.padding( + horizontal = 24.dp, + vertical = 4.dp + ), style = TerningTheme.typography.title1, color = Black ) - SearchInternList(type = "view") + SearchInternList(type = InternListType.VIEW) HorizontalDivider( thickness = 4.dp, modifier = Modifier.padding(vertical = 8.dp), color = Grey100, ) - SearchInternList(type = "scrap") + SearchInternList(type = InternListType.SCRAP) } } \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/search/component/InternListType.kt b/feature/src/main/java/com/terning/feature/search/component/InternListType.kt new file mode 100644 index 000000000..9caae356d --- /dev/null +++ b/feature/src/main/java/com/terning/feature/search/component/InternListType.kt @@ -0,0 +1,6 @@ +package com.terning.feature.search.component + +enum class InternListType(val type: String) { + VIEW("view"), + SCRAP("scrap"); +} diff --git a/feature/src/main/java/com/terning/feature/search/component/SearchInternList.kt b/feature/src/main/java/com/terning/feature/search/component/SearchInternList.kt index 357b7a63a..8c0eafa80 100644 --- a/feature/src/main/java/com/terning/feature/search/component/SearchInternList.kt +++ b/feature/src/main/java/com/terning/feature/search/component/SearchInternList.kt @@ -15,13 +15,15 @@ import com.terning.feature.R @Composable fun SearchInternList( - type: String, + type: InternListType, ) { - Column(modifier = Modifier.padding(horizontal = 16.dp)) { + Column(modifier = Modifier.padding(horizontal = 24.dp)) { Text( text = stringResource( - id = if (type == "view") R.string.search_most_view_intern - else R.string.search_most_scrap_intern + id = when (type) { + InternListType.VIEW -> R.string.search_most_view_intern + InternListType.SCRAP -> R.string.search_most_scrap_intern + } ), style = TerningTheme.typography.title5, color = Grey400 From cf2c328f9e4946d9c0e1f6cda158877f3180050d Mon Sep 17 00:00:00 2001 From: arinming Date: Wed, 10 Jul 2024 18:26:08 +0900 Subject: [PATCH 16/16] =?UTF-8?q?[FIX/#11]=20=EA=B2=BD=EB=A1=9C=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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/feature/src/main/java/com/terning/feature/main/MainNavigator.kt b/feature/src/main/java/com/terning/feature/main/MainNavigator.kt index e67b04927..68d33fb38 100644 --- a/feature/src/main/java/com/terning/feature/main/MainNavigator.kt +++ b/feature/src/main/java/com/terning/feature/main/MainNavigator.kt @@ -12,6 +12,7 @@ import androidx.navigation.navOptions 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.search.navigation.Search import com.terning.feature.search.navigation.navigateSearch @@ -22,7 +23,7 @@ class MainNavigator( @Composable get() = navController .currentBackStackEntryAsState().value?.destination - val startDestination = Search + val startDestination = SignIn val currentTab: MainTab? @Composable get() = MainTab.find { tab ->