diff options
author | martinsandfuchs <martin@cluginbuehl.ch> | 2019-12-08 14:01:29 +0000 |
---|---|---|
committer | martinsandfuchs <martin@cluginbuehl.ch> | 2019-12-08 14:01:29 +0000 |
commit | 9a8a549d69ba3049a58fc31e88b95d6445dd40d0 (patch) | |
tree | 023de83387cfd51ea269085c339211b74d84be72 /app/src | |
parent | 027cbdb7a3b918046f721c579155eab07b961267 (diff) | |
download | infinity-for-reddit-9a8a549d69ba3049a58fc31e88b95d6445dd40d0.tar infinity-for-reddit-9a8a549d69ba3049a58fc31e88b95d6445dd40d0.tar.gz infinity-for-reddit-9a8a549d69ba3049a58fc31e88b95d6445dd40d0.tar.bz2 infinity-for-reddit-9a8a549d69ba3049a58fc31e88b95d6445dd40d0.tar.lz infinity-for-reddit-9a8a549d69ba3049a58fc31e88b95d6445dd40d0.tar.xz infinity-for-reddit-9a8a549d69ba3049a58fc31e88b95d6445dd40d0.tar.zst infinity-for-reddit-9a8a549d69ba3049a58fc31e88b95d6445dd40d0.zip |
Because we do not use a SmoothScroller we do not need to keep track of smooth scrolling
Diffstat (limited to 'app/src')
-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(); } } |