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
22
votes
3 answers
Android Paging 3 - experiencing flickers, glitches or jumps in position when scrolling & loading new pages
Hello Guys im using Android Jetpack Paging library 3, I'm creating a news app that implements network + database scenario, and im following the codelab by google https://codelabs.developers.google.com/codelabs/android-paging , im doing it almost…

Moonshine
- 219
- 3
- 7
18
votes
4 answers
How to use jetpack compose paging with LazyVerticalGrid
I am trying to display paged items using LazyVerticalGrid. The code I am trying is shown below.
val categories = repo.categories.collectAsLazyPagingItems()
LazyVerticalGrid(
cells = GridCells.Fixed(2),
modifier = Modifier.padding(8.dp)
)…

Olu Udeh
- 1,031
- 1
- 10
- 20
17
votes
2 answers
Understanding PagingSource's getRefreshKey
I migrated from Paging 2 to Paging 3 library and now I use the PagingSource to load pages of data from the server. But I have trouble understanding the getRefreshKey method that has to be overriden there. I found some code samples how to implement…

baltekg
- 985
- 9
- 31
17
votes
1 answer
Android MVI using StateFlow and paging 3
I am trying to implement android MVI architecture using state flow and paging 3 but I got confused when I had a view state which contains paging data.
The problem is that I expose the view state from view model as a state flow object, but now inside…

Mutasem Haj Hasan
- 326
- 2
- 11
14
votes
1 answer
Clear `PagingDataAdapter` between refresh calls
I am using the Paging 3 PagingDataAdapter to search the database based on the given query.
Every time a new query is submitted, i call the refresh() method on the adapter. The problem is that until the new data is loaded, the old one is still…

baltekg
- 985
- 9
- 31
11
votes
4 answers
Refresh in paging 3 library when using RxJava
homeViewModel.pagingDataFlow.subscribe(expensesPagingData -> {
expenseAdapter.submitData(getLifecycle(), expensesPagingData);
}, throwable -> Log.e(TAG, "onCreate: " + throwable.getMessage()));
// ViewModel
private…

developer
- 189
- 2
- 6
11
votes
6 answers
Paging 3 - How to scroll to top of RecyclerView after PagingDataAdapter has finished refreshing AND DiffUtil has finished diffing?
I'm using Paging 3 with RemoteMediator that shows cached data while fetching new data from the network.
When I refresh my PagingDataAdapter (by calling refresh() on it) I want my RecyclerView to scroll to the top after the refresh is done. In the…

Florian Walther
- 6,237
- 5
- 46
- 104
10
votes
2 answers
Android Paging 3 how to filter, sort and search my data
I'm trying to implement paging I'm using Room and it took me ages to realize that its all done for me but what I need to do is be able to filter search and sort my data. I want to keep it as LiveData for now I can swap to flow later.
I had this…

martinseal1987
- 1,862
- 8
- 44
- 77
10
votes
2 answers
Update Current Page or Update Data in Paging 3 library Android Kotlin
I am new in Paging 3 library in android kotlin. I want unlimited data. So I found Paging 3 library is helpful in my case. I used PagingSource to create a list. I am not using Room. I have nested recyclerView. I am using PagingDataAdapter with diff…

Kotlin Learner
- 3,995
- 6
- 47
- 127
10
votes
3 answers
How to show empty view with Paging 3 library in Android
I want to show empty view when paging3 is loaded with an empty list.
It seems to work with following code. Is this the proper way to do with the paging 3 library?:
adapter?.addLoadStateListener { loadState ->
adapter?.apply {
…

Eric Cen
- 3,616
- 1
- 13
- 17
10
votes
1 answer
Android Jetpack Paging 3: PagingSource with Room
I'm using latest Jetpack libraries.
Pagination3 version: 3.0.0-alpha05
Room Version : 2.3.0-alpha02
My entities have Long as PrimaryKey and Room can generate PagingSource for other than Int type.
error: For now, Room only supports PagingSource with…

Ioane Sharvadze
- 2,118
- 21
- 35
9
votes
4 answers
Footer not showing with Paging 3
I'm following the Codelab of Paging 3.
The paging is working fine, but trying to add a Footer does not seem to work.
My code is exactly like the Codelab one when it comes to LoadStateAdapter used
class ListLoadStateAdapter(
private val retry: ()…

A-Android UCG
- 797
- 1
- 7
- 23
9
votes
3 answers
Android Paging 3: LoadType.APPEND returns null remote keys
I've been trying to work out how to fix my issue with RemoteMediator's APPEND LoadType.
On an empty Room DB, here's how the LoadType flows:
REFRESH -> PREPEND -> APPEND (remoteKeys = null, endOfPaginationReached = true)
With at least 10 rows for…

Jim Ovejera
- 739
- 6
- 10
9
votes
4 answers
Android: LoadStateAdapter not centered inside recyclerview gridlayout
My current problem is, that my LoadStateAdapter which shows the loading and error state, is not centered inside my recyclerview, which has a gridlayout as a layoutmanager. I didn't find anything about this at the official android developer website,…

Andrew
- 4,264
- 1
- 21
- 65
8
votes
0 answers
Paging3 how to remove item in compose
I have a lazyColumn to use paging3 ,
My datas from network and need to use the list count to ask server get next datas
but now i need to remove some special item ,how can remove it ,i already to use PagingSource.invalidate to referesh my lazyColumn

fy y
- 81
- 2