Fix showing duplicate progress bar when refreshing in ViewPostDetailFragment.

This commit is contained in:
Alex Ning 2021-08-02 14:54:51 +08:00
parent 4e0af16094
commit a3b4c54ec2

View File

@ -900,25 +900,11 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi
public void initiallyLoading() { public void initiallyLoading() {
resetCommentSearchIndex(); resetCommentSearchIndex();
if (mVisibleComments.size() != 0) { notifyItemRangeRemoved(0, getItemCount());
int previousSize = mVisibleComments.size(); mVisibleComments.clear();
mVisibleComments.clear(); isInitiallyLoading = true;
if (mIsSingleCommentThreadMode) { isInitiallyLoadingFailed = false;
notifyItemRangeRemoved(0, previousSize + ((mHasMoreComments || loadMoreCommentsFailed) ? 1 : 0) + 1); notifyItemInserted(0);
} else {
notifyItemRangeRemoved(0, previousSize + ((mHasMoreComments || loadMoreCommentsFailed) ? 1 : 0));
}
}
if (isInitiallyLoading || isInitiallyLoadingFailed) {
isInitiallyLoading = true;
isInitiallyLoadingFailed = false;
notifyItemChanged(0);
} else {
isInitiallyLoading = true;
isInitiallyLoadingFailed = false;
notifyItemInserted(0);
}
} }
public void initiallyLoadCommentsFailed() { public void initiallyLoadCommentsFailed() {