fix(comment): 캐릭터 댓글 신고 BottomSheet가 표시되지 않는 문제 수정
- childFragmentManager 대신 parentFragmentManager로 신고 BottomSheet 표시 - BottomSheet dismiss 직후 show 트랜잭션 충돌/우선순위 이슈 완화
This commit is contained in:
@@ -137,7 +137,7 @@ class CharacterCommentListFragment : BaseFragment<FragmentCharacterCommentListBi
|
||||
})
|
||||
compositeDisposable.add(d)
|
||||
}
|
||||
reportSheet.show(childFragmentManager, "comment_report")
|
||||
reportSheet.show(parentFragmentManager, "comment_report")
|
||||
}
|
||||
onDelete = {
|
||||
// 삭제 확인 팝업
|
||||
|
||||
@@ -28,17 +28,23 @@ class CharacterCommentMoreBottomSheet : BottomSheetDialogFragment() {
|
||||
val view = inflater.inflate(R.layout.dialog_character_comment_more, container, false)
|
||||
val tvReport = view.findViewById<TextView>(R.id.tv_report)
|
||||
val tvDelete = view.findViewById<TextView>(R.id.tv_delete)
|
||||
|
||||
// 공통 리스너 설정
|
||||
tvReport.setOnClickListener {
|
||||
dismiss()
|
||||
onReport?.invoke()
|
||||
}
|
||||
|
||||
// 요구사항: 내가 쓴 댓글은 '삭제'만, 남이 쓴 댓글은 '신고'만 노출
|
||||
if (isOwner) {
|
||||
tvReport.visibility = View.GONE
|
||||
tvDelete.visibility = View.VISIBLE
|
||||
tvDelete.setOnClickListener {
|
||||
dismiss()
|
||||
onDelete?.invoke()
|
||||
}
|
||||
} else {
|
||||
tvReport.visibility = View.VISIBLE
|
||||
tvDelete.visibility = View.GONE
|
||||
}
|
||||
return view
|
||||
|
||||
7
app/src/main/res/drawable/bg_bottom_sheet_handle.xml
Normal file
7
app/src/main/res/drawable/bg_bottom_sheet_handle.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<size android:height="4dp" />
|
||||
<corners android:radius="2dp" />
|
||||
<solid android:color="#66FFFFFF" />
|
||||
</shape>
|
||||
@@ -3,29 +3,36 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp"
|
||||
android:background="@color/color_131313">
|
||||
android:paddingHorizontal="24dp"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:background="@color/color_131313"
|
||||
android:gravity="center_horizontal">
|
||||
|
||||
<!-- 상단 handlebar -->
|
||||
<View
|
||||
android:id="@+id/handle"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="4dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:background="@drawable/bg_bottom_sheet_handle" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_report"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingVertical="12dp"
|
||||
android:paddingVertical="16dp"
|
||||
android:text="신고"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#78909C" />
|
||||
android:textSize="18sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_delete"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingVertical="12dp"
|
||||
android:paddingVertical="16dp"
|
||||
android:text="삭제"
|
||||
android:textColor="#EF5350"
|
||||
android:textSize="16sp" />
|
||||
android:textSize="18sp" />
|
||||
</LinearLayout>
|
||||
|
||||
Reference in New Issue
Block a user