From 972025344d888725a1bb5520e2af792b6951977b Mon Sep 17 00:00:00 2001 From: HuanCheng65 <22636177+HuanCheng65@users.noreply.github.com> Date: Mon, 29 Jan 2024 16:38:46 +0800 Subject: [PATCH] =?UTF-8?q?feat(SearchPost):=20=E6=98=BE=E7=A4=BA=E5=8E=9F?= =?UTF-8?q?=E8=B4=B4=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tieba/post/ui/widgets/compose/Search.kt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/huanchengfly/tieba/post/ui/widgets/compose/Search.kt b/app/src/main/java/com/huanchengfly/tieba/post/ui/widgets/compose/Search.kt index 58fc86ba..5654c932 100644 --- a/app/src/main/java/com/huanchengfly/tieba/post/ui/widgets/compose/Search.kt +++ b/app/src/main/java/com/huanchengfly/tieba/post/ui/widgets/compose/Search.kt @@ -63,6 +63,7 @@ import com.huanchengfly.tieba.post.utils.StringUtil import com.huanchengfly.tieba.post.utils.StringUtil.buildAnnotatedStringWithUser import com.huanchengfly.tieba.post.utils.appPreferences import kotlinx.collections.immutable.ImmutableList +import kotlinx.collections.immutable.persistentListOf import kotlinx.collections.immutable.toImmutableList import kotlin.math.min @@ -71,6 +72,7 @@ fun QuotePostCard( quotePostInfo: SearchThreadBean.PostInfo, mainPost: SearchThreadBean.MainPost, modifier: Modifier = Modifier, + medias: ImmutableList = persistentListOf(), keyword: String? = null, ) { val quoteContentString = remember(quotePostInfo) { @@ -93,12 +95,13 @@ fun QuotePostCard( highlightKeywords = (keyword?.split(" ") ?: emptyList()).toImmutableList() ) MainPostCard( - keyword = keyword, mainPost = mainPost, modifier = Modifier .fillMaxWidth() .clip(RoundedCornerShape(6.dp)) - .background(ExtendedTheme.colors.card) + .background(ExtendedTheme.colors.card), + medias = medias, + keyword = keyword ) } } @@ -107,6 +110,7 @@ fun QuotePostCard( fun MainPostCard( mainPost: SearchThreadBean.MainPost, modifier: Modifier = Modifier, + medias: ImmutableList = persistentListOf(), keyword: String? = null, ) { val titleString = remember(mainPost) { @@ -137,6 +141,7 @@ fun MainPostCard( overflow = TextOverflow.Ellipsis, ) } + SearchMedia(medias = medias) } } @@ -254,6 +259,7 @@ fun SearchThreadItem( .clickable { onQuotePostClick(item.postInfo) }, + medias = item.media.toImmutableList(), keyword = searchKeyword ) } else { @@ -266,6 +272,7 @@ fun SearchThreadItem( .clickable { onMainPostClick(item.mainPost) }, + medias = item.media.toImmutableList(), keyword = searchKeyword ) }