Locating a specific item in a large list is fairly difficult, so we should provide a means to help the user get there quickly.
In order to help the user navigate through large lists, Android provides a few means to skip large sections of data. One of these aids is Fast Scroll, or simply, using a scroll thumb.
FastScrollEnabled
property:listView.FastScrollEnabled = true;
FastScrollEnabled
property as follows:android:fastScrollEnabled="true"
FastScrollAlwaysVisible
property:listView.FastScrollAlwaysVisible = true;
Paging through large data collections does not provide a great user experience. Android provides a few means to make the process of skipping over large sections of data easier without the user having to fling the list repeatedly. The simplest way is to enable Fast Scroll, which provides a scroll thumb that can be dragged, thus making it possible to scroll through the list very rapidly.
The thumb is initially disabled, but we can enable it by setting the FastScrollEnabled
property to true
. Once enabled, the thumb will appear if the list is large enough, usually if the total number of items is four times the number that can fit on the screen.
We can also enable fast scroll from the layout resources. To do this, we set the android:fastScrollEnabled
attribute to true
. This does exactly the same thing as the FastScrollEnabled
property, but we can keep all our view code inside the layout resource.
If we enable fast scroll, the thumb will only appear if the user is actually scrolling through the list. In order to ensure that the thumb is always visible, even when not scrolling, we set the FastScrollAlwaysVisible
property to true
.
Even though the scroll thumb is very simple, it is a quick means of improving the user experience when we have large lists.
When using the thumb, it is very difficult to see where in the list we are, so we can make use of section indexes. This is a small popup that appears as we scroll, displaying an index, such as the first letter of the items. The section index and the thumb make navigating through lists much easier, as the user can skip to a section by dragging the thumb to the desired section.