diff options
Diffstat (limited to '')
-rw-r--r-- | app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/PostFragment.java | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/PostFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/PostFragment.java index 2ae04cfa..17661c24 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/PostFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/PostFragment.java @@ -122,7 +122,6 @@ public class PostFragment extends Fragment implements FragmentCommunicator { private CountDownTimer resumeLazyModeCountDownTimer; private float lazyModeInterval; private int postLayout; - private boolean mIsSmoothScrolling = false; public PostFragment() { // Required empty public constructor @@ -140,7 +139,6 @@ public class PostFragment extends Fragment implements FragmentCommunicator { } private boolean scrollPostsByCount(int count) { - mIsSmoothScrolling = true; if (mLinearLayoutManager != null) { int pos = mLinearLayoutManager.findFirstVisibleItemPosition(); int targetPosition = pos + count; @@ -188,16 +186,6 @@ public class PostFragment extends Fragment implements FragmentCommunicator { } }; - mPostRecyclerView.clearOnScrollListeners(); - mPostRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() { - @Override - public void onScrollStateChanged(@NonNull RecyclerView recyclerView, int newState) { - if (newState == RecyclerView.SCROLL_STATE_IDLE) { - mIsSmoothScrolling = false; - } - } - }); - window = activity.getWindow(); Resources resources = getResources(); @@ -298,12 +286,10 @@ public class PostFragment extends Fragment implements FragmentCommunicator { mPostRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() { @Override public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) { - if (!mIsSmoothScrolling) { - if (dy > 0) { - ((MainActivity) activity).postScrollDown(); - } else if (dy < 0) { - ((MainActivity) activity).postScrollUp(); - } + if (dy > 0) { + ((MainActivity) activity).postScrollDown(); + } else if (dy < 0) { + ((MainActivity) activity).postScrollUp(); } } |