summaryrefslogtreecommitdiff
path: root/android/arch/paging/KeyedDataSource.java
diff options
context:
space:
mode:
Diffstat (limited to 'android/arch/paging/KeyedDataSource.java')
-rw-r--r--android/arch/paging/KeyedDataSource.java15
1 files changed, 5 insertions, 10 deletions
diff --git a/android/arch/paging/KeyedDataSource.java b/android/arch/paging/KeyedDataSource.java
index 0d452946..8cf6829c 100644
--- a/android/arch/paging/KeyedDataSource.java
+++ b/android/arch/paging/KeyedDataSource.java
@@ -103,6 +103,10 @@ import java.util.List;
* @param <Value> Type of items being loaded by the DataSource.
*/
public abstract class KeyedDataSource<Key, Value> extends ContiguousDataSource<Key, Value> {
+ @Override
+ public final int countItems() {
+ return 0; // method not called, can't be overridden
+ }
@Nullable
@Override
@@ -114,14 +118,7 @@ public abstract class KeyedDataSource<Key, Value> extends ContiguousDataSource<K
@Override
List<Value> loadBeforeImpl(
int currentBeginIndex, @NonNull Value currentBeginItem, int pageSize) {
- List<Value> list = loadBefore(getKey(currentBeginItem), pageSize);
-
- if (list != null && list.size() > 1) {
- // TODO: move out of keyed entirely, into the DB DataSource.
- list = new ArrayList<>(list);
- Collections.reverse(list);
- }
- return list;
+ return loadBefore(getKey(currentBeginItem), pageSize);
}
@Nullable
@@ -194,8 +191,6 @@ public abstract class KeyedDataSource<Key, Value> extends ContiguousDataSource<K
/** @hide */
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
- @WorkerThread
- @Override
public NullPaddedList<Value> loadInitial(
@Nullable Key key, int initialLoadSize, boolean enablePlaceholders) {
if (isInvalid()) {