From 1d021102fa40eea869146c27427acbfc85ed26d8 Mon Sep 17 00:00:00 2001 From: Hyobeen-Park Date: Thu, 11 Jul 2024 07:02:30 +0900 Subject: [PATCH] =?UTF-8?q?[FEAT/#12]=20stickyHeader=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/home/HomeRoute.kt | 113 +++++++++++------- 1 file changed, 69 insertions(+), 44 deletions(-) diff --git a/feature/src/main/java/com/terning/feature/home/HomeRoute.kt b/feature/src/main/java/com/terning/feature/home/HomeRoute.kt index 8ebba4822..dc98176f4 100644 --- a/feature/src/main/java/com/terning/feature/home/HomeRoute.kt +++ b/feature/src/main/java/com/terning/feature/home/HomeRoute.kt @@ -1,10 +1,12 @@ package com.terning.feature.home +import androidx.compose.foundation.ExperimentalFoundationApi +import androidx.compose.foundation.background import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.material3.HorizontalDivider import androidx.compose.material3.Text import androidx.compose.runtime.Composable @@ -12,10 +14,11 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import com.terning.core.designsystem.theme.Black +import com.terning.core.designsystem.theme.Grey150 import com.terning.core.designsystem.theme.TerningTheme +import com.terning.core.designsystem.theme.White import com.terning.feature.R import com.terning.feature.home.component.HomeFilteringScreen -import com.terning.feature.home.component.HomeRecommendEmptyIntern import com.terning.feature.home.component.HomeTodayIntern @Composable @@ -23,56 +26,78 @@ fun HomeRoute() { HomeScreen() } +@OptIn(ExperimentalFoundationApi::class) @Composable fun HomeScreen() { - Column( + LazyColumn( modifier = Modifier .fillMaxSize() - .padding(horizontal = 24.dp) ) { - Text( - text = stringResource( - id = R.string.home_today_title_start - ) - + "남지우" - + stringResource( - id = R.string.home_today_title_end - ), - modifier = Modifier - .padding(top = 11.dp), - style = TerningTheme.typography.title1, - color = Black, - ) - - HomeTodayIntern() -// HomeNoClosedTodayItem(isButtonExist = false) - - Text( - text = stringResource(id = R.string.home_recommend_sub_title), - style = TerningTheme.typography.detail2, - color = Black, - modifier = Modifier - .padding(top = 25.dp) - ) + item { + Column( + modifier = Modifier + .padding(bottom = 16.dp) + ) { + Text( + text = stringResource( + id = R.string.home_today_title_start + ) + + "남지우" + + stringResource( + id = R.string.home_today_title_end + ), + modifier = Modifier + .padding(top = 11.dp) + .padding(horizontal = 24.dp), + style = TerningTheme.typography.title1, + color = Black, + ) +// HomeTodayEmptyIntern(isButtonExist = false) + HomeTodayIntern() + } + } + stickyHeader { + Column( + modifier = Modifier + .background(White) + ) { + Text( + text = stringResource(id = R.string.home_recommend_sub_title), + style = TerningTheme.typography.detail2, + color = Black, + modifier = Modifier + .padding(top = 25.dp) + .padding(horizontal = 24.dp), + ) - Text( - text = stringResource(id = R.string.home_recommend_main_title), - style = TerningTheme.typography.title1, - color = Black, - modifier = Modifier - .padding(top = 5.dp) - ) + Text( + text = stringResource(id = R.string.home_recommend_main_title), + style = TerningTheme.typography.title1, + color = Black, + modifier = Modifier + .padding(top = 5.dp) + .padding(horizontal = 24.dp), + ) - HomeFilteringScreen(3, 1, 7) + HomeFilteringScreen(3, 1, 7) - HorizontalDivider( - Modifier - .fillMaxWidth() - .height(4.dp) - ) + HorizontalDivider( + thickness = 4.dp, + color = Grey150, + modifier = Modifier + .fillMaxWidth(), + ) + } + } -// HomeRecommendIntern() - HomeRecommendEmptyIntern() + items(10) { + TerningPostItem( + imageUrl = "https://reqres.in/img/faces/7-image.jpg", + title = "[Someone] 콘텐츠 마케터 대학생 인턴 채용", + dateDeadline = "2", + workingPeriod = "2개월", + isScraped = false, + ) + } } } -