Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Paging 3 #3396

Merged
merged 19 commits into from Jul 28, 2022
Merged

Conversation

veyndan
Copy link
Collaborator

@veyndan veyndan commented Jul 28, 2022

I took a lot of inspiration from Room's implementation of this class in order to implement this.

Within Cash App, I've tested it on composable-adapter-sample and this implementation no longer causes a bunch of glitches when we add or update items.

@vanniktech Because of #2913, do you mind checking if these changes fix your use case?

Copy link
Contributor

@vanniktech vanniktech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to be working really well. Tested it manually and haven't found a way to break things

veyndan and others added 4 commits July 28, 2022 18:11
…aging3/WithPagingDataDiffer.kt

Co-authored-by: Niklas Baudy <niklas.baudy@vanniktech.de>
…aging3/WithPagingDataDiffer.kt

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

@AlecKazakova AlecKazakova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MASSIVE! Thank you

@AlecKazakova AlecKazakova merged commit 5870fc6 into cashapp:master Jul 28, 2022
@vanniktech
Copy link
Contributor

Indeed, kudos to you @veyndan

@vanniktech vanniktech mentioned this pull request Jul 28, 2022
@veyndan veyndan deleted the veyndan/2022-07-19/fix-paging3 branch July 28, 2022 20:41
AlecKazakova pushed a commit that referenced this pull request Aug 5, 2022
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants