Skip to content
This repository was archived by the owner on Jan 10, 2025. It is now read-only.

Update paging sample to alpha13 #958

Merged
merged 8 commits into from
Feb 9, 2021
Merged

Conversation

dlam
Copy link
Contributor

@dlam dlam commented Feb 5, 2021

  • Cleanup with viewbinding
  • Bumping to alpha13 with getRefreshKey implementations

Resolves: #942
Resolves: #571

@dlam dlam requested a review from ChrisCraik February 8, 2021 17:22
assertEquals(
expected = Page(
data = listOf(fakePosts[0]),
prevKey = fakePosts[0].name,
Copy link
Contributor

Choose a reason for hiding this comment

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

if key is null, why isn't prevKey == null?

do we need to query remote to know there aren't any items before?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's due to how our ItemKeyedPagingSource sample is implemented. It essentially loads until its empty.

prevKey = items.firstOrNull()?.name,
nextKey = items.lastOrNull()?.name

@dlam dlam merged commit c908c69 into android:main Feb 9, 2021
@dlam dlam deleted the dlam/update-paging branch February 9, 2021 02:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No way to test PagingSource in the Paging samples PagingWithNetwork - RedditActivityTest{DB} is flaky
2 participants