|
|
|
|
@ -14,17 +14,13 @@ import net.pokeranalytics.android.ui.viewmodel.ReportHolder |
|
|
|
|
* Home Adapter |
|
|
|
|
*/ |
|
|
|
|
class ReportPagerAdapter(private val context: Context, |
|
|
|
|
val fragmentManager: FragmentManager, |
|
|
|
|
private val reportHolder: ReportHolder) : FragmentPagerAdapter(fragmentManager) { |
|
|
|
|
fragmentManager: FragmentManager, |
|
|
|
|
private val reportHolder: ReportHolder) : FragmentPagerAdapter(fragmentManager, BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT) { |
|
|
|
|
|
|
|
|
|
override fun getItem(position: Int): BaseFragment { |
|
|
|
|
return when (position) { |
|
|
|
|
0 -> { |
|
|
|
|
GraphFragment.newInstance(style = GraphFragment.Style.BAR) |
|
|
|
|
} |
|
|
|
|
1 -> { |
|
|
|
|
GraphFragment.newInstance(style = GraphFragment.Style.MULTILINE) |
|
|
|
|
} |
|
|
|
|
0 -> GraphFragment.newInstance(style = GraphFragment.Style.BAR) |
|
|
|
|
1 -> GraphFragment.newInstance(style = GraphFragment.Style.MULTILINE) |
|
|
|
|
2 -> { |
|
|
|
|
val report = this.reportHolder.report |
|
|
|
|
ComposableTableReportFragment.newInstance(report) |
|
|
|
|
|