Smooth Scroll vs. Snap Scroll Lists

This article discusses how to create iPhone or Android style smooth-scrolling lists, as well as the old snap-scrolling lists that were the bulk of the entire GUI for older clam-shell phone types of lists.

Dynamic lists in an Altia GUI have the lion's share of the effort put into the external C logic powering it (to sort the list, look up the next few items, populate items, etc etc). The number of objects in Altia Design is actually quite small.

Attached at the link below is a simple dsn that shows how snap-scroll lists are built (like in many virtual instrument clusters in cars, non-smart phones, many appliances and industrial products, medical devices, etc) vs. smooth scroll lists (like lists seen in high-end automotive, medical, consumer products, and of course, seen on all of today's smart phones). This dsn could serve as a working example that is ready to be driven by code for the list population, scrolling, etc.

Again, each type of list only needs a few objects in Altia Design. It's up to logic to populate and "scroll" the list, plus keep track of what list is showing, what the current position in the list is (what record index in the logic's data set), how to sort the lists, and so on. Altia just gives you an easy way to build the objects that receive the data. Logic handles the rest.

Please review the attached dsn. The snap scroll list and smooth-scroll list are identical, except the smooth scroll list is inside a Clip object, and you "scroll" the list by updating the Clip's built-in _yorigin animation.

With the snap-scroll list, you typically "scroll" the list if the highlight bar is at the top or bottom position of the list (by filling in the same set of Text I/Os with new data from code) if you receive an up event at the top highlight position, or a down event at the bottom highlight position. Otherwise, you just move the highlight bar up or down.

With the smooth-scroll list, you can scroll up or down at any time, using the Clip's built-in _yorigin animation, but logic has to know where the "ends" are to "wrap" to the top, fill in new data, and keep scrolling as if the list is infinitely long for smooth scrolling. This is exactly how your iOS or Android phone's email, text, and contacts lists work (or any list on a smart phone, really).

Have more questions? Submit a request


Please sign in to leave a comment.