0% found this document useful (0 votes)
11 views

UI Components

Android UI Controls are essential components for creating interactive user interfaces in applications, including various elements like TextView, EditText, Button, and more. These controls enhance user interaction and provide functionalities such as text input, selection options, and alerts. Key UI controls include ProgressBar, Spinner, TimePicker, DatePicker, and RatingBar, each serving specific purposes to improve user experience.

Uploaded by

maryammtariqqq
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

UI Components

Android UI Controls are essential components for creating interactive user interfaces in applications, including various elements like TextView, EditText, Button, and more. These controls enhance user interaction and provide functionalities such as text input, selection options, and alerts. Key UI controls include ProgressBar, Spinner, TimePicker, DatePicker, and RatingBar, each serving specific purposes to improve user experience.

Uploaded by

maryammtariqqq
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Android UI Controls

Android UI Controls
Android UI Controls are those components of Android that are used to design the
UI in a more interactive way. It helps us to develop an application that makes user
interaction better with the view components. Android provides us a huge range of
UI controls of many types such as buttons, text views, etc.

As we know UI is the only thing that a user interacts with within an Application.
This is the reason that we make our Application look aesthetic and, more and more
connective. To do so, we need to add the UI controls or we say Input controls in
the respective application.

Some important Android UI controls for our applications:


 TextView

 EditText

 Button

 ImageButton

 ToggleButton

 RadioButton

 RadioGroup

 CheckBox

 AutoCompleteTextView

 ProgressBar

 Spinner

 TimePicker
 DatePicker

 SeekBar

 AlertDialog

 Switch

 RatingBar

TextView
In android, TextView is a user interface control that is used to set and display
the text to the user based on our requirements. The TextView control will act as
like label control and it won't allow users to edit the text.

There are various attributes to describe the TextView some of them


are named below:
Android: id – it is a unique id for the control.

Android: width – It displays the exact width of the TextView.

Android: height – It displays the exact height of the TextView.

Android:textColor – It set the color of the text.

Android: gravity – It is to align the TextView.

EditText
In Android, EditText is a standard entry widget in android apps. It is an overlay
over TextView that configures itself to be editable. EditText is a subclass of
TextView with text editing operations. We often use EditText in our applications
in order to provide an input or text field, especially in forms.
Button
In Android, Button represents a push button. A Push buttons can be clicked, or
pressed by the user to perform an action. There are different types of buttons used
in android such as CompoundButton, ToggleButton, RadioButton. Button is a
subclass of TextView class and compound button is the subclass of Button class.

ImageButton
It is the same as a Button but it’s used to display an image on the button to perform an
Action. In this, we need to give the source of the image so that the system can load it.

ToggleButton
The toggle button displays the ON/OFF states of a button with a light indicator.

RadioButton
Radio button in Android is the one that has only two possible states, that are either
checked or unchecked. Initially, it is in the unchecked state, once it’s checked it can’t
be unchecked.

RadioGroup
It’s a group of Radio buttons that are alike. In this, only one of all the buttons can be
chosen.

CheckBox
A CheckBox is the UI control that has two states that are either checked or unchecked.
If we have a group of CheckBox, we can select as many as we want, unlike
RadioGroup.

ProgressBar
In Android, we have a progress bar that shows the progress of some action that is
happening like pasting a file to some location. A progress bar can be in two modes:
Determinate Mode:
In this, the progress is shown with the percent of action completed. Also, the time to
be taken is already determined.

Indeterminate Mode:
In this, there is no idea of when the task would be completed, therefore, it functions
continuously.

Spinner
The Spinner in Android is a User Interface that is used to select a particular option
from a list of given options. Spinner in Android is the same as dropdown in HTML. It
provides us with a faster way to select an option of our choice. When we click on the
down arrow, it shows a list of values from which we can select one. By default, the
first value would be shown as the currently selected Value.

TimePicker
Time picker is a UI component that works as an intermediate to select a time of the
day. The time chosen by it is shown either in 24 hrs format or in 12hrs format using
AM and PM.

It gives a virtual Clock/watch to select it. This virtual clock makes it easy to choose
the time.

DatePicker
Like we have time picker, we have a date picker as UI control too. In this, the System
shows a virtual calendar to the users to choose the day.

This enables the user to choose a particular date using either a calendar or a dropdown.
These both are made to make it easier for the user to pick up a date and a time.
SeekBar
In Android, Seekbar is an extended Progress bar. A seekbar comes with a pointer that
is draggable throughout the bar either in left or right. This pointer helps to set the
progress as well. This helps the user to choose a particular range of values.

RatingBar
A rating bar in Android is an extended version of a seekbar. It is used to give the
rating by touching it. In the rating bar, a user can rate at a scale of 5 with a difference
of 0.5.

Its rating is in Stars. The user needs to tap/click the stars.

AlertDialog
Alert Dialog Box is a UI that gives the users an Alert or Warning of something. It
appears on the screen in a small window. Once it comes, the user needs to decide or
choose an option that it shows.

For example, when you enter the wrong password for email id.

Switch
In Android, a switch is a two-state UI element that holds either ON or OFF state. ON
generally means Yes and OFF means No. By default, a switch is in the OFF state. A
user can change its state many times.

AutoCompleteTextView
AutoCompleteTextView is an extension of EditText. In this UI element, the user is
provided with a few suggestions of some values/texts. The value can be chosen by the
user while filling AutoCompleteTextView.

You might also like