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

Add paging helper #7

Merged
merged 2 commits into from
Jun 21, 2023
Merged

Add paging helper #7

merged 2 commits into from
Jun 21, 2023

Conversation

StaehliJ
Copy link
Contributor

Description

Add androidx.paging v3 library helper to handle integration layer content with pagination.

There is two use cases

  1. Requesting a amount of content with a list of urns that exceed the integration layer page limit (50)
  2. Requesting a result with a nextUrl

Both are supported with

  1. UrnsPagingSource
  2. NexturlPagingSource

Recommended

We recommend to use DataProviderPaging that simplify the usage and retrieve directly the content needed with PagingDataAdapter.

Usage

val dataProvider = DataProviderPaging(...)
val pagingAdapter = PagingDataAdapter(...)

dataProvider.getMediaRecommendedByUrn(urn, pageSize = 15).collectLatest { pagingData ->
    pagingAdapter.submitData(pagingData)
}

@StaehliJ StaehliJ added the enhancement New feature or request label Jun 21, 2023
@StaehliJ StaehliJ requested a review from Loic-Dumas June 21, 2023 13:33
@StaehliJ StaehliJ added this pull request to the merge queue Jun 21, 2023
Merged via the queue into main with commit 301bc0e Jun 21, 2023
@StaehliJ StaehliJ deleted the paging-support branch June 21, 2023 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant