diff options
author | Alex Ning <chineseperson5@gmail.com> | 2021-06-26 13:30:13 +0000 |
---|---|---|
committer | Alex Ning <chineseperson5@gmail.com> | 2021-06-26 13:30:13 +0000 |
commit | 6e4a808cbbb9ea2454da51b363155b9b6b2f4ea5 (patch) | |
tree | 787b2080ade21a80101ea5eed2b17ef8fa7ae00c /app/src/main/java | |
parent | 7db721f297c85f203bd67bc7876fcfaea235b7d7 (diff) | |
download | infinity-for-reddit-6e4a808cbbb9ea2454da51b363155b9b6b2f4ea5.tar infinity-for-reddit-6e4a808cbbb9ea2454da51b363155b9b6b2f4ea5.tar.gz infinity-for-reddit-6e4a808cbbb9ea2454da51b363155b9b6b2f4ea5.tar.bz2 infinity-for-reddit-6e4a808cbbb9ea2454da51b363155b9b6b2f4ea5.tar.lz infinity-for-reddit-6e4a808cbbb9ea2454da51b363155b9b6b2f4ea5.tar.xz infinity-for-reddit-6e4a808cbbb9ea2454da51b363155b9b6b2f4ea5.tar.zst infinity-for-reddit-6e4a808cbbb9ea2454da51b363155b9b6b2f4ea5.zip |
Fix scroll to wrong next or previous parent comment position in ViewPostDetailFragment.
Diffstat (limited to '')
-rw-r--r-- | app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewPostDetailFragment.java | 5 |
1 files changed, 2 insertions, 3 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 0caf078e..0201f183 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewPostDetailFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewPostDetailFragment.java @@ -12,7 +12,6 @@ import android.graphics.drawable.Drawable; import android.os.Bundle; import android.os.Handler; import android.util.DisplayMetrics; -import android.util.Log; import android.view.HapticFeedbackConstants; import android.view.LayoutInflater; import android.view.Menu; @@ -1665,7 +1664,7 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic if (nextParentPosition < 0) { return; } - mSmoothScroller.setTargetPosition(nextParentPosition); + mSmoothScroller.setTargetPosition(mCommentsRecyclerView == null ? nextParentPosition + 1 : nextParentPosition); if (mLinearLayoutManager != null) { mIsSmoothScrolling = true; mLinearLayoutManager.startSmoothScroll(mSmoothScroller); @@ -1682,7 +1681,7 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic if (nextParentPosition < 0) { return; } - mSmoothScroller.setTargetPosition(nextParentPosition); + mSmoothScroller.setTargetPosition(mCommentsRecyclerView == null ? nextParentPosition + 1 : nextParentPosition); if (mLinearLayoutManager != null) { mIsSmoothScrolling = true; mLinearLayoutManager.startSmoothScroll(mSmoothScroller); |