Bimba.git

ref: v3.1.1

app/src/main/java/xyz/apiote/bimba/czwek/search/ui/SectionsPagerAdapter.kt


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
package xyz.apiote.bimba.czwek.search.ui

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentPagerAdapter
import xyz.apiote.bimba.czwek.repo.Line

class SectionsPagerAdapter(fm: FragmentManager, val line: Line) :
	FragmentPagerAdapter(fm, BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT) {

	override fun getItem(position: Int): Fragment {
		return LineGraphFragment.newInstance(line.graphs[position], line.name, line.feedID)
	}

	override fun getPageTitle(position: Int): CharSequence {
		return line.headsigns[position].joinToString()
	}

	override fun getCount(): Int {
		return 2
	}
}