Skip to content

Commit

Permalink
#108 [MOD] : tab type 리팩토링
Browse files Browse the repository at this point in the history
  • Loading branch information
Eonji-sw committed Nov 22, 2024
1 parent cb4ef56 commit 266ab65
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ import com.teamwable.news.rank.NewsRankFragment

class NewsViewPagerAdapter(fragment: Fragment) : FragmentStateAdapter(fragment) {

override fun getItemCount(): Int = 4
override fun getItemCount(): Int = NewsTabType.entries.size

override fun createFragment(position: Int): Fragment {
return when (position) {
0 -> NewsMatchFragment()
1 -> NewsRankFragment()
2 -> NewsNewsFragment()
3 -> NewsNoticeFragment()
NewsTabType.MATCH.idx -> NewsMatchFragment()
NewsTabType.RANK.idx -> NewsRankFragment()
NewsTabType.NEWS.idx -> NewsNewsFragment()
NewsTabType.NOTICE.idx -> NewsNoticeFragment()
else -> NewsMatchFragment()
}
}
Expand Down

0 comments on commit 266ab65

Please sign in to comment.