Using flipper and switcher widgets

The first example of this chapter made use of the TextSwitcher class, an animating View class in the standard Android API. There are several other animation utility classes, some of which you may have encountered before (such as ImageSwitcher). Both TextSwitcher and ImageSwitcher are related classes, and both inherit from the more generic ViewSwitcher class.

The ViewSwitcher class is a generic animation tool, and defines the ViewFactory interface that we implemented anonymously in the previous example. A ViewSwitcher is a ViewGroup with only two child View objects. One is displayed on the screen, while the other is hidden. The getNext utility method allows you to find out which is the "off screen" View object. ...

Get Android User Interface Development now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.