From e956d2888433f8f258887cb7601fcd61bb3a7f7c Mon Sep 17 00:00:00 2001 From: Gaeun Lee Date: Fri, 9 Aug 2024 12:02:48 +0900 Subject: [PATCH] =?UTF-8?q?[AN]=20feat:=20=EC=B1=84=ED=8C=85=20=EC=A0=84?= =?UTF-8?q?=EC=B2=B4=20=EB=A6=AC=EC=8A=A4=ED=8A=B8=20refresh=20=EA=B8=B0?= =?UTF-8?q?=EB=8A=A5=20=EA=B5=AC=ED=98=84=20(#346)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/chatlist/ChatListFragment.kt | 8 +++ .../main/res/layout/fragment_chat_list.xml | 51 +++++++++++-------- 2 files changed, 37 insertions(+), 22 deletions(-) diff --git a/android/app/src/main/java/com/happy/friendogly/presentation/ui/chatlist/ChatListFragment.kt b/android/app/src/main/java/com/happy/friendogly/presentation/ui/chatlist/ChatListFragment.kt index 7728c2666..293673d65 100644 --- a/android/app/src/main/java/com/happy/friendogly/presentation/ui/chatlist/ChatListFragment.kt +++ b/android/app/src/main/java/com/happy/friendogly/presentation/ui/chatlist/ChatListFragment.kt @@ -29,6 +29,14 @@ class ChatListFragment : viewModel.chats.observe(viewLifecycleOwner) { chats -> adapter.submitList(chats) } + swipeEvent() + } + + private fun swipeEvent() { + binding.swipelayoutChatListRefresh.setOnRefreshListener { + viewModel.getChats() + binding.swipelayoutChatListRefresh.isRefreshing = false + } } override fun navigateToChat(chatId: Long) { diff --git a/android/app/src/main/res/layout/fragment_chat_list.xml b/android/app/src/main/res/layout/fragment_chat_list.xml index bfde55684..2f6b5bab9 100644 --- a/android/app/src/main/res/layout/fragment_chat_list.xml +++ b/android/app/src/main/res/layout/fragment_chat_list.xml @@ -6,34 +6,41 @@ - - - - + + android:layout_height="match_parent" + android:background="@color/white"> - + android:background="@drawable/rect_gray03_botline_bot1"> - - + - + + + + + + + + + -