Questions tagged [android-paging-library]

189 questions
2
votes
0 answers

Paging 3 - Use Network data as primary source and local data as addition

I want to load network data first and combine it with data from my local room db. So in that way, I would always present the newest state of the backend to my users (since its always requesting the network first) and update my ui when there are some…
2
votes
0 answers

How to check if PadingData is empty in ViewModel?

I'm using Paging 3 with a Room database in my Android app. Currently, I have a sealed class which contains the Loading, Empty, Error states, and a Success state which receives the retrieved PagingData list data. In the ViewModel, I…
2
votes
0 answers

Android Paging Library 3 list jumps after first load

I'm making an application that displays a list of all GitHub users. For this I use Retrofit, Paging Library 3 + Room. Everything works well, however, after the very first data load, the list jumps to the pageSize size, this does not happen when you…
Empty
  • 23
  • 4
2
votes
1 answer

Android Paging 3 clear recyclerview on invalidate()

I have paged list to which there is a possibility to apply some filter. After user applies the filters, recyclerview should display 0 items with the loading footer until it loads the first items and fire a LoadResul.Error in case there is nothing to…
2
votes
1 answer

Paging library storing only first fetched values in room database

I have an application where i implemented paging library 3 to fetch data from api and paginate it , it works fine fetching data , the next implementation was to store the fetched data in room database , i have created the remotemediator class and…
Taki
  • 3,290
  • 1
  • 16
  • 41
2
votes
2 answers

Is there a way to implement a cursor based pagination with Paging Library 3.0 in Android?

I am consuming a rest API that uses cursor based pagination to show some results. I am wondering if I can use Paging Library 3.0 to paginate it. I have been looking through some mediums and docs and can't seem to find a way to implement it. If any…
2
votes
1 answer

Paging 3 - How to handle old APPEND RemoteMediator requests that come trough since beta01?

Since version beta01 of Paging 3, when refreshing the PagingData from a RemoteMediator, it sometimes happens that the old APPEND request from the previous generation is still executed after the refresh has completed. This seems to be expected…
2
votes
1 answer

What is the proper way to scroll to end of recyclerview in paging 3

There is a situation where I have to scroll the recyclerview to last position. The problem starts where I am using Paging 3. I don't know what is the proper way to do it every time I submit data to adapter. by the way I have to say that I do not…
2
votes
2 answers

Jetpack Paging3 RemoteMediator returns same PagingSatate on #load append

I'm following this codelab to build an paging3 app with github API and a local DB. While the first 2 pages load fine, the mediator hits a loop when trying to load the 3rd page when scrolling to bottom - the same PagingState is passed to load()…
2
votes
0 answers

Android paging2 library: Network(PageKeyedDataSource) + Database idiomatic/expected way to implement

I'm not considering Paging3 since it is still in alpha as of now, So, any suggestions on implementing this using paging 3 are definitely welcome but won't be much useful in context. From the paging 2…
Aleon Q
  • 336
  • 3
  • 8
2
votes
1 answer

How to mark end of dataset in android paging 3 library?

I am trying to use Android new Paging 3 Library in my app. I am fetching data from a backend API using Retrofit, which returns a list of objects. I need to know how to inform Pager to stop loading more data when the API returns an empty list.
2
votes
0 answers

How can I get the data from PagingData object before it is reached to ViewHolder?

I want to get the data of a PagingData object in some in-between class like ViewModel before it is reached to the Adapter and gather its property as a list. I can access the code by the flatmap but I don't want to apply any changes. Also, this…
TinaTT2
  • 366
  • 5
  • 17
2
votes
1 answer

dynamic query using android paging library

I am making a news app and I am using paging library for my news recyclerview.I want to show news based on categories.I am choosing category from dialogbox and assigning it to texview inside main activity.Here is my app.I want to observe that value…
2
votes
1 answer

Android Paging 3 Library (3.0.0-alpha03) - How to load ClosestToCurrentPosition items quickly by enabled placeholder with fastscroll bar

I'am using paging 3 library(3.0.0-alpha03), my local cache is Room(160,000 rows). How to speed up loading "ClosestToCurrentPosition" from local cache items when I use scrollbar and drag to specific position in…
kevinstyle
  • 21
  • 1
  • 3
2
votes
1 answer

Android Paging Library - Map Room DataSource.Factory<*, DatabaseModel> to DataSource.Factory<*, PresenterModel>

I use two models in my app: Database Presenter (UI) Android Paging gives me a DataSource.Factory<*, DatabaseModel> @Dao interface ProjectDao { @Query("SELECT * FROM project") fun getAllProjects(): DataSource.Factory