aboutsummaryrefslogtreecommitdiff
path: root/app/src
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2021-09-16 11:25:58 +0000
committerAlex Ning <chineseperson5@gmail.com>2021-09-16 11:25:58 +0000
commit7f44b6a8de7de55fb0db04cc253c83a3709230a4 (patch)
treee1d4a5196fa54c3083d9a059a963b7ad10f78a14 /app/src
parent8a10733d8c8d8f944c40f6a40bcf479e2baceb05 (diff)
downloadinfinity-for-reddit-7f44b6a8de7de55fb0db04cc253c83a3709230a4.tar
infinity-for-reddit-7f44b6a8de7de55fb0db04cc253c83a3709230a4.tar.gz
infinity-for-reddit-7f44b6a8de7de55fb0db04cc253c83a3709230a4.tar.bz2
infinity-for-reddit-7f44b6a8de7de55fb0db04cc253c83a3709230a4.tar.lz
infinity-for-reddit-7f44b6a8de7de55fb0db04cc253c83a3709230a4.tar.xz
infinity-for-reddit-7f44b6a8de7de55fb0db04cc253c83a3709230a4.tar.zst
infinity-for-reddit-7f44b6a8de7de55fb0db04cc253c83a3709230a4.zip
Fix the same value, null, was passed as the nextKey in two sequential Pages loaded from a PagingSource.
Diffstat (limited to '')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/post/PostPagingSource.java4
1 files changed, 1 insertions, 3 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/post/PostPagingSource.java b/app/src/main/java/ml/docilealligator/infinityforreddit/post/PostPagingSource.java
index 6a821d5c..cb60ae4b 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/post/PostPagingSource.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/post/PostPagingSource.java
@@ -1,7 +1,6 @@
package ml.docilealligator.infinityforreddit.post;
import android.content.SharedPreferences;
-import android.util.Log;
import androidx.annotation.NonNull;
import androidx.paging.ListenableFuturePagingSource;
@@ -157,7 +156,6 @@ public class PostPagingSource extends ListenableFuturePagingSource<String, Post>
@Nullable
@Override
public String getRefreshKey(@NonNull PagingState<String, Post> pagingState) {
- Log.i("asdfad", "asdf " + sortType.getType().value);
return null;
}
@@ -192,7 +190,7 @@ public class PostPagingSource extends ListenableFuturePagingSource<String, Post>
int currentPostsSize = postLinkedHashSet.size();
postLinkedHashSet.addAll(newPosts);
if (currentPostsSize == postLinkedHashSet.size()) {
- return new LoadResult.Page<>(new ArrayList<>(), null, lastItem);
+ return new LoadResult.Page<>(new ArrayList<>(), null, null);
} else {
return new LoadResult.Page<>(new ArrayList<>(postLinkedHashSet).subList(currentPostsSize, postLinkedHashSet.size()), null, lastItem);
}