Questions tagged [android-paging-3]

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

324 questions
1
vote
1 answer

Android. Pagging3 not receive error state

I'm using paging3. My RemoteMediator returns Result.Error from catch: catch (e: Exception) { return MediatorResult.Error(handler.getError(e)) } Inside fragment I'm listening for state changes: adapter.addLoadStateListener {…
1
vote
3 answers

In Jetpack Compose, how do I specifically handle errors in paging3 and display them on ui?

In my case, I'm requesting a GitHub API, if I request a lot of data, I might get a 403 error, while if I run out of requested data, GitHub will return me a 422 Unprocessable Entity. So I want to prompt the user on the UI based on this whether it is…
1
vote
1 answer

Classifier 'Error' does not have a companion object, and thus must be initialized here

I am trying to add LoadStateListener. But I am getting the error "Classifier 'Error' does not have a companion object, and thus must be initialized here" for LoadState.Error . Below is the code snippet. adapter.addLoadStateListener { loadStates -> …
DroidBee
  • 75
  • 1
  • 12
1
vote
0 answers

How does Paging 3.0 data caching differ from caching data from network in the Room database?

As far as I know, one of the uses of Paging3 is to cache the data from the xxxPagingSource. Does it mean I don't have to cache my network calls anymore? In-memory caching for your paged data. This ensures that your app uses system resources…
JustAnEuropean
  • 188
  • 1
  • 11
1
vote
0 answers

FirestorePagingAdapter crashes when scrolling in version 8.0.1

After updating FirebaseUi from implementation 'com.firebaseui:firebase-ui-firestore:8.0.0' to implementation 'com.firebaseui:firebase-ui-firestore:8.0.1' FirestorePagingAdapter crashes when I scroll the RecyclerView. I think it always crashes at the…
1
vote
1 answer

Android Paging 3 is not loading next page

After migrating from custom paging implementation to Jetpack Paging 3 library, data is not loading as expected. The first page is handled correctly according to the PagingConfig of Pager: internal fun createProductListPager(pagingSource:…
Nico
  • 2,570
  • 1
  • 9
  • 17
1
vote
0 answers

How to Refresh the Recyclerive List Items UI Paging 3

The problem is that whenever I call adapter.refresh(), new items are added but the previous item's UI is not refreshed.basically a button showing in list item ,by click on that button doing something in another activity when i return back it should…
1
vote
0 answers

Room & Paging: How to use multimap approach?

With Room 2.4 we got the multimap feature which should according to the documentation prefered over intermediate data classes. In my project I couldn't get this to work in combination with the paging library. Example: @Dao interface DemoDao { …
chrgue
  • 579
  • 1
  • 6
  • 18
1
vote
1 answer

PagingDataAdapter class not executed after called adapter.submitData method

i want to try Paging 3 in my android apps. It successed until i get my PagingData<*> list from class PagingDataSource. but every time i called adapter.submitData(it), my adapter class not execute. Please help, where is my mistake? Thank you so…
mpa__
  • 33
  • 4
1
vote
1 answer

androidx.paging.LoadState$NotLoading cannot be cast to androidx.paging.LoadState$Error | PagingCompose

Event Handler pagingFLow.apply { when { loadState.refresh is LoadState.Loading -> {} loadState.refresh is LoadState.NotLoading -> {} loadState.append is LoadState.Loading -> { item {…
1
vote
1 answer

Can't understand code of getRefreshKey in Android paging3 codelab

// GitHub page API is 1 based: https://developer.github.com/v3/#pagination private const val GITHUB_STARTING_PAGE_INDEX = 1 class GithubPagingSource( private val service: GithubService, private val query: String ) :…
Isaac
  • 11
  • 3
1
vote
1 answer

Map Flow of PagingData to another model

I have created a gallery app for learning. Images are fetched from different source like Pixabay, Unsplash, Imgur etc. I want to map each paging result to my own data called PhotoBO I am using Clean architecture, Suggest me better approach to…
1
vote
0 answers

Get another data from PagingDataSource

I am building a movie app and I just finish implementing Paging. Right now I can only get the popular movies from the PagingDataSource and my question is how can I get another set of data, for example: upcomming movies. Do I need to create another…
HoLoGram
  • 167
  • 10
1
vote
1 answer

Multiple times list item populated in recycler-view, when using Paging v3

I have implemented android-paging v3 following https://proandroiddev.com/paging-3-easier-way-to-pagination-part-1-584cad1f4f61 & https://proandroiddev.com/how-to-use-the-paging-3-library-in-android-part-2-e2011070a37d. But I see the data is…
1
vote
1 answer

Android Paging 3 - get list of data from PagingData object in Jetpack Compose

I have the same question as asked in this StackOverflow question, but for Jetpack Compose. How can we get a list of items in Jetpack Compose when you're using Paging3 with LazyVerticalGrid, As using LazyVerticalGrid, we don't create any…