feat(creator-channel): 더보기 메뉴 폰트를 고정한다

This commit is contained in:
2026-07-09 01:28:42 +09:00
parent 1f1069b05d
commit 3271c9e142
4 changed files with 101 additions and 24 deletions

View File

@@ -3,7 +3,6 @@ package kr.co.vividnext.sodalive.v2.creator.channel.community.detail.reply.ui
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import androidx.appcompat.widget.PopupMenu
import androidx.core.view.isVisible import androidx.core.view.isVisible
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import coil.transform.CircleCropTransformation import coil.transform.CircleCropTransformation
@@ -11,6 +10,7 @@ import kr.co.vividnext.sodalive.R
import kr.co.vividnext.sodalive.databinding.ItemCreatorChannelCommunityReplyBinding import kr.co.vividnext.sodalive.databinding.ItemCreatorChannelCommunityReplyBinding
import kr.co.vividnext.sodalive.extensions.loadUrl import kr.co.vividnext.sodalive.extensions.loadUrl
import kr.co.vividnext.sodalive.v2.creator.channel.community.detail.CreatorChannelCommunityReplyUiModel import kr.co.vividnext.sodalive.v2.creator.channel.community.detail.CreatorChannelCommunityReplyUiModel
import kr.co.vividnext.sodalive.v2.creator.channel.community.detail.ui.CreatorChannelCommunityMorePopup
class CreatorChannelCommunityReplyAdapter( class CreatorChannelCommunityReplyAdapter(
private val onModifyClick: (CreatorChannelCommunityReplyUiModel) -> Unit, private val onModifyClick: (CreatorChannelCommunityReplyUiModel) -> Unit,
@@ -66,17 +66,13 @@ class CreatorChannelCommunityReplyAdapter(
onDeleteClick: (CreatorChannelCommunityReplyUiModel) -> Unit onDeleteClick: (CreatorChannelCommunityReplyUiModel) -> Unit
) { ) {
if (!item.canShowMore) return if (!item.canShowMore) return
val popup = PopupMenu(anchor.context, anchor) CreatorChannelCommunityMorePopup(
val menuRes = if (item.isMine) R.menu.content_comment_option_menu else R.menu.content_comment_option_menu2 anchor = anchor,
popup.menuInflater.inflate(menuRes, popup.menu) showEdit = item.isMine,
popup.setOnMenuItemClickListener { menuItem -> showDelete = true,
when (menuItem.itemId) { onEditClick = { onModifyClick(item) },
R.id.menu_review_modify -> onModifyClick(item) onDeleteClick = { onDeleteClick(item) }
R.id.menu_review_delete -> onDeleteClick(item) ).show(anchor)
}
true
}
popup.show()
} }
private val CreatorChannelCommunityReplyUiModel.canShowMore: Boolean private val CreatorChannelCommunityReplyUiModel.canShowMore: Boolean

View File

@@ -3,7 +3,6 @@ package kr.co.vividnext.sodalive.v2.creator.channel.community.detail.ui
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import androidx.appcompat.widget.PopupMenu
import androidx.core.view.isVisible import androidx.core.view.isVisible
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import coil.transform.CircleCropTransformation import coil.transform.CircleCropTransformation
@@ -97,17 +96,13 @@ class CreatorChannelCommunityCommentAdapter(
onDeleteClick: (CreatorChannelCommunityCommentUiModel) -> Unit onDeleteClick: (CreatorChannelCommunityCommentUiModel) -> Unit
) { ) {
if (!item.canShowMore) return if (!item.canShowMore) return
val popup = PopupMenu(anchor.context, anchor) CreatorChannelCommunityMorePopup(
val menuRes = if (item.isMine) R.menu.content_comment_option_menu else R.menu.content_comment_option_menu2 anchor = anchor,
popup.menuInflater.inflate(menuRes, popup.menu) showEdit = item.isMine,
popup.setOnMenuItemClickListener { menuItem -> showDelete = true,
when (menuItem.itemId) { onEditClick = { onModifyClick(item) },
R.id.menu_review_modify -> onModifyClick(item) onDeleteClick = { onDeleteClick(item) }
R.id.menu_review_delete -> onDeleteClick(item) ).show(anchor)
}
true
}
popup.show()
} }
private val CreatorChannelCommunityCommentUiModel.canShowMore: Boolean private val CreatorChannelCommunityCommentUiModel.canShowMore: Boolean

View File

@@ -0,0 +1,50 @@
package kr.co.vividnext.sodalive.v2.creator.channel.community.detail.ui
import android.graphics.Color
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.PopupWindow
import androidx.core.graphics.drawable.toDrawable
import androidx.core.view.isVisible
import kr.co.vividnext.sodalive.databinding.ViewCreatorChannelCommunityMorePopupBinding
class CreatorChannelCommunityMorePopup(
anchor: View,
showEdit: Boolean,
showDelete: Boolean,
onEditClick: () -> Unit,
onDeleteClick: () -> Unit
) {
private val binding = ViewCreatorChannelCommunityMorePopupBinding.inflate(LayoutInflater.from(anchor.context))
private val popupWindow: PopupWindow = PopupWindow(anchor.context).apply {
contentView = binding.root
width = ViewGroup.LayoutParams.WRAP_CONTENT
height = ViewGroup.LayoutParams.WRAP_CONTENT
isOutsideTouchable = true
isFocusable = true
setBackgroundDrawable(Color.TRANSPARENT.toDrawable())
}
init {
binding.tvCreatorChannelCommunityMoreEdit.isVisible = showEdit
binding.tvCreatorChannelCommunityMoreDelete.isVisible = showDelete
binding.tvCreatorChannelCommunityMoreEdit.setOnClickListener {
dismiss()
onEditClick()
}
binding.tvCreatorChannelCommunityMoreDelete.setOnClickListener {
dismiss()
onDeleteClick()
}
}
fun show(anchor: View) {
popupWindow.showAsDropDown(anchor)
}
fun dismiss() {
popupWindow.dismiss()
}
}

View File

@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/bg_creator_channel_sort_popup"
android:orientation="vertical"
android:paddingHorizontal="@dimen/spacing_12"
android:paddingVertical="@dimen/spacing_8">
<TextView
android:id="@+id/tv_creator_channel_community_more_edit"
style="@style/Typography.Body3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/regular"
android:includeFontPadding="false"
android:paddingHorizontal="@dimen/spacing_12"
android:paddingVertical="@dimen/spacing_8"
android:text="@string/creator_channel_fantalk_edit"
android:textColor="@color/white"
tools:ignore="UnusedAttribute" />
<TextView
android:id="@+id/tv_creator_channel_community_more_delete"
style="@style/Typography.Body3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/regular"
android:includeFontPadding="false"
android:paddingHorizontal="@dimen/spacing_12"
android:paddingVertical="@dimen/spacing_8"
android:text="@string/creator_channel_fantalk_delete"
android:textColor="@color/white"
tools:ignore="UnusedAttribute" />
</LinearLayout>