Hello, I want to integrate Paging library in my project, in my case items of lists is able to be deleted^ but I do not know total count of it, so i need to set EnablePlaceHolders to false.
If I do it in sample project sometimes animation look like this https://drive.google.com/file/d/1l_pgyuDf6JBNPvV8Lc0NHECjpIXy9f5w/view
I added the id to text to clarify that animation is wrong: how you can see on video I have deleted 87th item, but the first visible item became 92th
Any updates on this?
I have very similar issue, but in my case list jumps few items ahead after putting next page into database.
E.g. user sees items from 20 to 25 on the screen, page size is 10. In the meantime items from 40 to 50 are downloaded and pushed to database. Then list immediately jumps that the user sees items from 30 to 35.
After debugging I found out that PagedListAdapter gets notified about weird removal operation of items 0 to 30, and then there are two inserts of 10 items at the front:
16:35:38.623: onItemRangeInserted: positionStart=40, itemCount=10
16:35:38.623: onItemRangeRemoved: positionStart=0, itemCount=30
16:35:38.665: onItemRangeInserted: positionStart=0, itemCount=10
16:35:39.212: onItemRangeInserted: positionStart=0, itemCount=10
In other words, adapter removes items from 0 to 30, and then adds again items from 10 to 30 in two batches.
EDIT:
More insights on this issue:
This problem happens only if room database gets populated with pages that are bigger than set in PagedList.Config. In my case I have PagedList.Config.setPageSize(10), and after each request from BoundaryCallback I'm inserting 10-14 elements to database. This is because I need to add some extra items (like labels to divide sections in listing).
The issue does not occur if I insert exactly the same items count to database, as page size.
Most helpful comment
Any updates on this?
I have very similar issue, but in my case list jumps few items ahead after putting next page into database.
E.g. user sees items from 20 to 25 on the screen, page size is 10. In the meantime items from 40 to 50 are downloaded and pushed to database. Then list immediately jumps that the user sees items from 30 to 35.
After debugging I found out that
PagedListAdaptergets notified about weird removal operation of items 0 to 30, and then there are two inserts of 10 items at the front:In other words, adapter removes items from 0 to 30, and then adds again items from 10 to 30 in two batches.
EDIT:
More insights on this issue:
This problem happens only if room database gets populated with pages that are bigger than set in
PagedList.Config. In my case I havePagedList.Config.setPageSize(10), and after each request fromBoundaryCallbackI'm inserting 10-14 elements to database. This is because I need to add some extra items (like labels to divide sections in listing).The issue does not occur if I insert exactly the same items count to database, as page size.