Closed fcat97 closed 2 years ago
@fcat97 Thanks. Is it possible that trxItems.itemCount
returns the total amount of items and not the ones that are just loaded? The ObjectBoxDataSource
implementation has not changed, so I'm not sure how that could be the issue.
Regardless, there is no DataSource written for Paging 3, yet.
Thanks. I missed the internal documentation.
// ---------------------
// LazyPageItems.Kt
// ---------------------
/**
* The number of items which can be accessed.
*/
val itemCount: Int get() = itemSnapshotList.size
// ---------------------
// ItemSnapshotList.kt
// ---------------------
/**
* Size of ItemSnapshotList including placeholders.
* To get the size excluding placeholders, use List.size on items directly.
*/
public override val size: Int
get() = placeholdersBefore + items.size + placeholdersAfter
Instead of trxItems.itemCount
I need to call trxItems.itemSnapshotList.items.size
. It shows the actual loaded items, at first it loads 300 items and then loads according to pageSize
.
Getting all the elements from database at once just like normal query.
ObjectBox
implementation ofPagingDataSource
completely ignoresPageConfig.pageSize
value.The documentation is outdated. Besides it only describes how to add
Paging2
with ObjectBox.Basic info:
Code
}
}