From 790e08f1b553651cfe98ed153b465b8ab75cafd7 Mon Sep 17 00:00:00 2001 From: klaus Date: Mon, 22 Jun 2026 17:45:36 +0900 Subject: [PATCH] =?UTF-8?q?feat(creator):=20FanTalk=20=EB=8D=94=EB=B3=B4?= =?UTF-8?q?=EA=B8=B0=20=ED=8C=9D=EC=97=85=EC=9D=84=20=EC=B6=94=EA=B0=80?= =?UTF-8?q?=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/CreatorChannelFanTalkMorePopup.kt | 49 +++++++++++++++++++ ...iew_creator_channel_fantalk_more_popup.xml | 31 ++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 app/src/main/java/kr/co/vividnext/sodalive/v2/creator/channel/fantalk/ui/CreatorChannelFanTalkMorePopup.kt create mode 100644 app/src/main/res/layout/view_creator_channel_fantalk_more_popup.xml diff --git a/app/src/main/java/kr/co/vividnext/sodalive/v2/creator/channel/fantalk/ui/CreatorChannelFanTalkMorePopup.kt b/app/src/main/java/kr/co/vividnext/sodalive/v2/creator/channel/fantalk/ui/CreatorChannelFanTalkMorePopup.kt new file mode 100644 index 00000000..8d3068f2 --- /dev/null +++ b/app/src/main/java/kr/co/vividnext/sodalive/v2/creator/channel/fantalk/ui/CreatorChannelFanTalkMorePopup.kt @@ -0,0 +1,49 @@ +package kr.co.vividnext.sodalive.v2.creator.channel.fantalk.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.ViewCreatorChannelFantalkMorePopupBinding + +class CreatorChannelFanTalkMorePopup( + private val anchor: View, + private val fanTalkId: Long, + private val showEdit: Boolean, + private val showDelete: Boolean, + private val onDeleteClick: (Long) -> Unit +) { + + private val binding = ViewCreatorChannelFantalkMorePopupBinding.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.tvCreatorChannelFantalkMoreEdit.isVisible = showEdit + binding.tvCreatorChannelFantalkMoreDelete.isVisible = showDelete + binding.tvCreatorChannelFantalkMoreEdit.setOnClickListener { + dismiss() + } + binding.tvCreatorChannelFantalkMoreDelete.setOnClickListener { + dismiss() + onDeleteClick(fanTalkId) + } + } + + fun show() { + popupWindow.showAsDropDown(anchor) + } + + fun dismiss() { + popupWindow.dismiss() + } +} diff --git a/app/src/main/res/layout/view_creator_channel_fantalk_more_popup.xml b/app/src/main/res/layout/view_creator_channel_fantalk_more_popup.xml new file mode 100644 index 00000000..d36e8920 --- /dev/null +++ b/app/src/main/res/layout/view_creator_channel_fantalk_more_popup.xml @@ -0,0 +1,31 @@ + + + + + + +