Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fading title issue for sections with only one item #19

Open
Nams29 opened this issue May 7, 2018 · 3 comments
Open

Fading title issue for sections with only one item #19

Nams29 opened this issue May 7, 2018 · 3 comments
Labels

Comments

@Nams29
Copy link

Nams29 commented May 7, 2018

Hi @edsilfer

I noticed that if the user scrolls fast, the fading of some section titles doesn't have the time to update its alpha value : it stays a bit faded or even completely transparent. It seems to happen only for sections with one item, regardless of their position in the list. This bug was also present on the previous version of the library.

Here are two examples :
'J' and 'K' are faded
'D' is invisible and 'G' is faded

Here is an example project : http://www.mediafire.com/file/15xbax4y2mk9wjv/MyApplication.zip

Do you have any idea how to fix this behavior ?

@edsilfer edsilfer added the bug label May 7, 2018
@edsilfer
Copy link
Owner

edsilfer commented May 7, 2018

Hi @Nams29 , this is how the alpha is computed so far:

private fun computeAlpha(row: View, idx: TextView) = 1 - abs(row.y) / idx.height

I think a possible fix for this bug would be adding a threshold, i.e. if computed alpha is greater than 80%, return 100%. Could you test this approach for the scenario you've described - and also for the general case of fast scrolling with multiple items in a section?

If that doesn't work we might have to start thinking about fancier situations - like computing the scroll speed and disabling the effect for speed greater than a given value. If that is the case the fix will have to wait a little bit.

@zkvarz
Copy link

zkvarz commented May 25, 2018

While this issue is still occurring why not to add new attribute in StickyIndex for disabling fading? Awesome library though!

@Swisyn
Copy link

Swisyn commented Jul 17, 2019

@edsilfer I am also having the same issue. Do you have any plans to fix that issue? Also there is a flickering issue while scrolling the bubble, I've tried to fix it but no luck :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants