0% found this document useful (0 votes)
14 views47 pages

Module-3 (2)

The document provides an overview of designing user interfaces in Android using various view groups, including basic views like TextView, EditText, and Button, as well as picker views like TimePicker and DatePicker. It explains the functionality of list views, specifically ListView and SpinnerView, for displaying long lists of items. Additionally, it covers customization options for views such as ProgressBar and AutoCompleteTextView to enhance user interaction.

Uploaded by

darm22ece
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views47 pages

Module-3 (2)

The document provides an overview of designing user interfaces in Android using various view groups, including basic views like TextView, EditText, and Button, as well as picker views like TimePicker and DatePicker. It explains the functionality of list views, specifically ListView and SpinnerView, for displaying long lists of items. Additionally, it covers customization options for views such as ProgressBar and AutoCompleteTextView to enhance user interaction.

Uploaded by

darm22ece
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 47

Module-3

Designing Your User interface


Using Views
Designing Your User interface Using Views

In particular, you will learn about the following view


groups:
➤➤ Basic views — Commonly used views such as the
TextView, EditText, and Button
views
➤➤ Picker views — Views that enable users to select
from a list, such as the TimePicker
and DatePicker views
➤➤ List views — Views that display a long list of items,
such as the ListView and the
SpinnerView views
BASIC VIEWS
To get started, let’s explore some of the basic views that
you can use to design the UI of your Android applications:
➤➤ TextView
➤➤ EditText
➤➤ Button
➤➤ ImageButton
➤➤ CheckBox
➤➤ ToggleButton
➤➤ RadioButton
➤➤ RadioGroup
These basic views enable you to display text information, as well as
perform some basic selection
TextView view
• The TextView view is used to display text to the user. This is
the most basic view and one that you will frequently use
when you develop Android applications.
• If you need to allow users to edit the text displayed, you
should use the subclass of TextView, EditText

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

You might also like