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))