Open michelesalvador opened 2 years ago
Sadly I don't know how to fix this. I only combined multiple solutions that I was given by others, similar to another repository I have, of auto-resizing TextView:
https://github.com/AndroidDeveloperLB/AutoFitTextView
Can you please post a sample (video and project), for better showing others of the issue, so that maybe someone could see it and fix it?
This issue appears in the sample project of this repo itself.
I only augmented fastScrollMinThumbSize
to 250dp to make the vertical misalignment more evident.
Here a screen recording:
https://user-images.githubusercontent.com/7121173/140483663-27d9aeb6-ff4e-437a-99a0-d42a2bef124b.mp4
I don't know how to fix this. I only combined multiple solutions that I was given by others
I think it's absolutely normal to copy code from everywhere. But please try to understand the code and fix it if needed, as a real developer! 😙
@michelesalvador Could it be that it's on the normal RecyclerView, even without my fixes? Can you please check it out?
The problem seems to be in the way mVerticalThumbCenterY
is calculated.
I'm trying some different formulas, but without significant results 🙁
Please let me know if you succeed.
Could it be that it's on the normal RecyclerView, even without my fixes?
To answer your question: yes, the same issue is also on the normal RecyclerView with fastScrollEnabled
.
If you can reproduce it there, please post a bug report to Google, with a sample project, video and steps to reproduce: https://issuetracker.google.com/issues/new?component=460887&template=1422600
You already opened an issue that includes this problem: https://issuetracker.google.com/issues/177734518
Are you sure it's the same issue?
Title of https://issuetracker.google.com/177734518 says
dragging thumb doesn't move properly (or at all) with your touch
That is generic enough to include also this misaligned dragging issue. And the Cprudypshd.mp4 video uploaded there actually shows this issue.
I just discovered that this issue can be (partially) fixed by setting to margin
a value which is the half of the value of minThumbSize
.
FastScrollerEx(recyclerView, thumbDrawable, lineDrawable, thumbDrawable, lineDrawable,
thickness, minRange, margin = 50, true, minThumbSize = 100)
Partially because it works only when there are a lot of recyclerView items which make the thumb its minimum height. The issue remains when there are less items and the thumb becomes higher.
@michelesalvador So what are you saying that I can do to fix this?
Thank you for this useful library. Unfortunately I found a flaw. I noticed that scrolling up or down, the thumb does not exactly follow my finger, but it progressively stays further back. To be precise, if you drag the thumb across the entire screen for example up to down, it will eventually be too far above exactly its own height.