From 7167c90ef381236af995fbc03a91c429c38b413a Mon Sep 17 00:00:00 2001 From: vrexpert Date: Mon, 13 Nov 2023 22:49:19 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=ED=98=84=EC=9E=AC=20=EC=84=A0=ED=83=9D?= =?UTF-8?q?=EB=90=9C=20=EC=B9=A9=EC=9D=98=20=ED=95=84=ED=84=B0=EB=A7=81?= =?UTF-8?q?=EC=97=90=20=ED=95=B4=EB=8B=B9=ED=95=98=EB=8A=94=20=EB=A6=AC?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=EB=A5=BC=20=EC=9A=94=EC=B2=AD=ED=95=9C?= =?UTF-8?q?=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../home/festivallist/FestivalListFragment.kt | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/android/festago/app/src/main/java/com/festago/festago/presentation/ui/home/festivallist/FestivalListFragment.kt b/android/festago/app/src/main/java/com/festago/festago/presentation/ui/home/festivallist/FestivalListFragment.kt index 7a15d2434..228bcf362 100644 --- a/android/festago/app/src/main/java/com/festago/festago/presentation/ui/home/festivallist/FestivalListFragment.kt +++ b/android/festago/app/src/main/java/com/festago/festago/presentation/ui/home/festivallist/FestivalListFragment.kt @@ -63,7 +63,7 @@ class FestivalListFragment : Fragment(R.layout.fragment_festival_list) { initFestivalListSpanSize() initRefresh() initFestivalFilters() - vm.loadFestivals(vm.festivalFilter.value) + loadFestivalsBy(binding.cgFilterOption.checkedChipId) } private fun initFestivalListSpanSize() { @@ -81,18 +81,22 @@ class FestivalListFragment : Fragment(R.layout.fragment_festival_list) { private fun initRefresh() { binding.srlFestivalList.setOnRefreshListener { - vm.loadFestivals(vm.festivalFilter.value) + loadFestivalsBy(binding.cgFilterOption.checkedChipId) binding.srlFestivalList.isRefreshing = false } } private fun initFestivalFilters() { binding.cgFilterOption.setOnCheckedStateChangeListener { group, _ -> - when (group.checkedChipId) { - R.id.chipProgress -> vm.loadFestivals(FestivalFilter.PROGRESS) - R.id.chipPlanned -> vm.loadFestivals(FestivalFilter.PLANNED) - R.id.chipEnd -> vm.loadFestivals(FestivalFilter.END) - } + loadFestivalsBy(checkedChipId = group.checkedChipId) + } + } + + private fun loadFestivalsBy(checkedChipId: Int) { + when (checkedChipId) { + R.id.chipProgress -> vm.loadFestivals(FestivalFilter.PROGRESS) + R.id.chipPlanned -> vm.loadFestivals(FestivalFilter.PLANNED) + R.id.chipEnd -> vm.loadFestivals(FestivalFilter.END) } }