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

This commit is contained in:
klaus 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(

View File

@ -65,6 +65,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="13.3dp"
android:ellipsize="end"
android:fontFamily="@font/gmarket_sans_medium"
android:maxLines="3"
android:textColor="@color/color_bbbbbb"
@ -83,9 +84,9 @@
android:id="@+id/ll_like"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="13.3dp"
android:background="@drawable/bg_round_corner_26_7_19ffffff"
android:gravity="center"
android:layout_marginTop="13.3dp"
android:orientation="horizontal"
android:paddingHorizontal="13.3dp"
android:paddingVertical="5.3dp"