Android. How to load paging data from specific position with Paging 3?
Asked Answered
L

1

8

I'm using paging3 for showing endless list in RecyclerView. When I click in specific item I need to show detail fragment. The detail fragment contains a view pager whose adapter is also PagingDataAdapter. That is, a fragment with detailed information should show the element that I selected on the previous screen and it is also possible to scroll horizontally to other elements that are also loaded page by page. The problem is that I can't start displaying the paging list in my view pager from a certain position. The list is always displayed from the beginning. I can't found solution for this. Is it possible to start listening to data from Page Source (RemoteMediator) beginning from specific position ? Please, help me:(

Lippizaner answered 27/5, 2022 at 18:43 Comment(0)
G
1

you can find the LimitOffsetPagingSource and check the getRefreshKey. i guess the getRefreshKey return a wrong key by PagingState.anchorPosition because you set a Pager.initialKey

Gyimah answered 6/7, 2022 at 1:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.