Android Tutorial

(avery) #1

By : Ketan Bhimani


256 

Exploring Other View Containers

Many other user interface controls are available within the Android
SDK. Some of these controls are listed here:
 Switchers: A ViewSwitcher control contains only two child View objects
and only one of those is shown at a time. It switches between the two,
animating as it does so. Primarily, the ImageSwitcher, shown in Figure,
and TextSwitcher objects are used. Each one provides a way to set a new
child View, either a Drawable resource or a text string, and then animates
from what is displayed to the new contents.

ImageSwitcher while in the middle of switching between two
Drawable resources.


 SlidingDrawer: Another View container is the
SlidingDrawer control. This control includes two parts: a
handle and a container view. The user drags the
handle open and the internal contents are shown; then
the user can drag the handle shut and the content
disappears. The SlidingDrawer can be used
horizontally or vertically and is always used from within
a layout representing the larger screen. This makes the
SlidingDrawer especially useful for application
configurations such as game controls. A user can pull out the drawer,
pause the game, change some features, and then close the
SlidingDrawer to resume the game. Figure shows how the typical
SlidingDrawer looks when pulled open.
Free download pdf