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

Request: add fast-scroller #5

Closed
AndroidDeveloperLB opened this issue Jan 7, 2015 · 13 comments
Closed

Request: add fast-scroller #5

AndroidDeveloperLB opened this issue Jan 7, 2015 · 13 comments

Comments

@AndroidDeveloperLB
Copy link

As the title says.
It's like on the ListView and as shown on the contacts app, so that the user could scroll easily and go through the sections.

@TonicArtos
Copy link
Owner

This will be done after some changes to how sections are handled, and the scroll bar size and position is calculated.

@AndroidDeveloperLB
Copy link
Author

Thank you for considering it.
I was wondering : how do you add a fast scroller ? Is there any built in view for this?

@TonicArtos
Copy link
Owner

Honestly, I only looked at it just now. It looks like I'll have to build a fast scroll for it. I might end out doing a generic fast scroll overlay as well.

@AndroidDeveloperLB
Copy link
Author

That's too bad. odd that Google doesn't provide one, as it's used on various scrolling views...

@TonicArtos
Copy link
Owner

I think the reason for it is twofold. 1) RecyclerView is extremely bare
bones anyway, and 2) adding a fast scroller might have limited the kinds of
layout manager you can create. I am already thinking about what kind of
assumptions I might have to make in order to implement the fast scroller.
On 8 Jan 2015 20:49, "AndroidDeveloperLB" notifications@github.com wrote:

That's too bad. odd that Google doesn't provide one, as it's used on
various scrolling views...


Reply to this email directly or view it on GitHub
#5 (comment).

@AndroidDeveloperLB
Copy link
Author

I didn't talk about RecyclerView. I meant even before it was introduced.
I think ListView isn't the only view with a fast-scroller, so I also thought that it's odd that it isn't a build in view that you can use in other places.
About how to make it generic, I think you should have a 2-way listener. One for telling where the user is scrolling via the fast-scroller, and another for telling where the user is scrolling on the scrolling-container (listView/RecyclerView/...) .
When scrolling via the scroller itself, the scrolling-container should scroll so that the first item (row in the case of ListView) would be at the top and completely visible.
Also, you could add an option to customize how the fast-scroller looks like and how the small popup of it looks like (and if you wish to show it at all).
Another thing to look for is the SectionIndexer.

@AndroidDeveloperLB
Copy link
Author

Maybe SectionIndexer isn't needed.
I think that once you provide a listener, the developer can check what is the first item, and decide what to show for the popup of the scroller.

@RayDar
Copy link

RayDar commented Apr 22, 2015

I would like to throw my hat into the ring in requesting a 'vertical fast scroller'.

@AndroidDeveloperLB
Copy link
Author

@RayDar I've made a POC that demonstrates it, if you wish:
https://github.com/AndroidDeveloperLB/LollipopContactsRecyclerViewFastScroller

@EpariNigam
Copy link

EpariNigam commented May 24, 2016

@TonicArtos in the LayoutManager, computeVerticalScrollRange() method is there, when you are going to implement this method. It's implemented but of no use as of now bcoz, for this reason, I am unable to implement FastScroll and is failing for computation.

@TonicArtos
Copy link
Owner

It is planned, but the rewrite still has to be finished. With 0.4 it wasn't possible to implement without significant performance problems, and was never going to work with lazily loaded views either.

@TonicArtos
Copy link
Owner

See the roadmap

@luweglinski
Copy link

luweglinski commented Jul 28, 2016

 private fun updateBubbleAndHandlePosition() {
        if (bubble == null || handle!!.isSelected)
            return
        val offset = recyclerView!!.computeVerticalScrollOffset()
        val extent = recyclerView!!.computeVerticalScrollExtent()
        val range = recyclerView!!.computeVerticalScrollRange()

        var relativePos = 0f
        if (recyclerView!!.childCount > 0) {
            relativePos = offset / (range - extent).toFloat()
        }
        setBubbleAndHandlePosition(viewHeight * relativePos)
    }

change this method to work with https://github.com/AndroidDeveloperLB/LollipopContactsRecyclerViewFastScroller

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

No branches or pull requests

5 participants