Questions tagged [android-paging-library]

189 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…
21
votes
1 answer

Paging3: "Not sure how to convert a Cursor to this method's return type" when using PagingSource as return type in Room DAO

I was trying to imitate Google's codelab for the new Paging 3 library, and I encountered the following error when I tried to have a Room DAO method return a…
20
votes
6 answers

How can I Unit test Paging 3(PagingSource)?

Google recently announced the new Paging 3 library, Kotlin-first library, Support for coroutines and Flow...etc. I played with the codelab they provide but it seems there's not any support yet for testing, I also checked documentation. They didn't…
MR3YY
  • 638
  • 1
  • 8
  • 18
18
votes
4 answers

How to update single item using Paging 3 library

I am trying to find a way to update single item in recycler view using PagingAdapter from Paging 3 library. I have found only one way with PagingAdapter.refresh() method. But this method force to load all list from network. Does anybody know how to…
14
votes
1 answer

How to implement paging in Leanback VerticalGridSupportFragment using Paging Library?

We are trying to implement paging in Leanback VerticalGridSupportFragment with Architecture Components Paging Library. Leanback on it's own doesn't have any sort of out-of-box compatibility with Paging Library so we extended it's ObjectAdapter class…
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…
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…
11
votes
4 answers

Paging 3 initial loading not shown

I am working with paging 3, everything work fine except initial loading state. I am adding withLoadStateFooter but it never show loading state at first call Here is my implementation Load State Adapter class LoadStateAdapter ( private val retry:…
ysfcyln
  • 2,857
  • 6
  • 34
  • 61
11
votes
0 answers

Paging Library Callback.OnResult Not Returning Value To Livedata

I wanna to implement jetpack paging library. everything seems working, after getting response from api (using Retrofit2 and coroutine) android paging callback is calling his onResult interface. but it's not returning it's value to livedata in main…
11
votes
5 answers

How to clear/remove all items in page list adapter

I'm using the android paging library to show search result items, is there any way I can clear/remove all the loaded result items, Calling Invalidate on live Paged List refreshing the list not clear/remove items In Activity: fun…
Sam
  • 6,215
  • 9
  • 71
  • 90
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…
10
votes
2 answers

How to check the list size or for empty list in Paging 3 library

I've been able to successfully implement the new alpha07 version of Paging 3 library by following the instructions available here: https://developer.android.com/topic/libraries/architecture/paging/v3-paged-data#guava-livedata However, now I am in…
Shadow
  • 4,168
  • 5
  • 41
  • 72
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…
10
votes
2 answers

How can we get entire object list passes to the PagingDataAdapter while using Paging library 3.0?

I am new to the paging library 3.0, I need to paginate data only from the local database. Initially, I fetched PagingSource from the database and use it as flow. fun getChatMessages(chatWrapper: ChatWrapper):…
Anil Bhomi
  • 691
  • 7
  • 12
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…
1
2 3
12 13