1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-23 00:06:27 +00:00

Use separator handler for fast scroll delay

This commit is contained in:
M66B 2021-07-22 21:30:13 +02:00
parent 162306268c
commit 10a9c80e13

View file

@ -465,14 +465,17 @@ public class FastScrollerEx extends RecyclerView.ItemDecoration implements Recyc
float percentage = (scrollbarLength == 0 ? 0 : y / (float) scrollbarLength);
int pos = Math.round(count * percentage);
scrollTo = pos;
mRecyclerView.removeCallbacks(scroll);
mRecyclerView.postDelayed(scroll, 100);
if (handler == null)
handler = new android.os.Handler(android.os.Looper.getMainLooper());
handler.removeCallbacks(scroll);
handler.postDelayed(scroll, 100);
}
mVerticalDragY = y;
}
private int scrollTo;
private android.os.Handler handler;
private final Runnable scroll = new Runnable() {
@Override