How to use fast scrolling in Android?

I have a list of events that are separated by month and year (June 2010, July 2010, etc.).

I want to enable fast scrolling because the list is really long.

How to enable fast scrolling on ListViews in Android?

+45
android android-listview
Feb 21 '12 at 9:13
source share
8 answers

In the onCreate ListActivity method, use setFastScrollEnabled :

 getListView().setFastScrollEnabled(true); 
+95
Feb 21 '12 at 9:26
source share

Use android: fastScrollEnabled in your xml:

 <ListView android:id="@+id/listview_files" ... android:fastScrollEnabled="true" > </ListView> 
+60
Mar 30 2018-12-12T00:
source share

Try to execute

  <?xml version="1.0" encoding="utf-8"?> <resources> <style name="listviewfastscrollstyle" parent="android:Theme"> <item name="android:fastScrollTrackDrawable">@drawable/listselector</item> <item name="android:fastScrollThumbDrawable">@drawable/listselector</item> </style> </resources> 

In your manifest, set the style as follows:

 <application android:icon="@drawable/icon" android:label="@string/app_name" android:theme="@style/CustomTheme"> 

this is listview

  <ExpandableListView android:id="@android:id/list1" android:layout_width="match_parent" android:layout_height="0dip" android:layout_weight="1" android:drawSelectorOnTop="false" android:fastScrollAlwaysVisible="true" android:fastScrollEnabled="true" /> 
+5
May 15 '13 at 10:46
source share

If you want to customize your fast scroller, for example, to select your own scroller image, I recommend using this source:

https://github.com/nolanlawson/CustomFastScrollViewDemo/

Basically, your listview adapter will have to implement sectionindexer. This section indexer can be very split if you do not want to complicate the situation and provide a simple quick view, although the entire length of the list.

A direct source for fastscroller is here:

https://github.com/nolanlawson/CustomFastScrollViewDemo/blob/master/src/com/nolanlawson/customfastscrollviewdemo/CustomFastScrollView.java

Put this view around your list (paste your list into this view in your xml layout file) and set android: fastScrollEnabled = "true" in the Android browser.

You can also check the previous answer: Fast scrolling issue with ListAdapter and SectionIndexer

+4
Apr 02 2018-12-21T00:
source share

I wanted to do something similar to what you wanted to achieve. I came across this post . This is a great way to quickly scroll without using the standard Android AlphabetIndexer, which requires a cursor that you may not always have.

Basically, you will need to implement the SectionIndexer interface in your adapter. In your case, instead of the current letter, you will show the current period when scrolling.

+1
Jul 08 '13 at 22:06
source share

If you want to show alphabetical indexing, you can check this:

https://github.com/andraskindler/quickscroll

This is a library project that I created because I had to use this scroll pattern in the last few applications, so I thought that others might be interested in it. It is pretty easy to use, see the Readme in the github link above.

0
Apr 11 '13 at 10:20
source share

Define fastScrollEnabled in your xml or set it at runtime when necessary.

 1) <ListView ... android:fastScrollEnabled="true" /> 2) mListView.setFastScrollEnabled(true); 
0
Jun 18 '15 at 18:03
source share

In the Layout file:

Android: fastScrollEnabled = "true"

You can programmatically enable the Fast scrollbar:

getListView () setFastScrollEnabled (true) ;.

0
May 25 '17 at 8:22
source share



All Articles