pnkj
pnkj

Reputation: 498

what's the meaning of the PREPEND status in paging3?

I have seen the demo given in google github. But it just retuen with MediatorResult.Success(endOfPaginationReached = true)

while, if it change it to MediatorResult.Success(endOfPaginationReached = false),my code also runing sussessfully.

so, i want to know what's the detail meaning of PREPEND?

the reason why I ask this question is when meeting the network error in refresing,and there is nothing in my Room,the Paging3 won't given any tip.(Though I can solve it by add a error tip view in mainView,I think it is inelegant.)

Upvotes: 0

Views: 504

Answers (1)

EpicPandaForce
EpicPandaForce

Reputation: 81588

PREPEND is for non-positional data sources that allow dropping pages. So if you are on page 5, you dropped page 3 and before, then you scroll up and the boundary will load page 3 that had previously been dropped. It allows you to reinitialize from the middle of a paging source, rather than be forced to be at the beginning (see initialKey parameter).

Upvotes: 1

Related Questions