Skip to content

Commit

Permalink
#108 [FEAT] : news tab 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
Eonji-sw committed Nov 21, 2024
1 parent 05b130a commit ee75364
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,20 @@ package com.teamwable.news
import androidx.fragment.app.Fragment
import androidx.viewpager2.adapter.FragmentStateAdapter
import com.teamwable.news.match.NewsMatchFragment
import com.teamwable.news.news.NewsNewsFragment
import com.teamwable.news.notice.NewsNoticeFragment
import com.teamwable.news.rank.NewsRankFragment

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

override fun getItemCount(): Int = 2
override fun getItemCount(): Int = 4

override fun createFragment(position: Int): Fragment {
return when (position) {
0 -> NewsMatchFragment()
1 -> NewsRankFragment()
2 -> NewsNewsFragment()
3 -> NewsNoticeFragment()
else -> NewsMatchFragment()
}
}
Expand Down

0 comments on commit ee75364

Please sign in to comment.