커뮤니티 게시물 - 콘텐츠 글 더보기 기능 추가

This commit is contained in:
2023-12-25 23:51:02 +09:00
parent 5d3891c1db
commit ab24042863
3 changed files with 15 additions and 2 deletions

View File

@@ -15,5 +15,6 @@ data class GetCommunityPostListResponse(
@SerializedName("isLike") var isLike: Boolean,
@SerializedName("likeCount") val likeCount: Int,
@SerializedName("commentCount") val commentCount: Int,
@SerializedName("firstComment") val firstComment: GetCommunityPostCommentListItem?
@SerializedName("firstComment") val firstComment: GetCommunityPostCommentListItem?,
@SerializedName("isExpand") var isExpand: Boolean = false
)

View File

@@ -41,6 +41,17 @@ class CreatorCommunityAllAdapter(
}
binding.tvContent.text = item.content
binding.tvContent.setOnClickListener {
items[index] = items[index].copy(
isExpand = !item.isExpand,
)
notifyDataSetChanged()
}
binding.tvContent.maxLines = if (item.isExpand) {
Int.MAX_VALUE
} else {
3
}
binding.ivSeeMore.setOnClickListener {
showOptionMenu(