diff --git a/app/src/main/java/kr/co/vividnext/sodalive/chat/character/comment/CharacterCommentListFragment.kt b/app/src/main/java/kr/co/vividnext/sodalive/chat/character/comment/CharacterCommentListFragment.kt index ea7621a0..1a78a652 100644 --- a/app/src/main/java/kr/co/vividnext/sodalive/chat/character/comment/CharacterCommentListFragment.kt +++ b/app/src/main/java/kr/co/vividnext/sodalive/chat/character/comment/CharacterCommentListFragment.kt @@ -92,14 +92,29 @@ class CharacterCommentListFragment : BaseFragment CharacterCommentMoreBottomSheet.newInstance(isOwner).apply { onReport = { - Toast.makeText(requireContext(), "신고되었습니다 (stub)", Toast.LENGTH_SHORT).show() + // 더보기 닫히고 신고 BottomSheet 열림 + val reportSheet = CharacterCommentReportBottomSheet.newInstance() + reportSheet.onSubmit = { reason -> + // 신고 API 스텁 호출 지점 + Toast.makeText(requireContext(), "신고 접수: $reason (stub)", Toast.LENGTH_SHORT).show() + } + reportSheet.show(childFragmentManager, "comment_report") } onDelete = { - val index = adapter.items.indexOfFirst { it.commentId == item.commentId } - if (index >= 0) { - adapter.items.removeAt(index) - adapter.notifyItemRemoved(index) - } + // 삭제 확인 팝업 + androidx.appcompat.app.AlertDialog.Builder(requireContext()) + .setTitle(getString(R.string.confirm_delete_title)) + .setMessage(getString(R.string.confirm_delete_message)) + .setPositiveButton(getString(R.string.confirm)) { _, _ -> + // 삭제 API 스텁 호출 지점 + val index = adapter.items.indexOfFirst { it.commentId == item.commentId } + if (index >= 0) { + adapter.items.removeAt(index) + adapter.notifyItemRemoved(index) + } + } + .setNegativeButton(getString(R.string.cancel), null) + .show() } }.show(childFragmentManager, "comment_more") }, diff --git a/app/src/main/java/kr/co/vividnext/sodalive/chat/character/comment/CharacterCommentReportBottomSheet.kt b/app/src/main/java/kr/co/vividnext/sodalive/chat/character/comment/CharacterCommentReportBottomSheet.kt new file mode 100644 index 00000000..6b6a401e --- /dev/null +++ b/app/src/main/java/kr/co/vividnext/sodalive/chat/character/comment/CharacterCommentReportBottomSheet.kt @@ -0,0 +1,96 @@ +package kr.co.vividnext.sodalive.chat.character.comment + +import android.os.Bundle +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import android.widget.Button +import android.widget.ImageView +import android.widget.LinearLayout +import android.widget.TextView +import androidx.core.os.bundleOf +import androidx.core.view.isVisible +import com.google.android.material.bottomsheet.BottomSheetDialogFragment +import kr.co.vividnext.sodalive.R + +/** + * 댓글/답글 신고 BottomSheet (Stub) + * - 제목: 신고 + * - 신고 이유 단일 선택 목록(String List 주입 가능, 미주입 시 기본 목록 사용) + * - 최하단 신고 버튼(선택 전 비활성화, 선택 후 활성화) + * - 신고 버튼 클릭 시 onSubmit(reason) 콜백 호출 후 닫기 (API 스텁 호출은 콜백 쪽에서 처리) + */ +class CharacterCommentReportBottomSheet : BottomSheetDialogFragment() { + + var onSubmit: ((String) -> Unit)? = null + + private var reasons: ArrayList? = null + private var selectedIndex: Int = -1 + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + reasons = arguments?.getStringArrayList(ARG_REASONS) ?: DEFAULT_REASONS + } + + override fun onCreateView( + inflater: LayoutInflater, + container: ViewGroup?, + savedInstanceState: Bundle? + ): View { + val view = inflater.inflate(R.layout.dialog_character_comment_report, container, false) + val tvTitle = view.findViewById(R.id.tv_title) + val llList = view.findViewById(R.id.ll_reason_list) + val btnReport = view.findViewById