The Android Widget Toolbox

Android supplies a toolbox of standard Views to help you create your UIs. By using these controls (and modifying or extending them, as necessary), you can simplify your development and provide consistency between applications

The following list highlights some of the more familiar toolbox controls:

TextView — A standard read-only text label that supports multiline display, string formatting, and automatic word wrapping.

EditText — An editable text entry box that accepts multiline entry, word-wrapping, and hint text.

Chronometer — A Text View extension that implements a simple count-up timer.

ListView — A View Group that creates and manages a vertical list of Views, displaying them as rows within the list. The simplest List View displays the toString value of each object in an array, using a Text View for each item.

Spinner — A composite control that displays a Text View and an associated List View that lets you select an item from a list to display in the textbox. It’s made from a Text View displaying the current selection, combined with a button that displays a selection dialog when pressed.

Button — A standard push button

ToggleButton — A two-state button that can be used as an alternative to a check box. It’s particularly appropriate where pressing the button will initiate an action as well as changing a state (such as when turning something on or off).

ImageButton — A push button for which you can specify a customized background image (Drawable).

CheckBox — A two-state button represented by a checked or unchecked box.

RadioButton — A two-state grouped button. A group of these presents the user with a number of possible options, of which only one can be enabled at a time.

ViewFlipper — A View Group that lets you define a collection of Views as a horizontal row in which only one View is visible at a time, and in which transitions between visible views can be animated.

VideoView — Handles all state management and display Surface configuration for playing videos more simply from within your Activity

QuickContactBadge — Displays a badge showing the image icon assigned to a contact you specify using a phone number, name, email address, or URI. Clicking the image will display the quick contact bar, which provides shortcuts for contacting the selected contact — including calling and sending an SMS, email, and IM.

ViewPager — Released as part of the Compatibility Package, the View Pager implements a horizontally scrolling set of Views similar to the UI used in Google Play and Calendar. The View Pager allows users to swipe or drag left or right to switch between different Views.

Leave a Comment