Entire data from the DB is getting loaded into pagedlist. Is it not honoring the page size in Monarchy?
ksyamkrishnan opened this issue · 2 comments
Entire data from the DB is getting loaded into pagedlist. Is it not honoring the page size in Monarchy?
`public List loadRange(final int startPosition, final int count) {
final int countItems = countItems();
if(countItems == 0) {
return Collections.emptyList();
}
final List list = new ArrayList<>(count);
monarchy.doWithRealm(new Monarchy.RealmBlock() {
@OverRide
public void doWithRealm(Realm realm) {
RealmResults results = (RealmResults)
monarchy.resultsRefs.get().get(liveResults);
for(int i = startPosition; i < startPosition + count && i < countItems; i++) {
// noinspection ConstantConditions
list.add(realm.copyFromRealm(results.get(i)));
}
}
});
return Collections.unmodifiableList(list);
}`
Hmm? What do you mean? It definitely shouldn't be loading ALL items at once.
It should be loading a page amount, as it is read from Realm with that for {
loop.
ok. I was not setting the value for InitialLoadSizeHint. Because of that, it was taking the first 3 pages by default.