From 9da6c7381d56283b00ca7fd34a02b12b9102c667 Mon Sep 17 00:00:00 2001 From: klaus Date: Sun, 12 Jul 2026 09:54:10 +0900 Subject: [PATCH] =?UTF-8?q?fix(community):=20=EB=A6=AC=EC=8A=A4=ED=8A=B8?= =?UTF-8?q?=20=EC=9E=A0=EA=B8=88=20=EB=B0=98=EC=9D=91=20=ED=91=9C=EC=8B=9C?= =?UTF-8?q?=EB=A5=BC=20=EC=88=A8=EA=B8=B4=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../model/CreatorChannelCommunityMappers.kt | 3 ++- .../model/CreatorChannelCommunityUiModels.kt | 1 + .../ui/CreatorChannelCommunityListAdapter.kt | 3 +++ .../item_creator_channel_community_list.xml | 4 +++- .../CreatorChannelCommunityMapperTest.kt | 15 +++++++++++++++ 5 files changed, 24 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/kr/co/vividnext/sodalive/v2/creator/channel/community/model/CreatorChannelCommunityMappers.kt b/app/src/main/java/kr/co/vividnext/sodalive/v2/creator/channel/community/model/CreatorChannelCommunityMappers.kt index d553736d..560a9dae 100644 --- a/app/src/main/java/kr/co/vividnext/sodalive/v2/creator/channel/community/model/CreatorChannelCommunityMappers.kt +++ b/app/src/main/java/kr/co/vividnext/sodalive/v2/creator/channel/community/model/CreatorChannelCommunityMappers.kt @@ -35,7 +35,8 @@ private fun CreatorChannelCommunityPostResponse.toCommunityPostUiModel( existOrdered = existOrdered, likeCount = likeCount, commentCount = commentCount, - showComment = isCommentAvailable, + showReaction = !isLocked, + showComment = isCommentAvailable && !isLocked, showNotice = isPinned, isPinned = isPinned, isLocked = isLocked, diff --git a/app/src/main/java/kr/co/vividnext/sodalive/v2/creator/channel/community/model/CreatorChannelCommunityUiModels.kt b/app/src/main/java/kr/co/vividnext/sodalive/v2/creator/channel/community/model/CreatorChannelCommunityUiModels.kt index e458a92c..4b9cc011 100644 --- a/app/src/main/java/kr/co/vividnext/sodalive/v2/creator/channel/community/model/CreatorChannelCommunityUiModels.kt +++ b/app/src/main/java/kr/co/vividnext/sodalive/v2/creator/channel/community/model/CreatorChannelCommunityUiModels.kt @@ -37,6 +37,7 @@ data class CreatorChannelCommunityPostUiModel( val existOrdered: Boolean, val likeCount: Int, val commentCount: Int, + val showReaction: Boolean, val showComment: Boolean, val showNotice: Boolean, val isPinned: Boolean, diff --git a/app/src/main/java/kr/co/vividnext/sodalive/v2/creator/channel/community/ui/CreatorChannelCommunityListAdapter.kt b/app/src/main/java/kr/co/vividnext/sodalive/v2/creator/channel/community/ui/CreatorChannelCommunityListAdapter.kt index 48abc5fe..b532d342 100644 --- a/app/src/main/java/kr/co/vividnext/sodalive/v2/creator/channel/community/ui/CreatorChannelCommunityListAdapter.kt +++ b/app/src/main/java/kr/co/vividnext/sodalive/v2/creator/channel/community/ui/CreatorChannelCommunityListAdapter.kt @@ -65,10 +65,13 @@ class CreatorChannelCommunityListAdapter( tvCreatorChannelCommunityListTime.text = item.createdAtText layoutCreatorChannelCommunityListNotice.isVisible = item.showNotice tvCreatorChannelCommunityListBody.text = item.content + layoutCreatorChannelCommunityListReaction.isVisible = item.showReaction || item.showComment tvCreatorChannelCommunityListCommentCount.text = item.commentCount.moneyFormat() tvCreatorChannelCommunityListCommentCount.isVisible = item.showComment ivCreatorChannelCommunityListComment.isVisible = item.showComment tvCreatorChannelCommunityListLikeCount.text = item.likeCount.moneyFormat() + tvCreatorChannelCommunityListLikeCount.isVisible = item.showReaction + ivCreatorChannelCommunityListLike.isVisible = item.showReaction val visibleImageUrl = item.imageUrl.takeUnless { item.isLocked } layoutCreatorChannelCommunityListImageContainer.isVisible = diff --git a/app/src/main/res/layout/item_creator_channel_community_list.xml b/app/src/main/res/layout/item_creator_channel_community_list.xml index b6dcd0f6..2aa87d7c 100644 --- a/app/src/main/res/layout/item_creator_channel_community_list.xml +++ b/app/src/main/res/layout/item_creator_channel_community_list.xml @@ -216,6 +216,7 @@ diff --git a/app/src/test/java/kr/co/vividnext/sodalive/v2/creator/channel/community/CreatorChannelCommunityMapperTest.kt b/app/src/test/java/kr/co/vividnext/sodalive/v2/creator/channel/community/CreatorChannelCommunityMapperTest.kt index a3ce5f64..0133f16f 100644 --- a/app/src/test/java/kr/co/vividnext/sodalive/v2/creator/channel/community/CreatorChannelCommunityMapperTest.kt +++ b/app/src/test/java/kr/co/vividnext/sodalive/v2/creator/channel/community/CreatorChannelCommunityMapperTest.kt @@ -77,6 +77,21 @@ class CreatorChannelCommunityMapperTest { assertFalse(item.showPlayButton) } + @Test + fun `유료 미구매 타인 게시글은 reaction 현황과 댓글을 숨긴다`() { + val item = listOf( + communityPost( + price = 100, + existOrdered = false, + isCommentAvailable = true + ) + ).toCommunityPostUiModels(relativeTimeTextFormatter, isOwner = false, currentUserId = 99L).single() + + assertTrue(item.isLocked) + assertFalse(item.showReaction) + assertFalse(item.showComment) + } + @Test fun `고정 게시글 여부는 owner more 정책에서 사용할 수 있도록 UI 모델에 보존한다`() { val pinnedItem = listOf(communityPost(isPinned = true))