Questions tagged [android-paging-library]

189 questions
4
votes
0 answers

Limiting the number of loaded items in memory with paging library

I'm using paging library to load and display the data from server: dataFactory = DataSourceFactory() val config = PagedList.Config.Builder() .setPageSize(25) .setInitialLoadSizeHint(25 * 2) .setEnablePlaceholders(false) …
4
votes
1 answer

Android Paging Library - Updating the data on the current Page

I'm using Android Jetpack's new Paging library to display a list of items received from the API. I want the data on the current page(say page 3) to be refreshed every few minutes without refreshing the whole list with invalidate() function, as this…
4
votes
2 answers

Can you use paging library and PagedList with a ViewPager?

I'd like to use a ViewPager with paging library and PagedList. Is there a way to do this? If yes then what adapter should I use? Right now I use FragmentStatePagerAdapter with a full list of items. I'd like to load pages of items on demand instead…
4
votes
1 answer

Repository pattern with paging library

I have a problem when apply Paging Library to my project which is using (Repository Pattern) In my repository, I already have UsersDataSource, UsersRepository, UserLocalDataSource, UserRemoteDataSource To use Paging Library, I see we need to create…
Linh
  • 57,942
  • 23
  • 262
  • 279
3
votes
1 answer

How to handle result of paging data in compose and implement header and footer load states?

In View system there are official examples how to implement loading states and adding header and footer item to the…
3
votes
0 answers

Android Paging 3 : How to refresh whole data in the paging 3 and after update first item should be visible

I have following scenario: When I launched the activity I need to load some data. The activity has refresh button which will load new data from the network. This will be a new list of data which will not match to the initial list. Now suppose user…
3
votes
1 answer

Android Paging 3: How to change parameters of RemoteMediator

I am struggling with the Paging 3 Library of Jetpack. I setup Retrofit for the network API calls Room to store the retrieved data A repository that exposes the Pager.flow (see code below) A RemoteMediator to cache the network results in the room…
3
votes
2 answers

getting runtime error when updating paging library from 3.0.0-alpha10 to 3.0.0-alpha12

i created my pagingSource class with paging 3.0.0-alpha10 and it worked but when i changed the version to 3.0.0-alpha12, i got this error this is the runtime exception: java.lang.AbstractMethodError: abstract method "java.lang.Object…
nima
  • 55
  • 1
  • 9
3
votes
0 answers

Paging 3 - Does Room drop pages even if maxSize is MAX_SIZE_UNBOUNDED?

I'm using Paging 3 with Room and RemoteMediator. I haven't set a maxSize in the PagingConfig which means that we shouldn't drop pages no matter how far we scroll. fun getSearchResults(query: String): Flow> = Pager( …
3
votes
1 answer

Android Paging 3 library - for paging data from Room database, flow becomes empty on data change

I am trying to use android Paging 3 (version 3.0.0-SNAPSHOT) for paging data from Room database(no remote data source). Initially the page loads data successfully , but when a new "Entry" is added to database and I return to this page,collectLatest…
Nabzi
  • 1,823
  • 1
  • 16
  • 26
3
votes
1 answer

Detecting the empty PagedList result in Android

I am using the Paging library from Android Jetpack to have a paged loading behavior in my RecyclerView. Now I want a simple thing - get a signal in my UI that there is no data and the list is empty, so that I can show a message like "there are no…
3
votes
1 answer

PagedListAdapter reload data without placeholders

I am using a PagedListAdapter and have to reload data when the screen is resumed. For this case, I don't want to clear the adapter and show it empty or placeholders while the data is being loaded. I want to show the previous data and just update it…
Leo DroidCoder
  • 14,527
  • 4
  • 62
  • 54
3
votes
0 answers

Handling Error In Paging Library with Mvvm Approach

im just start using paging library and code just work fine but i got no idea how to handle error like progress bar and Toast a error message, so there my code this is repo public class SearchRepository extends PageKeyedDataSource
M.G.
  • 33
  • 6
3
votes
1 answer

PagedListAdapter fetching all the items when recycler view is placed inside nestedscrollview

I am using a NestedScrollView and inside that, I am having some edit text and buttons and then a RecyclerView. When I open the activity all the items start fetching from the server using the PageKeyedDataSource and the RecyclerView scrolls very…
3
votes
1 answer

Paging Library Custom DataSource never triggers loadBefore

I'm trying to implement a chat app with Paging Library, but my DataSource never triggers loadBefore and loadAfter, but triggers loadInitial and I can show the initial data in my RecyclerView. I'm using Room too. I have searched for some tutorials,…
Pedro Ruiz
  • 41
  • 3