Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Provider for PagedList with Kitsu items
object KitsuMediaPagedListProvider {
private val dataSource = object: KitsuLimitOffsetNetworkDataSource<KitsuItem>(KitsuRestApi) {
override fun convertToItems(items: KitsuResponse, size: Int): List<KitsuItem> {
return List(size, { index ->, { KitsuItem(0, null, null) })
fun allKitsu(): LivePagedListProvider<Int, KitsuItem> {
return object : LivePagedListProvider<Int, KitsuItem>() {
override fun createDataSource(): KitsuLimitOffsetNetworkDataSource<KitsuItem> = dataSource
fun setQueryFilter(queryFilter: String) {
dataSource.queryFilter = queryFilter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.