Skip to content

Commit

Permalink
Fix Paging 3 (#3396)
Browse files Browse the repository at this point in the history
* Copy-paste Room LimitOffsetPagingSource.kt and associated files

https://github.com/androidx/androidx/tree/androidx-main/room/room-paging/src/main/java/androidx/room/paging

* Don't limit to library scope

* Remove unnecessary constructor

* Remove unused argument

* Remove usages of getQueryDispatcher

* Remove usages of androidx.room.withTransaction

* Remove usage of app.cash.sqldelight.paging3.util.queryItemCount

* Rename Value to RowType to align with SQLDelight

* Pass in a QueryProvider and then remove all fluff

* Put queryDatabase within LimitOffsetPagingSource

* Use QueryPagingSource as the invalidater

* Simplify

* Copy-paste tests from AndroidX

* Fix test compilation

* Spotless

* Update extensions/android-paging3/src/test/java/app/cash/sqldelight/paging3/WithPagingDataDiffer.kt

Co-authored-by: Niklas Baudy <niklas.baudy@vanniktech.de>

* Update extensions/android-paging3/src/test/java/app/cash/sqldelight/paging3/WithPagingDataDiffer.kt

Co-authored-by: Niklas Baudy <niklas.baudy@vanniktech.de>

* Apply suggestions from code review

Co-authored-by: Niklas Baudy <niklas.baudy@vanniktech.de>

* Make the artifact a JVM one again

Co-authored-by: Niklas Baudy <niklas.baudy@vanniktech.de>
  • Loading branch information
2 people authored and AlecKazakova committed Aug 5, 2022
1 parent 7bb7c75 commit 181e4a0
Show file tree
Hide file tree
Showing 7 changed files with 827 additions and 312 deletions.
26 changes: 26 additions & 0 deletions extensions/android-paging3/android-test/build.gradle
@@ -0,0 +1,26 @@
plugins {
alias(deps.plugins.android.library)
alias(deps.plugins.kotlin.android)
}

android {
namespace 'app.cash.sqldelight.paging3'
compileSdk deps.versions.compileSdk.get() as int
}

dependencies {
testImplementation project(':drivers:sqlite-driver')
testImplementation project(':extensions:android-paging3')
testImplementation deps.androidx.paging3.runtime
testImplementation deps.androidx.recyclerView
testImplementation deps.truth
testImplementation deps.kotlin.test.junit
testImplementation deps.kotlin.coroutines.test
}

// workaround for https://youtrack.jetbrains.com/issue/KT-27059
configurations.all {
resolutionStrategy.dependencySubstitution {
substitute module("${project.property("GROUP")}:runtime-jvm:${project.property("VERSION_NAME")}") with project(':runtime')
}
}

0 comments on commit 181e4a0

Please sign in to comment.