fix(community): 상세 잠금 반응과 댓글을 숨긴다

This commit is contained in:
2026-07-12 09:54:26 +09:00
parent f799449d54
commit 2d8f8cab81
4 changed files with 46 additions and 8 deletions
@@ -140,12 +140,15 @@ class CreatorChannelCommunityDetailActivity : BaseActivity<ActivityCreatorChanne
tvCreatorChannelCommunityDetailNickname.text = post.creatorNickname
tvCreatorChannelCommunityDetailTime.text = post.createdAtText
tvCreatorChannelCommunityDetailBody.text = post.content
layoutCreatorChannelCommunityDetailReaction.isVisible = post.showReaction || content.isCommentAvailable
tvCreatorChannelCommunityDetailLikeCount.text = post.likeCount.moneyFormat()
tvCreatorChannelCommunityDetailCommentCount.text = post.commentCount.moneyFormat()
tvCreatorChannelCommunityDetailCommentHeader.text = getString(
R.string.creator_channel_community_comment_header,
post.commentCount.moneyFormat()
)
ivCreatorChannelCommunityDetailHeart.isVisible = post.showReaction
tvCreatorChannelCommunityDetailLikeCount.isVisible = post.showReaction
ivCreatorChannelCommunityDetailHeart.setImageResource(
if (post.isLiked) R.drawable.ic_feed_community_heart_fill else R.drawable.ic_feed_community_heart
)
@@ -304,18 +304,20 @@ class CreatorChannelCommunityDetailViewModel(
}
val isCreatorOwner = data.creatorId == SharedPreferenceManager.userId
val comments = if (data.isCommentAvailable) {
val post = data.toUiModel()
val isCommentVisible = data.isCommentAvailable && !post.isLocked
val comments = if (isCommentVisible) {
data.comments.comments.map { it.toUiModel(isCreatorOwner) }
} else {
emptyList()
}
_detailStateLiveData.value = CreatorChannelCommunityDetailUiState.Content(
post = data.toUiModel(),
isCommentAvailable = data.isCommentAvailable,
isCommentInputVisible = data.isCommentAvailable,
post = post,
isCommentAvailable = isCommentVisible,
isCommentInputVisible = isCommentVisible,
comments = comments,
commentPage = data.comments.page,
hasNextComment = data.isCommentAvailable && data.comments.hasNext
hasNextComment = isCommentVisible && data.comments.hasNext
)
}
@@ -439,7 +441,8 @@ class CreatorChannelCommunityDetailViewModel(
isLiked = isLiked,
isPinned = isPinned,
isLocked = isLocked(),
showPaywall = isLocked()
showPaywall = isLocked(),
showReaction = !isLocked()
)
private fun CreatorChannelCommunityPostDetailResponse.isLocked(): Boolean {
@@ -524,7 +527,8 @@ data class CreatorChannelCommunityPostDetailUiModel(
val isLiked: Boolean,
val isPinned: Boolean,
val isLocked: Boolean,
val showPaywall: Boolean
val showPaywall: Boolean,
val showReaction: Boolean
)
data class CreatorChannelCommunityCommentUiModel(
@@ -238,6 +238,7 @@
tools:visibility="visible" />
<LinearLayout
android:id="@+id/layout_creator_channel_community_detail_reaction"
android:layout_width="match_parent"
android:layout_height="24dp"
android:layout_marginTop="@dimen/spacing_16"
@@ -256,6 +257,7 @@
style="@style/Typography.Body3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="15dp"
android:layout_marginStart="@dimen/spacing_4"
android:includeFontPadding="false"
android:textColor="@color/gray_400"
@@ -265,7 +267,6 @@
android:id="@+id/iv_creator_channel_community_detail_heart"
android:layout_width="18dp"
android:layout_height="18dp"
android:layout_marginStart="15dp"
android:contentDescription="@null"
android:src="@drawable/ic_feed_community_heart" />