From e6e27f5f0bdca3806a6e96a4f5b11f9f46d63c5f Mon Sep 17 00:00:00 2001 From: Renan Lukas <14964993+RenanLukas@users.noreply.github.com> Date: Fri, 7 Jun 2024 18:55:37 -0300 Subject: [PATCH 1/2] Remove maximum number of posts that can be loaded in ReaderPostAdapter --- .../android/ui/reader/adapters/ReaderPostAdapter.java | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/reader/adapters/ReaderPostAdapter.java b/WordPress/src/main/java/org/wordpress/android/ui/reader/adapters/ReaderPostAdapter.java index 54b22755cc1a..ad99e8af6602 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/reader/adapters/ReaderPostAdapter.java +++ b/WordPress/src/main/java/org/wordpress/android/ui/reader/adapters/ReaderPostAdapter.java @@ -96,8 +96,6 @@ public class ReaderPostAdapter extends RecyclerView.Adapter= getItemCount() - 1)) { mDataRequestedListener.onRequestData(); } @@ -933,7 +930,6 @@ public void removeGapMarker() { private class LoadPostsTask extends AsyncTask { private ReaderPostList mAllPosts; - private boolean mCanRequestMorePostsTemp; private int mGapMarkerPositionTemp; @Override @@ -973,10 +969,6 @@ protected Boolean doInBackground(Void... params) { return false; } - // if we're not already displaying the max # posts, enable requesting more when - // the user scrolls to the end of the list - mCanRequestMorePostsTemp = (numExisting < ReaderConstants.READER_MAX_POSTS_TO_DISPLAY); - // determine whether a gap marker exists - only applies to tagged posts mGapMarkerPositionTemp = getGapMarkerPosition(); @@ -1016,7 +1008,6 @@ private int getGapMarkerPosition() { protected void onPostExecute(Boolean result) { if (result) { ReaderPostAdapter.this.mGapMarkerPosition = mGapMarkerPositionTemp; - ReaderPostAdapter.this.mCanRequestMorePosts = mCanRequestMorePostsTemp; mPosts.clear(); mPosts.addAll(mAllPosts); notifyDataSetChanged(); From ed269edcf7138be7ad026f2b18c986a535984725 Mon Sep 17 00:00:00 2001 From: Renan Lukas <14964993+RenanLukas@users.noreply.github.com> Date: Mon, 10 Jun 2024 12:34:57 -0300 Subject: [PATCH 2/2] Remove unused variable from ReaderPostAdapter --- .../android/ui/reader/adapters/ReaderPostAdapter.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/reader/adapters/ReaderPostAdapter.java b/WordPress/src/main/java/org/wordpress/android/ui/reader/adapters/ReaderPostAdapter.java index ad99e8af6602..b6510de69ab3 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/reader/adapters/ReaderPostAdapter.java +++ b/WordPress/src/main/java/org/wordpress/android/ui/reader/adapters/ReaderPostAdapter.java @@ -944,21 +944,17 @@ protected void onCancelled() { @Override protected Boolean doInBackground(Void... params) { - int numExisting = 0; switch (getPostListType()) { case TAG_PREVIEW: case TAG_FOLLOWED: case SEARCH_RESULTS: mAllPosts = ReaderPostTable.getPostsWithTag(mCurrentTag, MAX_ROWS, EXCLUDE_TEXT_COLUMN); - numExisting = ReaderPostTable.getNumPostsWithTag(mCurrentTag); break; case BLOG_PREVIEW: if (mCurrentFeedId != 0) { mAllPosts = ReaderPostTable.getPostsInFeed(mCurrentFeedId, MAX_ROWS, EXCLUDE_TEXT_COLUMN); - numExisting = ReaderPostTable.getNumPostsInFeed(mCurrentFeedId); } else { mAllPosts = ReaderPostTable.getPostsInBlog(mCurrentBlogId, MAX_ROWS, EXCLUDE_TEXT_COLUMN); - numExisting = ReaderPostTable.getNumPostsInBlog(mCurrentBlogId); } break; case TAGS_FEED: