feat(SearchPost): 显示原贴图片
This commit is contained in:
parent
7087984b57
commit
972025344d
|
|
@ -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.StringUtil.buildAnnotatedStringWithUser
|
||||||
import com.huanchengfly.tieba.post.utils.appPreferences
|
import com.huanchengfly.tieba.post.utils.appPreferences
|
||||||
import kotlinx.collections.immutable.ImmutableList
|
import kotlinx.collections.immutable.ImmutableList
|
||||||
|
import kotlinx.collections.immutable.persistentListOf
|
||||||
import kotlinx.collections.immutable.toImmutableList
|
import kotlinx.collections.immutable.toImmutableList
|
||||||
import kotlin.math.min
|
import kotlin.math.min
|
||||||
|
|
||||||
|
|
@ -71,6 +72,7 @@ fun QuotePostCard(
|
||||||
quotePostInfo: SearchThreadBean.PostInfo,
|
quotePostInfo: SearchThreadBean.PostInfo,
|
||||||
mainPost: SearchThreadBean.MainPost,
|
mainPost: SearchThreadBean.MainPost,
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
|
medias: ImmutableList<SearchThreadBean.MediaInfo> = persistentListOf(),
|
||||||
keyword: String? = null,
|
keyword: String? = null,
|
||||||
) {
|
) {
|
||||||
val quoteContentString = remember(quotePostInfo) {
|
val quoteContentString = remember(quotePostInfo) {
|
||||||
|
|
@ -93,12 +95,13 @@ fun QuotePostCard(
|
||||||
highlightKeywords = (keyword?.split(" ") ?: emptyList()).toImmutableList()
|
highlightKeywords = (keyword?.split(" ") ?: emptyList()).toImmutableList()
|
||||||
)
|
)
|
||||||
MainPostCard(
|
MainPostCard(
|
||||||
keyword = keyword,
|
|
||||||
mainPost = mainPost,
|
mainPost = mainPost,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.clip(RoundedCornerShape(6.dp))
|
.clip(RoundedCornerShape(6.dp))
|
||||||
.background(ExtendedTheme.colors.card)
|
.background(ExtendedTheme.colors.card),
|
||||||
|
medias = medias,
|
||||||
|
keyword = keyword
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -107,6 +110,7 @@ fun QuotePostCard(
|
||||||
fun MainPostCard(
|
fun MainPostCard(
|
||||||
mainPost: SearchThreadBean.MainPost,
|
mainPost: SearchThreadBean.MainPost,
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
|
medias: ImmutableList<SearchThreadBean.MediaInfo> = persistentListOf(),
|
||||||
keyword: String? = null,
|
keyword: String? = null,
|
||||||
) {
|
) {
|
||||||
val titleString = remember(mainPost) {
|
val titleString = remember(mainPost) {
|
||||||
|
|
@ -137,6 +141,7 @@ fun MainPostCard(
|
||||||
overflow = TextOverflow.Ellipsis,
|
overflow = TextOverflow.Ellipsis,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
SearchMedia(medias = medias)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -254,6 +259,7 @@ fun SearchThreadItem(
|
||||||
.clickable {
|
.clickable {
|
||||||
onQuotePostClick(item.postInfo)
|
onQuotePostClick(item.postInfo)
|
||||||
},
|
},
|
||||||
|
medias = item.media.toImmutableList(),
|
||||||
keyword = searchKeyword
|
keyword = searchKeyword
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -266,6 +272,7 @@ fun SearchThreadItem(
|
||||||
.clickable {
|
.clickable {
|
||||||
onMainPostClick(item.mainPost)
|
onMainPostClick(item.mainPost)
|
||||||
},
|
},
|
||||||
|
medias = item.media.toImmutableList(),
|
||||||
keyword = searchKeyword
|
keyword = searchKeyword
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue