Module-3 (2)
Module-3 (2)
NOTE: In some other platforms, the TextView is commonly known as the label view. Its
sole purpose is to display text on the screen.
Button, ImageButton, EditText, CheckBox, ToggleButton,
RadioButton, and RadioGroup Views
• Besides the TextView view, which you will likely use the most often, there are
some other basic controls that you will fi nd yourself frequently using: Button,
ImageButton, EditText, CheckBox, ToggleButton, RadioButton, and RadioGroup
Example
ProgressBar View
• The ProgressBar view provides visual feedback
of some ongoing tasks, such as when you are
performing a task in the background.
Customizing the ProgressBar View
AutoCompleteTextView View
• The AutoCompleteTextView is a view that is similar to EditText
(in fact it is a subclass of EditText), except that it shows a list of
completion suggestions automatically while the user is typing
AutoCompleteTextView View
AutoCompleteTextView View
ListViews
• List views are views that enable you to display a long
list of items.
• In Android, there are two typesof list views: ListView
and SpinnerView.
• Both are useful for displaying long lists of items. The
following
ListView View
• The ListView displays a list of items in a vertically
scrolling list.
ListView View
• The ListView displays a list of items in a vertically scrolling list.
ListView View
Customizing the ListView
• The ListView is a versatile control that you can further customize. The
following shows how you can allow multiple items in the ListView to be
selected and how you can enable filtering support.
Customizing the ListView
• Storing Items in the strings.xml File:Using the same project created in the
previous section, add the following lines in bold to the strings.xml file
located in the res/values folder:
Spinner View
• The ListView displays a long list of items in an activity, but sometimes you
may want your user interface to display other views, and hence you do not
have the additional space for a fullscreen view like the ListView.
• In such cases, you should use the SpinnerView.
• The SpinnerView displays one item at a time from a list and enables users
to choose among them
Spinner View
Spinner View
Picker Views
• Selecting the date and time is one of the common tasks you need to
perform in a mobile application.
• Android supports this functionality through the TimePicker and DatePicker
views.
TimePicker View
• The TimePicker view enables users to select a time of the day, in either 24-
hour mode or AM/PM mode.
TimePicker View
Displaying the TimePicker in a Dialog Window
Displaying the TimePicker in a Dialog Window
DatePicker View
• Using the DatePicker, you can enable users to select
a particular date on the activity.
DatePicker View
DatePicker View
DatePicker View