aboutsummaryrefslogtreecommitdiff
path: root/app/src
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2021-06-25 04:46:14 +0000
committerAlex Ning <chineseperson5@gmail.com>2021-06-25 04:46:14 +0000
commit9819059e297e0767ed6a90c4d5c228c320943da4 (patch)
tree5b6ff4fec369c3ffc3efac456be90e6c5cec836e /app/src
parent2236305e191cb1879fe5192bb88eace766a43fdb (diff)
downloadinfinity-for-reddit-9819059e297e0767ed6a90c4d5c228c320943da4.tar
infinity-for-reddit-9819059e297e0767ed6a90c4d5c228c320943da4.tar.gz
infinity-for-reddit-9819059e297e0767ed6a90c4d5c228c320943da4.tar.bz2
infinity-for-reddit-9819059e297e0767ed6a90c4d5c228c320943da4.tar.lz
infinity-for-reddit-9819059e297e0767ed6a90c4d5c228c320943da4.tar.xz
infinity-for-reddit-9819059e297e0767ed6a90c4d5c228c320943da4.tar.zst
infinity-for-reddit-9819059e297e0767ed6a90c4d5c228c320943da4.zip
Fix showing wrong comment after user submitted a comment in ViewPostDetailFragment.
Diffstat (limited to 'app/src')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsRecyclerViewAdapter.java4
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewPostDetailFragment.java1
2 files changed, 2 insertions, 3 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 9a443121..4f70b5fb 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsRecyclerViewAdapter.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsRecyclerViewAdapter.java
@@ -845,9 +845,9 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi
mVisibleComments.add(0, comment);
if (isInitiallyLoading) {
- notifyItemInserted(2);
- } else {
notifyItemInserted(1);
+ } else {
+ notifyItemInserted(0);
}
}
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewPostDetailFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewPostDetailFragment.java
index afa5c5fb..beff863f 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewPostDetailFragment.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewPostDetailFragment.java
@@ -570,7 +570,6 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic
mRecyclerView.setAdapter(mConcatAdapter);
}
-
if (comments == null) {
fetchCommentsRespectRecommendedSort(false);
} else {