androidandroid-listviewfastscroll

Can I remove the fast scroll overlay without creating an entire custom fast scroll view?


I have a StickyListHeadersListView for which I implemented the appropriate adapter with SectionIndexer for fast scrolling. However the default fast scroll overlay works only with one character since the text box do not stretch with the text.

I found this CustomFastScrollViewDemo while browsing similar questions but since I have sticky headers for my sections, I do not really need that overlay. The user knows from the header where she/he is. I would simply remove it if that was easier.


Solution

  • You do not have to implement SectionHeader in your adapter to enable fast scroll, you can enable fast scroll separately.

    Xml:

    <se.emilsjolander.stickylistheaders.StickyListHeadersListView
        android:id="@android:id/list"
        android:fastScrollEnabled="true"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />
    

    Code:

    stickyListView.setFastScrollEnabled(true);
    

    This applies to the standard ListView as well.