mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-12-26 10:58:23 +01:00
Fix bug when progress indicator is present on the comments page, even after loading all the comments
Signed-off-by: Balazs Toldi <balazs@toldi.eu>
This commit is contained in:
parent
0fa2da6ffa
commit
3b5852d1e4
@ -856,6 +856,16 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<Comment> newComments = new ArrayList<>();
|
||||||
|
for (int i = 0; i < comments.size(); i++) {
|
||||||
|
if (loadedComments.contains(comments.get(i).getId())) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
newComments.add(comments.get(i));
|
||||||
|
loadedComments.add(comments.get(i).getId());
|
||||||
|
}
|
||||||
|
comments = (ArrayList<Comment>) newComments;
|
||||||
|
|
||||||
int sizeBefore = mVisibleComments.size();
|
int sizeBefore = mVisibleComments.size();
|
||||||
mVisibleComments.addAll(comments);
|
mVisibleComments.addAll(comments);
|
||||||
for (int i = 0; i < comments.size(); i++) {
|
for (int i = 0; i < comments.size(); i++) {
|
||||||
|
@ -1450,6 +1450,7 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic
|
|||||||
@Override
|
@Override
|
||||||
public void onFetchCommentSuccess(ArrayList<Comment> expandedComments,
|
public void onFetchCommentSuccess(ArrayList<Comment> expandedComments,
|
||||||
Integer parentId, ArrayList<Integer> children) {
|
Integer parentId, ArrayList<Integer> children) {
|
||||||
|
isFetchingComments = false;
|
||||||
ViewPostDetailFragment.this.children = children;
|
ViewPostDetailFragment.this.children = children;
|
||||||
pages_loaded++;
|
pages_loaded++;
|
||||||
comments = expandedComments;
|
comments = expandedComments;
|
||||||
@ -1508,8 +1509,6 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic
|
|||||||
if (changeRefreshState) {
|
if (changeRefreshState) {
|
||||||
isRefreshing = false;
|
isRefreshing = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
isFetchingComments = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -1535,8 +1534,7 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic
|
|||||||
|
|
||||||
isLoadingMoreChildren = true;
|
isLoadingMoreChildren = true;
|
||||||
|
|
||||||
Retrofit retrofit = mAccessToken == null ? mRetrofit.getRetrofit() : mOauthRetrofit;
|
FetchComment.fetchComments(mExecutor, new Handler(), mRetrofit.getRetrofit(), mAccessToken,
|
||||||
FetchComment.fetchComments(mExecutor, new Handler(), retrofit, mAccessToken,
|
|
||||||
mPost.getId(), null, sortType, mExpandChildren, pages_loaded + 1, new FetchComment.FetchCommentListener() {
|
mPost.getId(), null, sortType, mExpandChildren, pages_loaded + 1, new FetchComment.FetchCommentListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onFetchCommentSuccess(ArrayList<Comment> expandedComments, Integer parentId, ArrayList<Integer> children) {
|
public void onFetchCommentSuccess(ArrayList<Comment> expandedComments, Integer parentId, ArrayList<Integer> children) {
|
||||||
|
Loading…
Reference in New Issue
Block a user