diff options
author | Alex Ning <chineseperson5@gmail.com> | 2021-06-23 05:35:42 +0000 |
---|---|---|
committer | Alex Ning <chineseperson5@gmail.com> | 2021-06-23 05:35:42 +0000 |
commit | 50db0d0719e9ebc90c8585bf93415fa6feca5316 (patch) | |
tree | 32ae88e7cdb9e116dca15fc190cad5ad5bc19198 /app/src/main/java | |
parent | 9437217bbb8beced9d72647469e89a4892951645 (diff) | |
download | infinity-for-reddit-50db0d0719e9ebc90c8585bf93415fa6feca5316.tar infinity-for-reddit-50db0d0719e9ebc90c8585bf93415fa6feca5316.tar.gz infinity-for-reddit-50db0d0719e9ebc90c8585bf93415fa6feca5316.tar.bz2 infinity-for-reddit-50db0d0719e9ebc90c8585bf93415fa6feca5316.tar.lz infinity-for-reddit-50db0d0719e9ebc90c8585bf93415fa6feca5316.tar.xz infinity-for-reddit-50db0d0719e9ebc90c8585bf93415fa6feca5316.tar.zst infinity-for-reddit-50db0d0719e9ebc90c8585bf93415fa6feca5316.zip |
Add OnScrollListener to correct RecyclerView in ViewPostDetailFragment.
Diffstat (limited to '')
-rw-r--r-- | app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewPostDetailFragment.java | 8 |
1 files changed, 4 insertions, 4 deletions
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 992b6880..8903e9d7 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewPostDetailFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewPostDetailFragment.java @@ -290,7 +290,7 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic } if (children != null && children.size() > 0) { - mRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() { + (mCommentsRecyclerView == null ? mRecyclerView : mCommentsRecyclerView).addOnScrollListener(new RecyclerView.OnScrollListener() { @Override public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) { super.onScrolled(recyclerView, dx, dy); @@ -333,7 +333,7 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic } }); } else { - mRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() { + (mCommentsRecyclerView == null ? mRecyclerView : mCommentsRecyclerView).addOnScrollListener(new RecyclerView.OnScrollListener() { @Override public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) { super.onScrolled(recyclerView, dx, dy); @@ -1162,7 +1162,7 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic if (children.size() > 0) { mRecyclerView.clearOnScrollListeners(); - mRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() { + (mCommentsRecyclerView == null ? mRecyclerView : mCommentsRecyclerView).addOnScrollListener(new RecyclerView.OnScrollListener() { @Override public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) { super.onScrolled(recyclerView, dx, dy); @@ -1300,7 +1300,7 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic if (children.size() > 0) { mRecyclerView.clearOnScrollListeners(); - mRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() { + (mCommentsRecyclerView == null ? mRecyclerView : mCommentsRecyclerView).addOnScrollListener(new RecyclerView.OnScrollListener() { @Override public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) { super.onScrolled(recyclerView, dx, dy); |