AndroidDeveloperLB / FastScrollerAndRecyclerViewFixes

A collection of fixes for FastScroller
Apache License 2.0
12 stars 0 forks source link

Thumb does not remain glued to the finger #1

Open michelesalvador opened 2 years ago

michelesalvador commented 2 years ago

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.

AndroidDeveloperLB commented 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?

michelesalvador commented 2 years ago

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

michelesalvador commented 2 years ago

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! 😙

AndroidDeveloperLB commented 2 years ago

@michelesalvador Could it be that it's on the normal RecyclerView, even without my fixes? Can you please check it out?

michelesalvador commented 2 years ago

The problem seems to be in the way mVerticalThumbCenterY is calculated. I'm trying some different formulas, but without significant results 🙁

AndroidDeveloperLB commented 2 years ago

Please let me know if you succeed.

michelesalvador commented 2 years ago

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.

AndroidDeveloperLB commented 2 years ago

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

michelesalvador commented 2 years ago

You already opened an issue that includes this problem: https://issuetracker.google.com/issues/177734518

AndroidDeveloperLB commented 2 years ago

Are you sure it's the same issue?

michelesalvador commented 6 months ago

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.

michelesalvador commented 6 months ago

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.

AndroidDeveloperLB commented 1 month ago

@michelesalvador So what are you saying that I can do to fix this?