aboutsummaryrefslogtreecommitdiff
path: root/app/src
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2021-08-02 06:54:51 +0000
committerAlex Ning <chineseperson5@gmail.com>2021-08-02 06:54:51 +0000
commita3b4c54ec2255cea03e930201cda9a0a37ef5c08 (patch)
treea62450d1195c2658befeb1d270ce09d693755265 /app/src
parent4e0af16094eca22f4438d021e3f22405d69d7aed (diff)
downloadinfinity-for-reddit-a3b4c54ec2255cea03e930201cda9a0a37ef5c08.tar
infinity-for-reddit-a3b4c54ec2255cea03e930201cda9a0a37ef5c08.tar.gz
infinity-for-reddit-a3b4c54ec2255cea03e930201cda9a0a37ef5c08.tar.bz2
infinity-for-reddit-a3b4c54ec2255cea03e930201cda9a0a37ef5c08.tar.lz
infinity-for-reddit-a3b4c54ec2255cea03e930201cda9a0a37ef5c08.tar.xz
infinity-for-reddit-a3b4c54ec2255cea03e930201cda9a0a37ef5c08.tar.zst
infinity-for-reddit-a3b4c54ec2255cea03e930201cda9a0a37ef5c08.zip
Fix showing duplicate progress bar when refreshing in ViewPostDetailFragment.
Diffstat (limited to 'app/src')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsRecyclerViewAdapter.java24
1 files changed, 5 insertions, 19 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsRecyclerViewAdapter.java
index 6b9d4f54..d0b3cc82 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsRecyclerViewAdapter.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsRecyclerViewAdapter.java
@@ -900,25 +900,11 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi
public void initiallyLoading() {
resetCommentSearchIndex();
- if (mVisibleComments.size() != 0) {
- int previousSize = mVisibleComments.size();
- mVisibleComments.clear();
- if (mIsSingleCommentThreadMode) {
- notifyItemRangeRemoved(0, previousSize + ((mHasMoreComments || loadMoreCommentsFailed) ? 1 : 0) + 1);
- } else {
- notifyItemRangeRemoved(0, previousSize + ((mHasMoreComments || loadMoreCommentsFailed) ? 1 : 0));
- }
- }
-
- if (isInitiallyLoading || isInitiallyLoadingFailed) {
- isInitiallyLoading = true;
- isInitiallyLoadingFailed = false;
- notifyItemChanged(0);
- } else {
- isInitiallyLoading = true;
- isInitiallyLoadingFailed = false;
- notifyItemInserted(0);
- }
+ notifyItemRangeRemoved(0, getItemCount());
+ mVisibleComments.clear();
+ isInitiallyLoading = true;
+ isInitiallyLoadingFailed = false;
+ notifyItemInserted(0);
}
public void initiallyLoadCommentsFailed() {