Code Samples

 

Lua Languages Resources

 

Quick Links

Scrolling Lists

The correct handling of lists is an imporant part of the user experience. In phones, lists are used for the display of contacts, on portable media devices there are lists of music, images and videos. On portable navigation devices lists are used to display potential destinations and points of interest.

These examples go through different versions of contact lists in order to demonstrate slightly different list implementations.

 

Example 1: Simple Scrolling List


View a video of this example.

A straightforward list of entries, each entry consisting of multiple items: checkbox, an image and 2 text labels.

See the code.

Download the source code.

Download the data.

 

Example 2: Scrolling List With Orientation Changes


View a video of this example.

A variation of the previous example, this list of complex items caters for changes in orientation. It can be used in cases where landscape to portrait mode changes are required.

Note how easy it is to hangle events in FancyPants. Both the orientation change event and the button press callback are handled in very few lines of code.

See the code.

Download the source code.

 

Example 3: Fancier Scrolling List


View a video of this example.

Another variation on the first scrolling list. In this example we slide list items into place and vary the background colour for every second row, so they can be seen more easily.

See the code.

Download the source code.