diff options
author | Docile-Alligator <25734209+Docile-Alligator@users.noreply.github.com> | 2023-11-01 03:58:11 +0000 |
---|---|---|
committer | Docile-Alligator <25734209+Docile-Alligator@users.noreply.github.com> | 2023-11-01 03:58:11 +0000 |
commit | cf327fe8ae48c1eb93e1cfcaa73f903ab7073e55 (patch) | |
tree | 4e456da8b77c96ebb43f06a57fadfac876e1d8ea /app/src/main | |
parent | fc462849ec206ddc5f85d733a2ed2767e345c3f4 (diff) | |
download | infinity-for-reddit-cf327fe8ae48c1eb93e1cfcaa73f903ab7073e55.tar infinity-for-reddit-cf327fe8ae48c1eb93e1cfcaa73f903ab7073e55.tar.gz infinity-for-reddit-cf327fe8ae48c1eb93e1cfcaa73f903ab7073e55.tar.bz2 infinity-for-reddit-cf327fe8ae48c1eb93e1cfcaa73f903ab7073e55.tar.lz infinity-for-reddit-cf327fe8ae48c1eb93e1cfcaa73f903ab7073e55.tar.xz infinity-for-reddit-cf327fe8ae48c1eb93e1cfcaa73f903ab7073e55.tar.zst infinity-for-reddit-cf327fe8ae48c1eb93e1cfcaa73f903ab7073e55.zip |
Fix showing double "no comments" message in CommentsRecyclerViewAdapter if it's in single thread mode and the comment is filtered out.
Diffstat (limited to '')
-rw-r--r-- | app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsRecyclerViewAdapter.java | 12 |
1 files changed, 11 insertions, 1 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 1609bb05..395bdd4d 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsRecyclerViewAdapter.java @@ -279,8 +279,14 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi if (isInitiallyLoading) { return VIEW_TYPE_FIRST_LOADING; } else if (isInitiallyLoadingFailed) { + if(mIsSingleCommentThreadMode && position == 0) { + return VIEW_TYPE_VIEW_ALL_COMMENTS; + } return VIEW_TYPE_FIRST_LOADING_FAILED; } else { + if(mIsSingleCommentThreadMode && position == 0) { + return VIEW_TYPE_VIEW_ALL_COMMENTS; + } return VIEW_TYPE_NO_COMMENT_PLACEHOLDER; } } @@ -1137,10 +1143,14 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi @Override public int getItemCount() { - if (isInitiallyLoading || isInitiallyLoadingFailed || mVisibleComments.size() == 0) { + if (isInitiallyLoading) { return 1; } + if (isInitiallyLoadingFailed || mVisibleComments.size() == 0) { + return mIsSingleCommentThreadMode ? 2 : 1; + } + if (mHasMoreComments || loadMoreCommentsFailed) { if (mIsSingleCommentThreadMode) { return mVisibleComments.size() + 2; |