From 7db08f5dd38fd162017c93b4a14931cf847eecc7 Mon Sep 17 00:00:00 2001 From: JaesungLeee Date: Sat, 17 Aug 2024 15:59:42 +0900 Subject: [PATCH] =?UTF-8?q?[Feat]=20=EB=B0=88=20=EA=B0=AF=EC=88=98=20?= =?UTF-8?q?=ED=97=A4=EB=8D=94=20=EC=8A=A4=ED=81=AC=EB=A1=A4=20=EA=B0=80?= =?UTF-8?q?=EB=8A=A5=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/team/ppac/search/detail/SearchDetailScreen.kt | 3 +-- .../search/detail/component/SearchDetailResultContent.kt | 7 ++++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/feature/search/src/main/java/team/ppac/search/detail/SearchDetailScreen.kt b/feature/search/src/main/java/team/ppac/search/detail/SearchDetailScreen.kt index 137dd4a4..9a46366c 100644 --- a/feature/search/src/main/java/team/ppac/search/detail/SearchDetailScreen.kt +++ b/feature/search/src/main/java/team/ppac/search/detail/SearchDetailScreen.kt @@ -22,7 +22,6 @@ import team.ppac.designsystem.component.toolbar.FarmemeBackToolBar import team.ppac.search.detail.component.EmptyResultContent import team.ppac.search.detail.component.SearchDetailLoadingContent import team.ppac.search.detail.component.SearchDetailResultContent -import team.ppac.search.detail.component.SearchDetailResultHeader import team.ppac.search.detail.mvi.SearchDetailUiState @Composable @@ -85,8 +84,8 @@ internal fun SearchDetailScreen( if (uiState.totalMemeCount == 0) { EmptyResultContent() } else { - SearchDetailResultHeader(totalCount = uiState.totalMemeCount) SearchDetailResultContent( + totalItemCount = uiState.totalMemeCount, searchResults = searchResults, onMemeClick = onMemeClick, ) diff --git a/feature/search/src/main/java/team/ppac/search/detail/component/SearchDetailResultContent.kt b/feature/search/src/main/java/team/ppac/search/detail/component/SearchDetailResultContent.kt index 64a5a6d0..efa83473 100644 --- a/feature/search/src/main/java/team/ppac/search/detail/component/SearchDetailResultContent.kt +++ b/feature/search/src/main/java/team/ppac/search/detail/component/SearchDetailResultContent.kt @@ -1,6 +1,7 @@ package team.ppac.search.detail.component import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.offset import androidx.compose.foundation.lazy.staggeredgrid.LazyVerticalStaggeredGrid import androidx.compose.foundation.lazy.staggeredgrid.StaggeredGridCells import androidx.compose.foundation.lazy.staggeredgrid.StaggeredGridItemSpan @@ -16,6 +17,7 @@ import team.ppac.search.detail.model.SearchResultUiModel @Composable fun SearchDetailResultContent( modifier: Modifier = Modifier, + totalItemCount: Int, searchResults: LazyPagingItems, onMemeClick: (String) -> Unit, ) { @@ -25,6 +27,9 @@ fun SearchDetailResultContent( horizontalArrangement = Arrangement.spacedBy(space = 12.dp), verticalItemSpacing = 20.dp ) { + item(span = StaggeredGridItemSpan.FullLine) { + SearchDetailResultHeader(totalCount = totalItemCount) + } items( count = searchResults.itemCount, key = searchResults.itemKey(SearchResultUiModel::memeId) @@ -33,7 +38,7 @@ fun SearchDetailResultContent( with(searchResult) { FarmemeMemeItem( - modifier = Modifier, + modifier = Modifier.offset(y = (-20).dp), memeId = memeId, memeTitle = memeTitle, lolCount = lolCount,