diff --git a/android/festago/presentation/src/main/java/com/festago/festago/presentation/ui/home/festivallist/FestivalListFragment.kt b/android/festago/presentation/src/main/java/com/festago/festago/presentation/ui/home/festivallist/FestivalListFragment.kt index 2743742e3..a52791d3f 100644 --- a/android/festago/presentation/src/main/java/com/festago/festago/presentation/ui/home/festivallist/FestivalListFragment.kt +++ b/android/festago/presentation/src/main/java/com/festago/festago/presentation/ui/home/festivallist/FestivalListFragment.kt @@ -16,7 +16,9 @@ import com.festago.festago.presentation.ui.home.festivallist.festival.FestivalLi import com.festago.festago.presentation.ui.home.festivallist.uistate.FestivalListUiState import com.festago.festago.presentation.ui.home.festivallist.uistate.FestivalTabUiState import com.festago.festago.presentation.util.repeatOnStarted +import dagger.hilt.android.AndroidEntryPoint +@AndroidEntryPoint class FestivalListFragment : Fragment() { private var _binding: FragmentFestivalListBinding? = null @@ -53,7 +55,7 @@ class FestivalListFragment : Fragment() { private fun initView() { initViewPager() - vm.loadPopularFestival() + vm.loadFestivals() initRecyclerView() } @@ -103,7 +105,7 @@ class FestivalListFragment : Fragment() { { Toast.makeText(requireContext(), "Clicked $it", Toast.LENGTH_SHORT).show() /* TODO: Handle tab click */ - vm.loadPopularFestival() + vm.loadFestivals() }, ), ) + uiState.festivals, diff --git a/android/festago/presentation/src/main/java/com/festago/festago/presentation/ui/home/festivallist/festival/FestivalListAdapter.kt b/android/festago/presentation/src/main/java/com/festago/festago/presentation/ui/home/festivallist/festival/FestivalListAdapter.kt index 02a798db8..21a8895f6 100644 --- a/android/festago/presentation/src/main/java/com/festago/festago/presentation/ui/home/festivallist/festival/FestivalListAdapter.kt +++ b/android/festago/presentation/src/main/java/com/festago/festago/presentation/ui/home/festivallist/festival/FestivalListAdapter.kt @@ -21,7 +21,7 @@ class FestivalListAdapter : ListAdapter(diffUtil) { override fun onBindViewHolder(holder: FestivalListViewHolder, position: Int) { val item = getItem(position) return when (holder) { - is FestivalListPopularViewHolder -> holder.bind((item as FestivalListUiState.Success).festivals) + is FestivalListPopularViewHolder -> holder.bind((item as FestivalListUiState.Success).popularFestivals) is FestivalListFestivalViewHolder -> holder.bind(item as FestivalItemUiState) is FestivalListTabViewHolder -> holder.bind(item as FestivalTabUiState) } diff --git a/android/festago/presentation/src/main/java/com/festago/festago/presentation/ui/home/festivallist/festival/FestivalListPopularViewHolder.kt b/android/festago/presentation/src/main/java/com/festago/festago/presentation/ui/home/festivallist/festival/FestivalListPopularViewHolder.kt index 0d68b62f9..919782c05 100644 --- a/android/festago/presentation/src/main/java/com/festago/festago/presentation/ui/home/festivallist/festival/FestivalListPopularViewHolder.kt +++ b/android/festago/presentation/src/main/java/com/festago/festago/presentation/ui/home/festivallist/festival/FestivalListPopularViewHolder.kt @@ -5,7 +5,6 @@ import android.view.ViewGroup import com.festago.festago.presentation.databinding.ItemFestivalListPopularBinding import com.festago.festago.presentation.ui.home.festivallist.popularfestival.PopularFestivalViewPagerAdapter import com.festago.festago.presentation.ui.home.festivallist.uistate.FestivalItemUiState -import com.festago.festago.presentation.ui.home.festivallist.uistate.FestivalListUiState import com.google.android.material.tabs.TabLayoutMediator class FestivalListPopularViewHolder(val binding: ItemFestivalListPopularBinding) : @@ -25,10 +24,6 @@ class FestivalListPopularViewHolder(val binding: ItemFestivalListPopularBinding) fun bind(festivals: List) { popularFestivalViewPager.submitList(festivals) - binding.uiState = FestivalListUiState.Success( - popularFestivals = festivals, - festivals = festivals, - ) } companion object { diff --git a/android/festago/presentation/src/main/res/layout/item_festival_list_popular.xml b/android/festago/presentation/src/main/res/layout/item_festival_list_popular.xml index af8dadda1..fc9364c08 100644 --- a/android/festago/presentation/src/main/res/layout/item_festival_list_popular.xml +++ b/android/festago/presentation/src/main/res/layout/item_festival_list_popular.xml @@ -2,15 +2,7 @@ - - - - - @@ -20,7 +12,7 @@ android:layout_height="0dp" android:layout_marginBottom="-8dp" app:layout_constraintBottom_toBottomOf="@id/tlDotIndicator" - app:layout_constraintTop_toTopOf="parent"/> + app:layout_constraintTop_toTopOf="parent" />