Use custom QueryPagingSource (#7321)

* Use custom QueryPagingSource

- Adds placeholder to make the list jump around less
- Fixes issue where SQLDelight QueryPagingSource would throw IndexOutOfBounds

* Review Changes
This commit is contained in:
Andreas
2022-06-18 20:55:58 +02:00
committed by GitHub
parent 4c3af7bf36
commit 3fd9e021fa
9 changed files with 301 additions and 119 deletions
@@ -2,7 +2,6 @@ package eu.kanade.data
import androidx.paging.PagingSource
import com.squareup.sqldelight.Query
import com.squareup.sqldelight.Transacter
import eu.kanade.tachiyomi.Database
import kotlinx.coroutines.flow.Flow
@@ -33,7 +32,6 @@ interface DatabaseHandler {
fun <T : Any> subscribeToPagingSource(
countQuery: Database.() -> Query<Long>,
transacter: Database.() -> Transacter,
queryProvider: Database.(Long, Long) -> Query<T>,
): PagingSource<Long, T>
}