mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-12-25 10:28:22 +01:00
Because we do not use a SmoothScroller we do not need to keep track of smooth scrolling
This commit is contained in:
parent
027cbdb7a3
commit
9a8a549d69
@ -122,7 +122,6 @@ public class PostFragment extends Fragment implements FragmentCommunicator {
|
|||||||
private CountDownTimer resumeLazyModeCountDownTimer;
|
private CountDownTimer resumeLazyModeCountDownTimer;
|
||||||
private float lazyModeInterval;
|
private float lazyModeInterval;
|
||||||
private int postLayout;
|
private int postLayout;
|
||||||
private boolean mIsSmoothScrolling = false;
|
|
||||||
|
|
||||||
public PostFragment() {
|
public PostFragment() {
|
||||||
// Required empty public constructor
|
// Required empty public constructor
|
||||||
@ -140,7 +139,6 @@ public class PostFragment extends Fragment implements FragmentCommunicator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean scrollPostsByCount(int count) {
|
private boolean scrollPostsByCount(int count) {
|
||||||
mIsSmoothScrolling = true;
|
|
||||||
if (mLinearLayoutManager != null) {
|
if (mLinearLayoutManager != null) {
|
||||||
int pos = mLinearLayoutManager.findFirstVisibleItemPosition();
|
int pos = mLinearLayoutManager.findFirstVisibleItemPosition();
|
||||||
int targetPosition = pos + count;
|
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();
|
window = activity.getWindow();
|
||||||
|
|
||||||
Resources resources = getResources();
|
Resources resources = getResources();
|
||||||
@ -298,12 +286,10 @@ public class PostFragment extends Fragment implements FragmentCommunicator {
|
|||||||
mPostRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
|
mPostRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
|
public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
|
||||||
if (!mIsSmoothScrolling) {
|
if (dy > 0) {
|
||||||
if (dy > 0) {
|
((MainActivity) activity).postScrollDown();
|
||||||
((MainActivity) activity).postScrollDown();
|
} else if (dy < 0) {
|
||||||
} else if (dy < 0) {
|
((MainActivity) activity).postScrollUp();
|
||||||
((MainActivity) activity).postScrollUp();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user