The Paging library helps you load and display pages of data from a larger dataset from local storage or over network.The latest stable release is Paging 3.0.1
Questions tagged [android-paging-3]
324 questions
8
votes
1 answer
Clean Architecture: Cannot map PagingSource to PagingSource
My requirement is to display the notes in pages using clean architecture along with offline suppport.
I am using the Paging library for pagination. And below is the clean architectural diagram for getting notes.
Note: Please open the above image in…

Sowmia Sundararajan
- 1,613
- 2
- 14
- 17
8
votes
2 answers
Restoring Scroll Position in Paging Library 3
I am using Paging Library 3 with a RemoteMediator which includes loading data from the network and the local Room database. Every time I scroll to a certain position in the RecyclerView, navigate away to another Fragment, and then navigate back to…

Calvin Rai
- 816
- 1
- 8
- 17
8
votes
1 answer
Android Paging 3 library: how to change list with new param?
I have a search fragment that shows list of searched items.
if user type something, I pass that string to url as new query parameter and get new list using paging 3 library.
first solution is:
//viewModel
lateinit var postListUrl: String
val…

Hadi Ahmadi
- 1,924
- 2
- 17
- 38
8
votes
1 answer
Android Paging 3 doesnt show Loadstate Adapter
I have followed a tutorial to add Loadstate Adapter to the Recyclerview Adapter on Android Paging 3 but currently, it's not showing. This is how I am updating the Adapter.
lifecycleScope.launch {
viewModel.searchProducts(searchParam,…

ronnieotieno
- 134
- 2
- 11
7
votes
1 answer
Paging 3 library is not requesting my API after first usage
I'm trying to paginate my REST API with the paging 3 library, specifically with the RemoteMediator class.
What I want to achieve is that my local database is being used for the initial presentation of my UI, which gets updated reactively with a rest…

Ahmet K
- 713
- 18
- 42
7
votes
1 answer
Android Paging (3) load all pages at once
I'm using the Android Paging 3 library in my project in order to load my data page by page. In this project, I'm not using database which means I'm using network only requests. The problem is that instead of loading pages based on the user scroll,…

Shift Delete
- 1,015
- 6
- 13
6
votes
1 answer
Android. How to load paging data from specific position with Paging 3?
I'm using paging3 for showing endless list in RecyclerView. When I click in specific item I need to show detail fragment. The detail fragment contains a view pager whose adapter is also PagingDataAdapter. That is, a fragment with detailed…

testivanivan
- 967
- 13
- 36
6
votes
1 answer
Refreshing LazyPagingItems when one item state has changed
Basically I have a paging data flow collected in a composable function:
val list = state.listFlow.collectAsLazyPagingItems()
Each item on the list has a call-to-action button that will enable/disable the view and update the UI of the corresponding…

Yogi Bear
- 603
- 8
- 22
6
votes
2 answers
Android Paging 3 library PagingSource invalidation, causes the list to jump due to wrong refresh key (not using room)
Since I'm currently working on a Project with custom database (not Room), I'm testing whether we could use the Paging 3 library in the Project.
However, I run into the issue, that if you make changes to the data and therefore invalidate the paging…

MEX
- 2,664
- 5
- 22
- 28
6
votes
1 answer
How to implement PagingSource.getRefreshKey for cursor based pagination - Android Jetpack Paging 3
I am trying to implement cursor based pagination (based on GraphQL Relay spec) using Android Paging Library 3, but I don't know how to implement getRefreshKey.
This is what I've tried:
data class PagingKey(
val before: String? = null,
val…

Duncan Lukkenaer
- 12,050
- 13
- 64
- 97
6
votes
0 answers
How to observe changed items from Room with Paging 3 library in Android
I have a list of data which is loading by using PagingSource.
Here is my code in DAO:
@Query("SELECT * FROM Transport")
fun getAllTransportsPaged(): PagingSource
I am getting the paged data with a Flow with this:
Pager(config =…

Robert Levonyan
- 71
- 2
6
votes
0 answers
How to pass meta data along with paged list using Paging 3 library
I am using Android Paging 3 beta library to load the paginated list in recycler view and using MVVM architecture.
I need to pass additional meta data like the common info about the page to the view but the PagingSource.LoadResult.Page is designed in…

Sankar V
- 4,794
- 3
- 38
- 56
6
votes
1 answer
How to add separator at every n position inside recyclerview with Paging3 library?
With the help of new Paging3 library, it has made us easy to insert items/separators in a recyclerview as shown in the google android codelabs tutorial https://developer.android.com/codelabs/android-paging#11 but how to get the logic of inserting…

Pranam Baruah
- 61
- 1
- 3
5
votes
1 answer
Clean Architecture with paging3 and compose passing PagingData to domain layer
I am using clean architecture with paging 3 and trying to populate a lazyColumn.
I have the following class in my data layer module and I don't want to pass the PagingData to the domain layer as I want to keep the domain free of any Android…

ant2009
- 27,094
- 154
- 411
- 609
5
votes
0 answers
Combining 2 or more flow of Paging data
I'm making 2 parallel API calls to request for paging data. I need to combine the result of both API calls upon getting the result and submit the paging data to adapter.
viewLifecycleOwner.lifecycleScope.launchWhenStarted {
val…

Venkatesh Kashyap
- 344
- 2
- 13