feat(chat-character): 채팅 톡 탭
- 데이터가 없으면 "대화 중인 톡이 없습니다" 메시지 표시
This commit is contained in:
@@ -50,7 +50,14 @@ class TalkTabFragment : BaseFragment<FragmentTalkTabBinding>(
|
|||||||
// 대화방 목록 관찰
|
// 대화방 목록 관찰
|
||||||
viewModel.talkRooms.observe(viewLifecycleOwner) {
|
viewModel.talkRooms.observe(viewLifecycleOwner) {
|
||||||
if (it.isNotEmpty()) {
|
if (it.isNotEmpty()) {
|
||||||
|
binding.rvTalk.visibility = View.VISIBLE
|
||||||
|
binding.tvEmpty.visibility = View.GONE
|
||||||
adapter.submitList(it)
|
adapter.submitList(it)
|
||||||
|
} else {
|
||||||
|
adapter.submitList(emptyList())
|
||||||
|
binding.rvTalk.visibility = View.GONE
|
||||||
|
binding.tvEmpty.visibility = View.VISIBLE
|
||||||
|
binding.tvEmpty.text = "대화 중인 톡이 없습니다"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,4 +15,18 @@
|
|||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_empty"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="대화 중인 톡이 없습니다"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
|
android:textSize="20sp"
|
||||||
|
android:fontFamily="@font/pretendard_regular"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent" />
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|||||||
Reference in New Issue
Block a user